Code Injection vulnerability in CarrierWave
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-94.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| carrierwaveuploader | carrierwave | before 1.3.2; 2.0.0 to before 2.1.1 | 1.3.2, 2.1.1 | Patch available | CNA |
| — | carrierwave (RubyGems) | before 1.3.2 | 1.3.2 | Patch available | GHSA-cf3w-g86h-35x4 |
| — | carrierwave (RubyGems) | 2.0.0 to before 2.1.1 | 2.1.1 | Patch available | GHSA-cf3w-g86h-35x4 |
- carrierwave Vendorcarrierwaveuploader Affected before 1.3.2; 2.0.0 to before 2.1.1 Fixed in 1.3.2, 2.1.1 Patch available CNA
- carrierwave (RubyGems) Vendor— Affected before 1.3.2 Fixed in 1.3.2 Patch available GHSA-cf3w-g86h-35x4
- carrierwave (RubyGems) Vendor— Affected 2.0.0 to before 2.1.1 Fixed in 2.1.1 Patch available GHSA-cf3w-g86h-35x4
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:* | before 1.3.2; 2.0.1 to before 2.1.1 | Vulnerable | carrierwaveuploader |
- cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:* Versions before 1.3.2; 2.0.1 to before 2.1.1 Vulnerable ·carrierwaveuploader
Remediation
- Fix · CNA carrierwave (carrierwaveuploader) Fixed in 1.3.2, 2.1.1
- Fix · GHSA-cf3w-g86h-35x4 carrierwave (RubyGems) Fixed in 1.3.2 Advisory →
- Fix · GHSA-cf3w-g86h-35x4 carrierwave (RubyGems) Fixed in 2.1.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-21305
- 2026-10-03 Alias added: GHSA-cf3w-g86h-35x4
References
Patch 1
Advisory 4
More carrierwaveuploader Carrierwave vulnerabilities
- TI-2026-32499 CarrierWave has a denylisted_content_type bypass via Unescaped Regex Metacharacters CVSS 3.1MEDIUM 6.1
- TI-2023-26755 CarrierWave has a content-type allowlist bypass vulnerability, possibly leading to XSS CVSS 3.1MEDIUM 6.8
- TI-2024-19216 CarrierWave's Content-Type allowlist bypass vulnerability which possibly leads to XSS remained CVSS 3.1MEDIUM 6.8
- TI-2021-04388 Server-side request forgery in CarrierWave CVSS 3.1MEDIUM 4.3
Sources
- CVE-2021-21305 · CVE Program
- CVE-2021-21305 · NVD
- FIRST EPSS
- GHSA-cf3w-g86h-35x4 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences