CVE-2021-21288: Carrierwave Server-side Request Forgery Vulnerability
MODERATECVE-2021-21288 is a MODERATE (CVSS 4.3) server-side request forgery vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Carrierwave libraries in the RubyGems ecosystem. The issue involves server-side request forgery in carrierwave. Remediation is available by upgrading affected packages to version 1.3.2, 2.1.1.
CVE-2021-21288 at a Glance
Security Impact
CVSS: 4.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2021-21288
To remediate this vulnerability, upgrade all affected Carrierwave dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade carrierwave to 1.3.2
Upgrade carrierwave to 2.1.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for carrierwave
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-21288, inspect your project dependencies for Carrierwave:
inspect dependencies for carrierwave
Analyze the terminal output to locate any version of Carrierwave in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Carrierwave, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-21288 Affected Carrierwave Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
carrierwave
|
RubyGems |
< 1.3.2
|
1.3.2
|
|
carrierwave
|
RubyGems |
≥ 2.0.0
< 2.1.1
|
2.1.1
|
References
Frequently Asked Questions
What is CVE-2021-21288?
Which Carrierwave versions are affected?
What version fixes CVE-2021-21288?
Is carrierwave affected?
What is the CVSS score of CVE-2021-21288?
What CWE is associated with CVE-2021-21288?
How can I check RubyGems dependencies for CVE-2021-21288?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fwcm-636p-68r5",
"modified" : "2023-05-16T15:41:50Z",
"published" : "2021-02-08T19:16:26Z",
"aliases" : [ "CVE-2021-21288" ],
"summary" : "Server-side request forgery in CarrierWave",
"details" : "### Impact\n[CarrierWave download feature](https://github.com/carrierwaveuploader/carrierwave#uploading-files-from-a-remote-location) has an SSRF vulnerability, allowing attacks to provide DNS entries or IP addresses that are intended for internal use and gather information about the Intranet infrastructure of the platform.\n\n### Patches\nUpgrade to [2.1.1](https://rubygems.org/gems/carrierwave/versions/2.1.1) or [1.3.2](https://rubygems.org/gems/carrierwave/versions/1.3.2).\n\n### Workarounds\nUsing proper network segmentation and applying the principle of least privilege to outbound connections from application servers can reduce the severity of SSRF vulnerabilities. Ideally the vulnerable gem should run on an isolated server without access to any internal network resources or cloud metadata access.\n\n### References\n[Server-Side Request Forgery Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [CarrierWave repo](https://github.com/carrierwaveuploader/carrierwave)\n* Email me at [mit.shibuya@gmail.com](mailto:mit.shibuya@gmail.com)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "carrierwave"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "carrierwave"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-fwcm-636p-68r5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21288"
}, {
"type" : "WEB",
"url" : "https://github.com/carrierwaveuploader/carrierwave/commit/012702eb3ba1663452aa025831caa304d1a665c0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/carrierwaveuploader/carrierwave"
}, {
"type" : "WEB",
"url" : "https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#132---2021-02-08"
}, {
"type" : "WEB",
"url" : "https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md#211---2021-02-08"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/carrierwave/CVE-2021-21288.yml"
}, {
"type" : "WEB",
"url" : "https://rubygems.org/gems/carrierwave"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-02-08T18:51:29Z",
"nvd_published_at" : "2021-02-08T20:15:00Z"
}
}