{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-21305","id":"CVE-2021-21305","title":"Code Injection vulnerability in CarrierWave","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 develo","descriptionLong":"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.","published":"2021-02-08T19:20:14.000Z","updated":"2026-10-20T10:54:28.112256017Z","reserved":"2020-12-22T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L","rating":"high","source":"GitHub_M"},{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L","rating":"high","source":"github.com"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"NVD"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"OSV"},{"version":"3.1","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L","rating":"high","source":"GitHub"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","rating":"high","source":"NVD"}],"rating":"high","products":["carrierwaveuploader carrierwave"],"affectedProducts":[{"vendor":"carrierwaveuploader","product":"carrierwave","defaultStatus":null,"versions":[{"status":"affected","version":"< 1.3.2"},{"status":"affected","version":">= 2.0.0, < 2.1.1"}],"platforms":[]}],"packages":[{"ecosystem":"RubyGems","name":"carrierwave","purl":"pkg:gem/carrierwave","ranges":["<1.3.2",">=2.0.0 <2.1.1"],"fixed":["1.3.2","2.1.1"],"advisory":"GHSA-cf3w-g86h-35x4"}],"cwes":["CWE-74","CWE-94"],"aliases":["GHSA-cf3w-g86h-35x4"],"references":[{"url":"https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#132---2021-02-08","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","advisory","web"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#211---2021-02-08","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","advisory","web"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Third Party Advisory","evidence","web"]},{"url":"https://rubygems.org/gems/carrierwave","tags":["x_refsource_MISC","x_transferred","Product","Third Party Advisory","advisory","web"]},{"url":"https://github.com/carrierwaveuploader/carrierwave/commit/387116f5c72efa42bc3938d946b4c8d2f22181b7","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21305","tags":["advisory"]},{"url":"https://github.com/carrierwaveuploader/carrierwave","tags":["package"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/carrierwave/CVE-2021-21305.yml","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.13208,"epssPercentile":0.96464,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-21305","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21305","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-21305","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-cf3w-g86h-35x4","ok":true,"note":"GHSA-cf3w-g86h-35x4"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-21305","ok":true,"note":"scored 2026-11-20"}],"aiTitle":false,"tech":[],"critical":["EPSS 13% with CVSS 7.4"],"attention":null}