CVE-2021-33564: Dragonfly Remote Code Execution Vulnerability
CRITICALCVE-2021-33564 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')) affecting Dragonfly libraries in the RubyGems ecosystem. The issue involves dragonfly contains remote code execution vulnerability. Remediation is available by upgrading affected packages to version 1.4.0.
CVE-2021-33564 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2021-33564
To remediate this vulnerability, upgrade all affected Dragonfly 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 dragonfly to 1.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for dragonfly
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-33564, inspect your project dependencies for Dragonfly:
inspect dependencies for dragonfly
Analyze the terminal output to locate any version of Dragonfly in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.0), 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-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection'), where the product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string. In Dragonfly, 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-33564 Affected Dragonfly Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
dragonfly
|
RubyGems |
< 1.4.0
|
1.4.0
|
References
Frequently Asked Questions
What is CVE-2021-33564?
Which Dragonfly versions are affected?
What version fixes CVE-2021-33564?
Is dragonfly affected?
What is the CVSS score of CVE-2021-33564?
What CWE is associated with CVE-2021-33564?
How can I check RubyGems dependencies for CVE-2021-33564?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j858-xp5v-f8xx",
"modified" : "2023-08-25T21:02:50Z",
"published" : "2021-06-02T21:42:49Z",
"aliases" : [ "CVE-2021-33564" ],
"summary" : "Dragonfly contains remote code execution vulnerability",
"details" : "An argument injection vulnerability in the Dragonfly gem before 1.4.0 for Ruby allows remote attackers to read and write to arbitrary files via a crafted URL when the `verify_url` option is disabled. This may lead to code execution. The problem occurs because the generate and process features mishandle use of the ImageMagick convert utility.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "dragonfly"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-33564"
}, {
"type" : "WEB",
"url" : "https://github.com/markevans/dragonfly/issues/513"
}, {
"type" : "WEB",
"url" : "https://github.com/markevans/dragonfly/commit/25399297bb457f7fcf8e3f91e85945b255b111b5"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-j858-xp5v-f8xx"
}, {
"type" : "WEB",
"url" : "https://github.com/markevans/dragonfly/compare/v1.3.0...v1.4.0"
}, {
"type" : "WEB",
"url" : "https://github.com/mlr0p/CVE-2021-33564"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/dragonfly/CVE-2021-33564.yml"
}, {
"type" : "WEB",
"url" : "https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/master/cves/2021/CVE-2021-33564.yaml"
}, {
"type" : "WEB",
"url" : "https://zxsecurity.co.nz/research/argunment-injection-ruby-dragonfly"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-88", "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-06-01T16:59:54Z",
"nvd_published_at" : "2021-05-29T14:15:00Z"
}
}