Miggo Logo

CVE-2022-38495: LIEF vulnerable to heap based buffer overflow via print_binary function

7.8

CVSS Score
3.1

Basic Information

EPSS Score
0.14267%
Published
9/14/2022
Updated
1/29/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
liefpip>= 0, <= 0.12.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

LI** *ommit ******* w*s *is*ov*r** to *ont*in * ***p-*u***r ov*r*low vi* t** *un*tion `print_*in*ry` *t `/*/m***o_r****r.*`. *ommit **************************************** *ont*ins * p*t**.

Reasoning

T** *V* **s*ription *n* *it*u* issu* *xpli*itly i**nti*y print_*in*ry in m***o_r****r.* *s t** vuln*r**l* *un*tion. T** *S*n tr*** in t** issu* s*ows * ***p-*u***r ov*r*low *t lin* ** o* t*is *un*tion. W*il* t** p*t** *ommit mo*i*i*s r*l*t** p*rsin*