Vulnerabilities in pkg:pypi/bsdiff4

PACKAGE
Advisory Identifier: GHSA-f8m3-jpxr-hm5x
Advisory Summary

CVE-2020-15904 is a HIGH (CVSS 7.8) bsdiff4 out-of-bounds write vulnerability (CWE-787: Out-of-bounds Write) affecting Bsdiff4 libraries in the PyPI ecosystem. The issue involves bsdiff4 out-of-bounds write via patch file. Remediation is available by upgrading affected packages to version 1.2.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/bsdiff4

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/bsdiff4. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-f8m3-jpxr-hm5x CVE-2020-15904 HIGH bsdiff4 out-of-bounds write via patch file

CVE-2020-15904 at a Glance

CVE Identifier CVE-2020-15904
GHSA Identifier GHSA-f8m3-jpxr-hm5x
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Bsdiff4
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2020-15904

To remediate this vulnerability, upgrade all affected Bsdiff4 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

bsdiff4 fixed: 1.2.0
pip install bsdiff4>=1.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show bsdiff4

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2020-15904, inspect your installed packages using pip:

pip show bsdiff4

Analyze the terminal output to locate any version of Bsdiff4 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.0), your application is affected.

Note: The pip show bsdiff4 command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In Bsdiff4, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2020-15904 Affected Bsdiff4 Versions

1 component(s)
Fixed Versions:
1.2.0
Product / Package Ecosystem Affected Versions Fixed Version
bsdiff4
PyPI
< 1.2.0
1.2.0

References

Frequently Asked Questions

What is CVE-2020-15904?
CVE-2020-15904 is a security vulnerability in Bsdiff4 involving bsdiff4 out-of-bounds write via patch file under CWE-787: Out-of-bounds Write.
Which Bsdiff4 versions are affected?
Affected versions include releases prior to 1.2.0 across affected packages: bsdiff4.
What version fixes CVE-2020-15904?
Upgrading to 1.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bsdiff4 affected?
Yes, bsdiff4 is affected in releases prior to 1.2.0. Upgrade your dependency to 1.2.0 or later.
What is the CVSS score of CVE-2020-15904?
CVE-2020-15904 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-15904?
CVE-2020-15904 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check PyPI dependencies for CVE-2020-15904?
Run the dependency tree command: 'pip show bsdiff4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f8m3-jpxr-hm5x",
  "modified" : "2024-09-06T15:56:54Z",
  "published" : "2022-05-24T17:24:16Z",
  "aliases" : [ "CVE-2020-15904" ],
  "summary" : "bsdiff4 out-of-bounds write via patch file",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "bsdiff4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15904"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ilanschnell/bsdiff4/commit/49a4cee2feef7deaf9d89e5e793a8824930284d7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ilanschnell/bsdiff4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ilanschnell/bsdiff4/blob/9a84c2ee01f5ba0742d18c9f3b3d5244ae7fb302/CHANGELOG.txt#L30-L31"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ilanschnell/bsdiff4/blob/master/CHANGELOG.txt"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/bsdiff4/PYSEC-2020-30.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-23T20:37:09Z",
    "nvd_published_at" : "2020-07-22T23:15:00Z"
  }
}