原始 OSV JSON{
"id": "GHSA-cf3w-g86h-35x4",
"aliases": [
"CVE-2021-21305"
],
"details": "### Impact\n[CarrierWave::RMagick](https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/processing/rmagick.rb) has a Code Injection vulnerability. Its `#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.\nIf an application developer supplies untrusted inputs to the option, it will lead to remote code execution(RCE).\n\n(But supplying untrusted input to the option itself is dangerous even in absence of this vulnerability, since is prone to DoS vulnerability - attackers can try to consume massive amounts of memory by resizing to a very large dimension)\n\n### Proof of Concept\n```ruby\nclass MyUploader < CarrierWave::Uploader::Base\n include CarrierWave::RMagick\nend\n\nMyUploader.new.manipulate!({ read: { density: \"1 }; p 'Hacked'; {\" }}) # => shows \"Hacked\"\n```\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\nStop supplying untrusted input to `#manipulate!`'s mutation option.\n\n### References\n[Code Injection Software Attack](https://owasp.org/www-community/attacks/Code_Injection)\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 [[email protected] ](mailto:[email protected] )",
"summary": "Code Injection vulnerability in CarrierWave::RMagick",
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.3.2"
}
]
}
],
"package": {
"name": "carrierwave",
"ecosystem": "RubyGems"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.1.1"
}
]
}
],
"package": {
"name": "carrierwave",
"ecosystem": "RubyGems"
}
}
],
"modified": "2022-04-27T19:58:17Z",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:L"
}
],
"published": "2021-02-08T19:16:39Z",
"references": [
{
"url": "https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-cf3w-g86h-35x4",
"type": "WEB"
},
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-21305",
"type": "ADVISORY"
},
{
"url": "https://github.com/carrierwaveuploader/carrierwave/commit/387116f5c72efa42bc3938d946b4c8d2f22181b7",
"type": "WEB"
},
{
"url": "https://github.com/carrierwaveuploader/carrierwave",
"type": "PACKAGE"
},
{
"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-21305.yml",
"type": "WEB"
},
{
"url": "https://rubygems.org/gems/carrierwave",
"type": "WEB"
}
],
"schema_version": "1.4.0",
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-94"
],
"severity": "HIGH",
"github_reviewed": true,
"nvd_published_at": "2021-02-08T20:15:00Z",
"github_reviewed_at": "2021-02-08T18:51:46Z"
}
}