Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-21305
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 11:32 UTC · Revision 1
Source evidence
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.
osv:CVE-2021-21305
Complete source record
{
"id": "5ae5d463c1f9ab6c27e8d48ab08a62cfce3b3ae44885288b516afabedbbfca20",
"url": "https://osv.dev/vulnerability/CVE-2021-21305",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-21305",
"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.",
"evidence": "osv:CVE-2021-21305",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2021-21305",
"aliases": [
"CVE-2021-21305",
"GHSA-cf3w-g86h-35x4"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/carrierwaveuploader/carrierwave",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "56f39b23d16431a79faf8e361d4ee08238db2f66"
},
{
"introduced": "e1c3eea981ad3963bf5bf5af586286abd1252caa"
},
{
"fixed": "003e2ceeaa856f2605cf8096b401e76168ffc8ba"
},
{
"fixed": "387116f5c72efa42bc3938d946b4c8d2f22181b7"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "1.3.2"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:*",
"range": [
{
"introduced": "2.0.1"
},
{
"fixed": "2.1.1"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "387116f5c72efa42bc3938d946b4c8d2f22181b7"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v2.1.0",
"v2.0.2",
"v2.0.1",
"v1.3.1",
"v1.3.0",
"v1.2.3",
"v1.2.2",
"v1.2.1",
"v1.2.0",
"v1.1.0",
"v1.0.0",
"v1.0.0.rc",
"v1.0.0.beta",
"v0.8.0",
"v0.7.1",
"v0.7.0",
"v0.6.2",
"v0.6.1",
"v0.6.0",
"v0.5.8",
"v0.5.6",
"v0.5.5",
"v0.5.3",
"v0.5.1",
"v0.5.0",
"v0.5.0.beta2",
"v0.4.5",
"v0.4.3",
"v0.4.2",
"v0.3.5",
"v0.3.4",
"v0.3.3",
"v0.3.2",
"v0.1.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21305.json"
}
}
],
"modified": "2026-10-20T10:54:28.112256017Z",
"provider": "osv",
"references": [
"https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#132---2021-02-08",
"https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#211---2021-02-08",
"https://rubygems.org/gems/carrierwave",
"https://github.com/carrierwaveuploader/carrierwave/commit/387116f5c72efa42bc3938d946b4c8d2f22181b7",
"https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2021-21305",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 385402,
"published_at": "2021-02-08T20:15:12.527+00:00"
}