CVE-2021-21305
Code Injection vulnerability in CarrierWave
Reported by github_m · Published February 8, 2021
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| ruby-carrierwave | Ubuntu:Pro:18.04:LTS | 1.2.2-1ubuntu0.1~esm1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| carrierwaveuploader | carrierwave | < 1.3.2, >= 2.0.0, < 2.1.1 |
| carrierwaveuploader | carrierwave | 0, 2.0.0 |
Timeline
- Feb 8, 2021 CVE Published
- Feb 8, 2021 PoC Published (2 in total, the first dated here)
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Aug 3, 2024 CVE Updated
- Mar 7, 2026 Distribution Patch
- Mar 7, 2026 Security Advisory (2 in total, the first dated here)
- Aug 26, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-21305
vulnetix vdb fixes CVE-2021-21305
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-21305/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart