CVE-2020-15904: bsdiff4 out-of-bounds write via patch file

bsdiff4 Updated 02 Oct 2025

Summary

24/05/2022
Yes i
High
7.8

CVE-2020-15904: bsdiff4 out-of-bounds write via patch file. Affects bsdiff4 versions < 1.2.0. Fixed in 1.2.0. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 allows users to efficiently update large files by only transmitting the differences between versions. However, a vulnerability has been discovered in bsdiff4 versions prior to 1.2.0 that can be exploited by an attacker to write to heap memory beyond the allocated bounds. This vulnerability exists in the patching routine of bsdiff4 and can be triggered by a specially crafted patch file.

Vulnerability Detail

The vulnerability in bsdiff4 allows an attacker to perform an out-of-bounds write, which means they can write data to memory locations beyond what is intended. By exploiting this vulnerability, an attacker can potentially overwrite critical data in the heap, leading to a variety of consequences such as crashing the application, executing arbitrary code, or escalating privileges. The vulnerability has a CVSS score of 7.8, indicating a high severity level.

How To Fix

Latest published version: 1.3.1 as of 23 Oct 2026

pip install --upgrade "bsdiff4==1.3.1"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.2.0

This is the first release that contains the fix.

pip install --upgrade "bsdiff4==1.2.0"

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 recommended to update to the latest version of bsdiff4 as soon as possible.

Conclusion

The bsdiff4 library is vulnerable to an out-of-bounds write vulnerability that can be exploited by providing a specially crafted patch file. To mitigate this vulnerability, it is recommended to update to bsdiff4 version 1.2.0 or later. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for bsdiff4 →

Share this vulnerability

FAQ

bsdiff4 is a Python library that provides binary diff and patch functionality. It is commonly used for creating and applying patches to binary files.

An out-of-bounds write vulnerability allows an attacker to write data to memory locations beyond what is intended. This can lead to various consequences, such as crashing the application, executing arbitrary code, or escalating privileges.

The bsdiff4 vulnerability can be exploited by providing a specially crafted patch file that triggers the out-of-bounds write in the patching routine of the library.

The potential consequences of this vulnerability include crashing the application, executing arbitrary code, or escalating privileges.

The CVSS score of this vulnerability is 7.8, indicating a high severity level.

How To Fix

Latest published version: 1.3.1 as of 23 Oct 2026

pip install --upgrade "bsdiff4==1.3.1"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.2.0

This is the first release that contains the fix.

pip install --upgrade "bsdiff4==1.2.0"

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