CVE-2022-40922
Description
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A crafted Mach-O file causes a segmentation fault in LIEF's MachO::BinaryParser::init_and_parse function, enabling denial of service.
Vulnerability
Description CVE-2022-40922 is a denial-of-service (DoS) vulnerability in LIEF v0.12.1, a library for parsing and manipulating executable formats. The flaw resides in the LIEF::MachO::BinaryParser::init_and_parse function, triggered when processing a specially crafted Mach-O binary. The root cause is improper validation of Mach-O structures, leading to a write to an invalid memory address (the zero page) as indicated by AddressSanitizer output [2].
Attack
Vector and Exploitation An attacker can exploit this vulnerability by providing a malicious Mach-O file to a LIEF-based application that parses Mach-O binaries. The issue requires no authentication or special privileges; the victim only needs to invoke LIEF::MachO::Parser::parse() on the crafted file [2]. The segmentation fault occurs during parsing when access to corrupted or malformed load commands and string indices causes a null-pointer dereference [2].
Impact
The vulnerability results in a crash (segmentation fault), leading to a denial of service for the consuming application. LIEF is used in security tools, binary analysis, and reverse engineering pipelines, so a successful DoS can interrupt automated processing of untrusted files [1].
Mitigation
Status The issue was reported via the LIEF issue tracker in 2022 [2]. LIEF maintainers have addressed the bug in subsequent releases—users should upgrade to a patched version (e.g., 0.13.0 or later). Users unable to upgrade should exercise caution when parsing Mach-O files from untrusted sources and consider using a sandboxed environment.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
liefPyPI | < 0.12.2 | 0.12.2 |
Affected products
2- LIEF/LIEFdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
6- github.com/advisories/GHSA-38hf-c37x-32hvghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-40922ghsaADVISORY
- github.com/lief-project/LIEF/commit/ad811916670e83947560b6f3c45df6e71d3885afghsaWEB
- github.com/lief-project/LIEF/commit/fde2c48986739fabd2cf9b40b9af149a89c57850ghsaWEB
- github.com/lief-project/LIEF/issues/781ghsax_refsource_MISCWEB
- github.com/pypa/advisory-database/tree/main/vulns/lief/PYSEC-2022-43138.yamlghsaWEB
News mentions
0No linked articles in our index yet.