# CVE-2024-31636: LIEF uninitialized variable in machd_reader.c

Source: https://junglewise.ai/threats/cve-2024-31636-lief-uninitialized-variable-in-machd-reader-c  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-05-03. Updated: 2026-06-06  
License: CC BY 4.0 with a link back

CVE-2024-31636 · Severity: low · CVSS 3.9 · Published 2024-05-03

LIEF is a library used by developers and security researchers to analyze and modify executable files. A vulnerability in version 0.14.1 could allow a local attacker to access sensitive information or cause the software to crash when processing specially crafted files. This could lead to minor data exposure or disruption of automated analysis tools.

Technologies: [lief (PyPI)](https://junglewise.ai/threats/technologies/lief). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2024-31636 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-31636 being exploited in the wild.

**How severe is CVE-2024-31636?** Low severity, with a CVSS score of 3.9, published 3 May 2024.

**Which products and versions are affected?** lief (PyPI) < 0.15.0, ECOSYSTEM:introduced=0,fixed=0.15.0, ECOSYSTEM:introduced=0,last_affected=0.14.1.

**Is there a fix for CVE-2024-31636?** Yes. lief (PyPI): upgrade to 0.15.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-31636 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2024-31636?** Check whether you run lief (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- lief (PyPI): upgrade to 0.15.0 or later

  ```sh
  pip install "lief>=0.15.0"
  ```


## Technical details

A Use of Uninitialized Variable (CWE-457) exists in LIEF v0.14.1 within the `machd_reader.c` component. Specifically, the `binary->name` parameter is not properly initialized during the parsing of Mach-O files. A local attacker can exploit this by providing a malformed file, which may cause the program to crash or leak contents of memory (random printing of data) when the uninitialized pointer is accessed. The issue is triggered during the execution of `macho_parse` and subsequent calls to `print_binary`. This vulnerability was addressed in version 0.15.0.

## Affected products

- lief-project LIEF < 0.15.0

## Identifiers

- CVE-2024-31636
- GHSA-377p-g8gr-5wpg
- PYSEC-2024-280

## Timeline

- 2024-03-29: disclosed: Issue reported on GitHub repository
- 2024-05-03: advisory: CVE-2024-31636 published
- 2024-05-03: patched: GitHub Advisory published and version 0.15.0 released

## References

- [https://github.com/lief-project/LIEF/issues/1038](https://github.com/lief-project/LIEF/issues/1038)
- [https://github.com/lief-project/LIEF](https://github.com/lief-project/LIEF)
- [https://github.com/lief-project/LIEF/commit/307e113f8e00b034f0a5f1baa33e54d636c52ea3](https://github.com/lief-project/LIEF/commit/307e113f8e00b034f0a5f1baa33e54d636c52ea3)
- [https://github.com/pypa/advisory-database/tree/main/vulns/lief/PYSEC-2024-280.yaml](https://github.com/pypa/advisory-database/tree/main/vulns/lief/PYSEC-2024-280.yaml)
- [http://lief.com/](http://lief.com/)

## Related threats

- [PYSEC-2026-1538 - LIEF is vulnerable to segmentation fault](https://junglewise.ai/threats/cve-2025-15504-lief-is-vulnerable-to-segmentation-fault)
- [LIEF heap buffer overflow in the LIEF::MachO::BinaryParser::parse_dyldinfo_generic_bind](https://junglewise.ai/threats/cve-2022-43171-lief-heap-buffer-overflow-in-the-lief-macho-binaryparser-parse)
- [LIEF segmentation fault in MachO binary parser](https://junglewise.ai/threats/cve-2022-40922-lief-segmentation-fault-in-macho-binary-parser)
- [LIEF vulnerable to denial of service through segmentation fault](https://junglewise.ai/threats/cve-2022-40923-lief-vulnerable-to-denial-of-service-through-segmentation-fault)
- [LIEF contains segmentation violation](https://junglewise.ai/threats/cve-2022-38307-lief-contains-segmentation-violation)
