CVE-2021-21305: carrierwave_project carrierwave Injection
Vulnerability summary
CVE-2021-21305 is a high (CVSS 8.8) Injection vulnerability in carrierwave_project carrierwave. EPSS estimates a 12.68% chance of exploitation in the next 30 days, higher than 96.2% of scored vulnerabilities. 1 public exploit is recorded.
Advisory lineage
Upstream 0 · Downstream 1 · Related 1Timeline
- 08-02-2021PublishedVulnerability first disclosed.
- 03-08-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
6 scores · 5 sources · 2 versions- CVE.orgCNA7.4HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:LDiffers
- OSV · UbuntuEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated8.8HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- OSV · RubygemsEcosystem advisory · calculated7.4HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:LDiffers
EPSS trend
Probability
12.68%
Chance of exploitation in the next 30 days
Percentile
96%
Versus all other CVEs
30-day change
0.00 pp
From 12.68% on 21-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundCarrierwave
Maturity: poc
Weaknesses
CWE · root cause- CWE-74Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')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.
- CWE-94Improper Control of Generation of Code ('Code Injection')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.
Affected systems
Carrierwave_project1 product
- carrierwave< 1.3.2 | ≥ 2.0.1, < 2.1.1
Carrierwaveuploader1 product
- carrierwave< 1.3.2 | ≥ 2.0.0, < 2.1.1
Debian1 product
- ruby-carrierwave< 1.3.2-1
RubyGems1 product
- carrierwave< 1.3.2 | ≥ 2.0.0, < 2.1.1
Ubuntu1 product
- ruby-carrierwaveAll versions (No fix recorded) | < 1.2.2-1ubuntu0.1~esm1 | < 1.3.1-2ubuntu0.1~esm1
5 vendors · 5 products
References
12 links- github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.mdX Refsource MISCREPORTWEBRelease NotesThird Party Advisory
- github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.mdX Refsource MISCREPORTWEBRelease NotesThird Party Advisory
- github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4X Refsource CONFIRMREPORTWEBExploitThird Party Advisory
- github.com/carrierwaveuploader/carrierwave/commit/387116f5c72efa42bc3938d946b4c8d2f22181b7X Refsource MISCREPORTWEBPatchThird Party Advisory