cve.bz

CVE-2021-21305 carrierwave project carrierwave: Code Injection

8.8 highExploit referenceEPSS 13%Fix available

High (8.8) in carrierwave project carrierwave. EPSS 13% estimated probability of exploitation activity in the next 30 days. Fixed in carrierwave 1.3.2, 2.1.1.

On this page
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.

Severity

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
EPSS
13% (unchanged from 13% a week ago; 13% 30 days ago) estimated probability of exploitation activity in the next 30 days; 96th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWEs
CWE-94 Improper Control of Generation of Code (Code Injection)
CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component (Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-21305 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-21305?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-21305?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-21305 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
carrierwave_project:carrierwavebefore 1.3.2
carrierwave_project:carrierwavefrom 2.0.1 before 2.1.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-cf3w-g86h-35x4RubyGemscarrierwave<1.3.21.3.2
GHSA-cf3w-g86h-35x4RubyGemscarrierwave>=2.0.0 <2.1.12.1.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12ruby-carrierwave1.3.2-1DEBIAN-CVE-2021-21305
Ubuntu16.04:LTSruby-carrierwaveno fix listedUBUNTU-CVE-2021-21305
UbuntuPro:18.04:LTSruby-carrierwave1.2.2-1ubuntu0.1~esm1UBUNTU-CVE-2021-21305 USN-7497-1
UbuntuPro:20.04:LTSruby-carrierwave1.3.1-2ubuntu0.1~esm1UBUNTU-CVE-2021-21305 USN-7497-1
UbuntuPro:22.04:LTSruby-carrierwave1.3.2-2ubuntu0.22.04.1~esm1USN-7497-1
UbuntuPro:24.04:LTSruby-carrierwave1.3.2-2ubuntu0.24.04.1~esm1USN-7497-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-74 (37).

References

Check your stackJSON