Vulnerabilities in pkg:gem/arr-pm

PACKAGE
Advisory Identifier: GHSA-88cv-mj24-8w3q
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/arr-pm

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/arr-pm. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-88cv-mj24-8w3q CVE-2022-39224 HIGH arr-pm vulnerable to arbitrary shell execution when extracting or listing files contained in a malicious rpm.

CVE-2022-39224 at a Glance

CVE Identifier CVE-2022-39224
GHSA Identifier GHSA-88cv-mj24-8w3q
Severity HIGH
CVSS v3.1 Base Score 7.0
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Arr pm
Package Ecosystem RubyGems
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

arr-pm fixed: 0.0.12
Upgrade arr-pm to 0.0.12
Verify Direct and Transitive Dependencies

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

### Impact Arbitrary shell execution is possible when using RPM::File#files and RPM::File#extract if the RPM contains a malicious "payload compressor" field. This vulnerability impacts the `extract` and `files` methods of the `RPM::File` class in the affected versions of this library. ### Patches Version 0.0.12 is available with a fix for these issues. ### Workarounds When 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. You can check the payload compressor field in an rpm by using the rpm command line tool. For example: ``` % rpm -qp example-1.0-1.x86_64.rpm --qf "%{PAYLOADCOMPRESSOR}\n" gzip ``` ### Impact on known dependent projects This 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. ### References * https://github.com/jordansissel/ruby-arr-pm/pull/14 * https://github.com/jordansissel/ruby-arr-pm/pull/15 ### Credit Thanks to @joernchen for reporting this problem and contributing to the resolution :) ### For more information If you have any questions or comments about this advisory: * Open an issue in [the arr-pm issue tracker](https://github.com/jordansissel/ruby-arr-pm/)

CVE-2022-39224 Affected Arr pm Versions

1 component(s)
Fixed Versions:
0.0.12
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?
CVE-2022-39224 is a security vulnerability in Arr pm involving arr-pm vulnerable to arbitrary shell execution when extracting or listing files contained in a malicious rpm. under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Arr pm versions are affected?
Affected versions include releases prior to 0.0.12 across affected packages: arr-pm.
What version fixes CVE-2022-39224?
Upgrading to 0.0.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is arr-pm affected?
Yes, arr-pm is affected in releases prior to 0.0.12. Upgrade your dependency to 0.0.12 or later.
What is the CVSS score of CVE-2022-39224?
CVE-2022-39224 has a CVSS v3.1 base score of 7.0 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-39224?
CVE-2022-39224 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (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.).
How can I check RubyGems dependencies for CVE-2022-39224?
Run the dependency tree command: 'inspect dependencies for arr-pm'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}