{"schemaVersion":3,"id":"CVE-2021-21305","aliases":["UBUNTU-CVE-2021-21305","DEBIAN-CVE-2021-21305","GHSA-cf3w-g86h-35x4"],"status":"published","duplicateOf":null,"title":null,"description":"CarrierWave is an open-source RubyGem which provides a simple and flexible way to upload files from Ruby applications. In CarrierWave before versions 1.3.2 and 2.1.1, there is a code injection vulnerability. The \"#manipulate!\" method inappropriately evals the content of mutation option(:read/:write), allowing attackers to craft a string that can be executed as a Ruby code. If an application developer supplies untrusted inputs to the option, it will lead to remote code execution(RCE). This is fixed in versions 1.3.2 and 2.1.1.","dates":{"published":"2021-02-08T19:20:14.000Z","modified":"2024-08-03T18:09:15.001Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":8.8,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":7.4,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":7.2,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":7.2,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Rubygems","score":7.4,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L","exploitability":7.9,"impact":6.2,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":7.5,"severity":"high","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.12678,"percentile":0.96247,"severity":"medium","asOf":"2026-10-21T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-21T00:00:00.000Z","baselineScore":0.12678},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.12678,"percentile":0.96247}],"last30":[{"date":"2026-09-21T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.12678,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.12678,"percentile":0.96247}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"GITHUB_CARRIERWAVEUPLOADER_CARRIERWAVE","name":"Carrierwave","source":"github","url":"https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4","maturity":"poc","reliabilityScore":0.3,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')","description":"The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.","type":"weakness","status":"Incomplete","abstraction":"Class","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/74.html"},{"id":"CWE-94","name":"Improper Control of Generation of Code ('Code Injection')","description":"The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"Medium","url":"https://cwe.mitre.org/data/definitions/94.html"}],"affected":[{"vendor":"carrierwave_project","product":"carrierwave","name":"carrierwave","label":"carrierwave","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 1.3.2","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.1, < 2.1.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.3.2 | ≥ 2.0.1, < 2.1.1","eol":null,"hubHref":"/vendor/carrierwave_project/carrierwave"},{"vendor":"carrierwaveuploader","product":"carrierwave","name":"carrierwave","label":"carrierwave","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 1.3.2","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.1.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.3.2 | ≥ 2.0.0, < 2.1.1","eol":null,"hubHref":"/vendor/carrierwaveuploader/carrierwave"},{"vendor":"debian","product":"ruby-carrierwave","name":"ruby-carrierwave","label":"ruby-carrierwave","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/ruby-carrierwave","purlType":"deb","versions":[{"text":"< 1.3.2-1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.3.2-1","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"ruby-carrierwave","name":"ruby-carrierwave","label":"ruby-carrierwave","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/ruby-carrierwave","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null},{"text":"< 1.2.2-1ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null},{"text":"< 1.3.1-2ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null}],"versionsText":"All versions (No fix recorded) | < 1.2.2-1ubuntu0.1~esm1 | < 1.3.1-2ubuntu0.1~esm1","eol":null,"hubHref":null},{"vendor":"RubyGems","product":"carrierwave","name":"carrierwave","label":"carrierwave","ecosystem":"RubyGems","cpePart":null,"purl":"pkg:gem/carrierwave","purlType":"gem","versions":[{"text":"< 1.3.2","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.0.0, < 2.1.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.3.2 | ≥ 2.0.0, < 2.1.1","eol":null,"hubHref":null}],"affectedCount":5,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#132---2021-02-08","label":"github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md","hostname":"github.com","tags":["X Refsource MISC","REPORT","WEB","Release Notes","Third Party Advisory"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#211---2021-02-08","label":"github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md","hostname":"github.com","tags":["X Refsource MISC","REPORT","WEB","Release Notes","Third Party Advisory"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4","label":"github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4","hostname":"github.com","tags":["X Refsource CONFIRM","REPORT","WEB","Exploit","Third Party Advisory"]},{"url":"https://rubygems.org/gems/carrierwave","label":"rubygems.org/gems/carrierwave","hostname":"rubygems.org","tags":["X Refsource MISC","REPORT","WEB","Product","Third Party Advisory"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/commit/387116f5c72efa42bc3938d946b4c8d2f22181b7","label":"github.com/carrierwaveuploader/carrierwave/commit/387116f5c72efa42bc3938d946b4c8d2f22181b7","hostname":"github.com","tags":["X Refsource MISC","REPORT","WEB","Patch","Third Party Advisory"]},{"url":"https://ubuntu.com/security/CVE-2021-21305","label":"ubuntu.com/security/CVE-2021-21305","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-21305","label":"www.cve.org/CVERecord?id=CVE-2021-21305","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-7497-1","label":"ubuntu.com/security/notices/USN-7497-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-21305","label":"security-tracker.debian.org/tracker/CVE-2021-21305","hostname":"security-tracker.debian.org","tags":["Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21305","label":"nvd.nist.gov/vuln/detail/CVE-2021-21305","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/carrierwaveuploader/carrierwave","label":"github.com/carrierwaveuploader/carrierwave","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/carrierwave/CVE-2021-21305.yml","label":"github.com/rubysec/ruby-advisory-db/blob/master/gems/carrierwave/CVE-2021-21305.yml","hostname":"github.com","tags":["WEB"]}],"lineage":{"upstream":[],"downstream":["USN-7497-1"],"duplicates":[],"related":["USN-7497-1"]},"timeline":[{"kind":"published","date":"2021-02-08T19:20:14.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-03T18:09:15.001Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":48,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-22T07:18:31.840Z","stale":false,"partial":false}}