CVE-2022-39224: Arr pm Arr-pm Vulnerable To Arbitrary Shell Vulnerability
HIGHCVE-2022-39224 is a HIGH (CVSS 7.0) arr-pm vulnerable to arbitrary shell vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Arr pm libraries in the RubyGems ecosystem. The issue involves arr-pm vulnerable to arbitrary shell execution when extracting or listing files contained in a malicious rpm.. Remediation is available by upgrading affected packages to version 0.0.12.
CVE-2022-39224 at a Glance
Security Impact
CVSS: 7.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-39224
To remediate this vulnerability, upgrade all affected Arr pm 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 arr-pm to 0.0.12
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for arr-pm
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-39224, inspect your project dependencies for Arr pm:
inspect dependencies for arr-pm
Analyze the terminal output to locate any version of Arr pm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.12), 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Arr pm, 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-2022-39224 Affected Arr pm Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
arr-pm
|
RubyGems |
< 0.0.12
|
0.0.12
|
References
Frequently Asked Questions
What is CVE-2022-39224?
Which Arr pm versions are affected?
What version fixes CVE-2022-39224?
Is arr-pm affected?
What is the CVSS score of CVE-2022-39224?
What CWE is associated with CVE-2022-39224?
How can I check RubyGems dependencies for CVE-2022-39224?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-88cv-mj24-8w3q",
"modified" : "2022-09-21T17:00:12Z",
"published" : "2022-09-21T17:00:12Z",
"aliases" : [ "CVE-2022-39224" ],
"summary" : "arr-pm vulnerable to arbitrary shell execution when extracting or listing files contained in a malicious rpm.",
"details" : "### Impact\n\nArbitrary shell execution is possible when using RPM::File#files and RPM::File#extract if the RPM contains a malicious \"payload compressor\" field.\n\nThis vulnerability impacts the `extract` and `files` methods of the `RPM::File` class in the affected versions of this library.\n\n### Patches\n\nVersion 0.0.12 is available with a fix for these issues.\n\n### Workarounds\n\nWhen using an affected version of this library (arr-pm), ensure any RPMs being processed contain valid/known payload compressor values. Such values include: gzip, bzip2, xz, zstd, and lzma.\n\nYou can check the payload compressor field in an rpm by using the rpm command line tool. For example:\n\n```\n% rpm -qp example-1.0-1.x86_64.rpm --qf \"%{PAYLOADCOMPRESSOR}\\n\"\ngzip\n```\n\n### Impact on known dependent projects\n\nThis library is used by [fpm](https://github.com/jordansissel/fpm). The vulnerability may impact fpm only when using the flag `-s rpm` or `--input-type rpm` to convert a malicious rpm to another format. It does not impact creating rpms.\n\n### References\n\n* https://github.com/jordansissel/ruby-arr-pm/pull/14\n* https://github.com/jordansissel/ruby-arr-pm/pull/15\n\n### Credit\n\nThanks to @joernchen for reporting this problem and contributing to the resolution :)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [the arr-pm issue tracker](https://github.com/jordansissel/ruby-arr-pm/)\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "arr-pm"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.12"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jordansissel/ruby-arr-pm/security/advisories/GHSA-88cv-mj24-8w3q"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39224"
}, {
"type" : "WEB",
"url" : "https://github.com/jordansissel/ruby-arr-pm/pull/14"
}, {
"type" : "WEB",
"url" : "https://github.com/jordansissel/ruby-arr-pm/pull/15"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jordansissel/ruby-arr-pm"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/arr-pm/CVE-2022-39224.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-21T17:00:12Z",
"nvd_published_at" : "2022-09-21T23:15:00Z"
}
}