CVE-2022-40922: Lief Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-38hf-c37x-32hv
CVSS 6.5
Published
Advisory Summary

CVE-2022-40922 is a HIGH (CVSS 6.5) denial of service vulnerability (General Security Weakness) affecting Lief libraries in the PyPI ecosystem. The issue involves lief vulnerable to denial of service through segmentation fault. Remediation is available by upgrading affected packages to version 0.12.2.

CVE-2022-40922 at a Glance

CVE Identifier CVE-2022-40922
GHSA Identifier GHSA-38hf-c37x-32hv
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification General Security Weakness
Affected Product Lief
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:R/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2022-40922

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

lief fixed: 0.12.2
pip install lief>=0.12.2
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 lief

How to Check if You Are Affected

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

pip show lief

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Lief, 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

A vulnerability in the LIEF::MachO::BinaryParser::init_and_parse function of LIEF v0.12.1 allows attackers to cause a denial of service (DOS) through a segmentation fault via a crafted MachO file. A [patch](https://github.com/lief-project/LIEF/commit/fde2c48986739fabd2cf9b40b9af149a89c57850) for this issue is available at commit fde2c48986739fabd2cf9b40b9af149a89c57850.

CVE-2022-40922 Affected Lief Versions

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

References

Frequently Asked Questions

What is CVE-2022-40922?
CVE-2022-40922 is a security vulnerability in Lief involving LIEF vulnerable to denial of service through segmentation fault under General Security Weakness.
Which Lief versions are affected?
Affected versions include releases prior to 0.12.2 across affected packages: lief.
What version fixes CVE-2022-40922?
Upgrading to 0.12.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lief affected?
Yes, lief is affected in releases prior to 0.12.2. Upgrade your dependency to 0.12.2 or later.
What is the CVSS score of CVE-2022-40922?
CVE-2022-40922 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-40922?
CVE-2022-40922 is classified under General Security Weakness.
How can I check PyPI dependencies for CVE-2022-40922?
Run the dependency tree command: 'pip show lief'. 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-38hf-c37x-32hv",
  "modified" : "2024-11-26T18:47:28Z",
  "published" : "2022-10-04T00:00:25Z",
  "aliases" : [ "CVE-2022-40922" ],
  "summary" : "LIEF vulnerable to denial of service through segmentation fault",
  "details" : "A vulnerability in the LIEF::MachO::BinaryParser::init_and_parse function of LIEF v0.12.1 allows attackers to cause a denial of service (DOS) through a segmentation fault via a crafted MachO file. A [patch](https://github.com/lief-project/LIEF/commit/fde2c48986739fabd2cf9b40b9af149a89c57850) for this issue is available at commit fde2c48986739fabd2cf9b40b9af149a89c57850.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "lief"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.12.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.12.1"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-40922"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lief-project/LIEF/issues/781"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lief-project/LIEF/commit/ad811916670e83947560b6f3c45df6e71d3885af"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lief-project/LIEF/commit/fde2c48986739fabd2cf9b40b9af149a89c57850"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lief-project/LIEF"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/lief/PYSEC-2022-43138.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-10-06T20:00:30Z",
    "nvd_published_at" : "2022-10-03T13:15:00Z"
  }
}