# CVE-2021-21305: Code Injection vulnerability in CarrierWave

- Severity: High 7.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 13.2%, higher than 96% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-02-08T19:16:39.000Z
- Modified: 2026-07-08T06:28:16.049Z
- Also known as: GHSA-cf3w-g86h-35x4
- Weaknesses: CWE-74, CWE-94
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- carrierwaveuploader carrierwave: < 1.3.2; >= 2.0.0, < 2.1.1
- carrierwave (RubyGems): before 1.3.2; from 2.0.0 before 2.1.1
- carrierwave_project carrierwave: before 1.3.2; from 2.0.1 before 2.1.1

## Every score

- GitHub_M: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L`
- GitHub: CVSS:3.1 7.4 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4> (exploit, third-party-advisory, web)
- <https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#132---2021-02-08> (release-notes, third-party-advisory, web)
- <https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#211---2021-02-08> (release-notes, third-party-advisory, web)
- <https://rubygems.org/gems/carrierwave> (product, third-party-advisory, web)
- <https://github.com/carrierwaveuploader/carrierwave/commit/387116f5c72efa42bc3938d946b4c8d2f22181b7> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21305> (advisory)
- <https://github.com/carrierwaveuploader/carrierwave> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/carrierwave/CVE-2021-21305.yml> (web)

## Sources

- CVE List: [CVE-2021-21305](https://www.cve.org/CVERecord?id=CVE-2021-21305), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-cf3w-g86h-35x4](https://github.com/advisories/GHSA-cf3w-g86h-35x4), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-21305](https://nvd.nist.gov/vuln/detail/CVE-2021-21305), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-21305 · Whole record: https://cve.day/CVE-2021-21305.json · Rebuilt by cve.day 2026-11-25T22:57:59.846Z
