Vulnerabilities in pkg:pypi/patchelf

PACKAGE
Advisory Identifier: GHSA-5pcj-3m26-w633
Advisory Summary

CVE-2022-44940 is a HIGH (CVSS 9.1) patchelf out-of-bounds read vulnerability (CWE-125: Out-of-bounds Read) affecting Patchelf libraries in the PyPI ecosystem. The issue involves patchelf out-of-bounds read. Remediation is available by upgrading affected packages to version 0.16.1.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/patchelf

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/patchelf. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5pcj-3m26-w633 CVE-2022-44940 HIGH Patchelf out-of-bounds read

CVE-2022-44940 at a Glance

CVE Identifier CVE-2022-44940
GHSA Identifier GHSA-5pcj-3m26-w633
Severity HIGH
CVSS v3.1 Base Score 9.1
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Patchelf
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.1

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:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2022-44940

To remediate this vulnerability, upgrade all affected Patchelf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

patchelf fixed: 0.16.1.0
pip install patchelf>=0.16.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show patchelf

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2022-44940, inspect your installed packages using pip:

pip show patchelf

Analyze the terminal output to locate any version of Patchelf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.16.1.0), your application is affected.

Note: The pip show patchelf command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Patchelf, 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

Patchelf v0.9 was discovered to contain an out-of-bounds read via the function modifyRPath at src/patchelf.cc.

CVE-2022-44940 Affected Patchelf Versions

1 component(s)
Fixed Versions:
0.16.1.0
Product / Package Ecosystem Affected Versions Fixed Version
patchelf
PyPI
< 0.16.1.0
0.16.1.0

References

Frequently Asked Questions

What is CVE-2022-44940?
CVE-2022-44940 is a security vulnerability in Patchelf involving Patchelf out-of-bounds read under CWE-125: Out-of-bounds Read.
Which Patchelf versions are affected?
Affected versions include releases prior to 0.16.1.0 across affected packages: patchelf.
What version fixes CVE-2022-44940?
Upgrading to 0.16.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is patchelf affected?
Yes, patchelf is affected in releases prior to 0.16.1.0. Upgrade your dependency to 0.16.1.0 or later.
What is the CVSS score of CVE-2022-44940?
CVE-2022-44940 has a CVSS v3.1 base score of 9.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H.
What CWE is associated with CVE-2022-44940?
CVE-2022-44940 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check PyPI dependencies for CVE-2022-44940?
Run the dependency tree command: 'pip show patchelf'. 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-5pcj-3m26-w633",
  "modified" : "2025-04-17T16:45:14Z",
  "published" : "2022-12-20T00:30:29Z",
  "aliases" : [ "CVE-2022-44940" ],
  "summary" : "Patchelf out-of-bounds read",
  "details" : "Patchelf v0.9 was discovered to contain an out-of-bounds read via the function modifyRPath at src/patchelf.cc.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "patchelf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.16.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-44940"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NixOS/patchelf/pull/419"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/patchelf/PYSEC-2022-43144.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pypatchelf/PYSEC-2022-43151.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-22T20:26:19Z",
    "nvd_published_at" : "2022-12-19T22:15:00Z"
  }
}