CVE-2022-38307
Description
LIEF commit 5d1d643 was discovered to contain a segmentation violation via the function LIEF::MachO::SegmentCommand::file_offset() at /MachO/SegmentCommand.cpp.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
LIEF commit 5d1d643 contains a segmentation violation in SegmentCommand::file_offset() when parsing a crafted Mach-O file.
Vulnerability
Description
A segmentation violation exists in LIEF commit 5d1d643 within the LIEF::MachO::SegmentCommand::file_offset() function at /MachO/SegmentCommand.cpp. This is a null pointer dereference triggered when the function attempts to read from an offset in a segment that has not been properly initialized [1][2].
How
It's Exploited
The vulnerability is exploitable by providing a specially crafted Mach-O binary that, when parsed by LIEF, causes the segment_from_offset function to be called without prior population of the internal offset_seg_ map. The lack of sanity check leads to a read from address 0x000000000068, as shown by AddressSanitizer output [2]. The crash occurs during the parsing of dynamic linking information (dyldinfo_generic_bind) when the malformed binary is processed [2].
Impact
An attacker can cause a denial of service (DoS) by crashing any application or service that uses LIEF to parse untrusted Mach-O files. The issue is classified as a segmentation violation with no additional exploitation paths described in the available references [1][2].
Mitigation
The vulnerability has been addressed in LIEF commit 7acf0bc, which adds a check for an empty offset_seg_ map before performing offset lookups, returning nullptr instead of proceeding to a faulting state [4]. Users should update to a version of LIEF that includes this fix.
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.1 | 0.12.1 |
Affected products
2- LIEF/LIEFdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-x2xx-jw5m-5j86ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-38307ghsaADVISORY
- github.com/lief-project/LIEF/commit/7acf0bc4224081d4f425fcc8b2e361b95291d878ghsaWEB
- github.com/lief-project/LIEF/issues/764ghsax_refsource_MISCWEB
- github.com/pypa/advisory-database/tree/main/vulns/lief/PYSEC-2022-275.yamlghsaWEB
News mentions
0No linked articles in our index yet.