CVE-2020-15904: Buffer Overflow in bsdiff4
Summary
CVE-2020-15904: A buffer overflow in the patching routine of bsdiff4 before 1.2.0 allows an attacker to write to heap memory (beyond allocated bounds) via a crafted patch file. Affects bsdiff4 across 2 version ranges.
< 1.2.0
< 49a4cee2feef7deaf9d89e5e793a8824930284d7
Fixed in 49a4cee2feef7deaf9d89e5e793a8824930284d7. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
bsdiff4 is a Python library that provides binary diff and patch functionality. It is commonly used for creating and applying patches to binary files. The library is available on PyPI and can be installed using pip. The vulnerability identified as CVE-2020-15904 is a buffer overflow in the patching routine of bsdiff4 before version 1.2.0. This vulnerability allows an attacker to write to heap memory beyond the allocated bounds by exploiting a crafted patch file.
Vulnerability Detail
The buffer overflow vulnerability in bsdiff4 arises due to improper bounds checking during the patching process. An attacker can create a specially crafted patch file that triggers the overflow, leading to the ability to write arbitrary data to heap memory. This can result in various consequences, including remote code execution, denial of service, or information disclosure. The vulnerability affects all versions of bsdiff4 prior to 1.2.0.
How To Fix
Minimum fixed version
49a4cee2feef7deaf9d89e5e793a8824930284d7
This is the first release that contains the fix.
pip install --upgrade "bsdiff4==49a4cee2feef7deaf9d89e5e793a8824930284d7"
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 essential to update to the fixed version of the library to mitigate the risk.
Conclusion
The buffer overflow vulnerability in bsdiff4 before version 1.2.0 can be exploited by an attacker through a crafted patch file, allowing them to write to heap memory beyond the allocated bounds. This can have severe consequences, including remote code execution, denial of service, or information disclosure. To mitigate the risk, it is crucial to update the bsdiff4 library to version 1.2.0 or later. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for bsdiff4 →
FAQ
bsdiff4 is a Python library used for creating and applying binary patches to files.
The vulnerability allows an attacker to write to heap memory beyond the allocated bounds, potentially leading to remote code execution, denial of service, or information disclosure.
To fix this vulnerability, update the bsdiff4 library to version 1.2.0 or later using the command 'pip install --upgrade bsdiff4'.
No, there is no known workaround for this vulnerability. Updating to the fixed version is the recommended solution.
You can find more information about this vulnerability in the PyPI advisory database: https://github.com/pypa/advisory-database/blob/main/vulns/bsdiff4/PYSEC-2020-30.yaml