CVE-2022-38495: LIEF vulnerable to heap based buffer overflow via print_binary function
7.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.14267%
CWE
Published
9/14/2022
Updated
1/29/2023
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| lief | pip | >= 0, <= 0.12.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The CVE description and GitHub issue explicitly identify print_binary in macho_reader.c as the vulnerable function. The ASan trace in the issue shows a heap-buffer overflow at line 39 of this function. While the patch commit modifies related parsing logic (e.g., adding size checks in ThreadCommand.cpp and BinaryParser.tcc), the root cause of the overflow occurs in print_binary's handling of data. The function likely iterates over binary data without validating the buffer size, causing the overflow. The commit indirectly mitigates the issue by ensuring valid data is passed to print_binary, but the function itself remains vulnerable if improperly used with unvalidated inputs.