CVE-2024-25711: Diffoscope Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-33w6-hvmq-gh4x
Published
Advisory Summary

CVE-2024-25711 is a MODERATE path traversal vulnerability (General Security Weakness) affecting Diffoscope libraries in the PyPI ecosystem. The issue involves diffoscope path traversal vulnerability. Remediation is available by upgrading affected packages to version 256.

CVE-2024-25711 at a Glance

CVE Identifier CVE-2024-25711
GHSA Identifier GHSA-33w6-hvmq-gh4x
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Diffoscope
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2024-25711

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

diffoscope fixed: 256
pip install diffoscope>=256
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 diffoscope

How to Check if You Are Affected

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

pip show diffoscope

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Diffoscope, 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

diffoscope before 256 allows directory traversal via an embedded filename in a GPG file. Contents of any file, such as ../.ssh/id_rsa, may be disclosed to an attacker. This occurs because the value of the gpg --use-embedded-filenames option is trusted.

CVE-2024-25711 Affected Diffoscope Versions

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

References

Frequently Asked Questions

What is CVE-2024-25711?
CVE-2024-25711 is a security vulnerability in Diffoscope involving diffoscope Path Traversal vulnerability under General Security Weakness.
Which Diffoscope versions are affected?
Affected versions include releases prior to 256 across affected packages: diffoscope.
What version fixes CVE-2024-25711?
Upgrading to 256 (or the latest patched release for your respective branch) resolves the vulnerability.
Is diffoscope affected?
Yes, diffoscope is affected in releases prior to 256. Upgrade your dependency to 256 or later.
What CWE is associated with CVE-2024-25711?
CVE-2024-25711 is classified under General Security Weakness.
How can I check PyPI dependencies for CVE-2024-25711?
Run the dependency tree command: 'pip show diffoscope'. 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-33w6-hvmq-gh4x",
  "modified" : "2024-02-27T21:48:54Z",
  "published" : "2024-02-27T03:31:03Z",
  "aliases" : [ "CVE-2024-25711" ],
  "summary" : "diffoscope Path Traversal vulnerability",
  "details" : "diffoscope before 256 allows directory traversal via an embedded filename in a GPG file. Contents of any file, such as ../.ssh/id_rsa, may be disclosed to an attacker. This occurs because the value of the gpg --use-embedded-filenames option is trusted.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "diffoscope"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "256"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-25711"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/diffoscope/PYSEC-2024-41.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OUNBANAWD6TZH2NRRV4YUIAXEHLUJQ47"
  }, {
    "type" : "WEB",
    "url" : "https://salsa.debian.org/reproducible-builds/diffoscope"
  }, {
    "type" : "WEB",
    "url" : "https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/dfed769904c27d66a14a5903823d9c8c5aae860e"
  }, {
    "type" : "WEB",
    "url" : "https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/361"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-27T21:48:54Z",
    "nvd_published_at" : "2024-02-27T02:15:06Z"
  }
}