CVE-2021-32297: Heap Buffer Overflow in LIEF

lief Updated 02 Oct 2025

Summary

20/09/2021
Yes i
High
8.8

CVE-2021-32297: An issue was discovered in LIEF through 0.11.4. Affects lief versions < 0.11.5. Fixed in 0.11.5. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

LIEF is a Python library that allows easy manipulation of binary formats, such as PE, ELF, Mach-O, and others. It provides a high-level interface to analyze, modify, and generate executable files. LIEF is widely used in various security-related applications and research. However, a vulnerability has been discovered in LIEF versions up to 0.11.4.

Vulnerability Detail

The vulnerability, identified as CVE-2021-32297, is a heap buffer overflow that exists in the 'main' function located in 'pe_reader.c'. This flaw can be exploited by an attacker to execute arbitrary code. The heap buffer overflow occurs due to improper input validation, allowing an attacker to overwrite adjacent memory locations and potentially gain control over the affected system. This vulnerability poses a significant risk as it can lead to remote code execution and compromise the integrity and confidentiality of the system.

How To Fix

Minimum fixed version

0.11.5

This is the first release that contains the fix.

pip install --upgrade "lief==0.11.5"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is crucial to update to the fixed version as soon as possible to mitigate the risk of exploitation.

Conclusion

The heap buffer overflow vulnerability in LIEF can lead to remote code execution and compromise of the affected system. It is crucial to update to LIEF version 0.11.5 or later to mitigate this risk. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for lief →

Share this vulnerability

FAQ

LIEF is a Python library used for binary format manipulation, analysis, and generation.

This vulnerability allows an attacker to execute arbitrary code, potentially leading to remote code execution and compromise of the affected system.

To fix this vulnerability, upgrade to LIEF version 0.11.5 or later using the command 'pip install --upgrade lief'.

Yes, all versions up to 0.11.4 are affected. It is recommended to update to the fixed version.

No, there is no known workaround for this vulnerability. Updating to the fixed version is the only solution.

Related vulnerabilities

Recent vulnerabilities recorded for lief.

How To Fix

Minimum fixed version

0.11.5

This is the first release that contains the fix.

pip install --upgrade "lief==0.11.5"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback