CVE-2019-15795: Python apt Python-apt Flawed Package Integrity Check Vulnerability

MODERATE
Advisory Identifier: GHSA-rp8m-h266-53jh
CVSS 4.7
CWE-327
Published
Advisory Summary

CVE-2019-15795 is a MODERATE (CVSS 4.7) python-apt flawed package integrity check vulnerability (CWE-327: Use of a Broken or Risky Cryptographic Algorithm) affecting Python apt libraries in the PyPI ecosystem. The issue involves python-apt flawed package integrity check. Remediation is available by upgrading affected packages to version 0.8.3ubuntu7.5, 0.9.3.5ubuntu3, 1.1.0, 1.6.5ubuntu0.1, 1.9.0ubuntu1.2.

CVE-2019-15795 at a Glance

CVE Identifier CVE-2019-15795
GHSA Identifier GHSA-rp8m-h266-53jh
Severity MODERATE
CVSS v3.1 Base Score 4.7
CWE Classification CWE-327: Use of a Broken or Risky Cryptographic Algorithm
Affected Product Python apt
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.7

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

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

How to Fix CVE-2019-15795

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

python-apt fixed: 0.8.3ubuntu7.5
pip install python-apt>=0.8.3ubuntu7.5
python-apt fixed: 0.9.3.5ubuntu3
pip install python-apt>=0.9.3.5ubuntu3
python-apt fixed: 1.1.0
pip install python-apt>=1.1.0
python-apt fixed: 1.6.5ubuntu0.1
pip install python-apt>=1.6.5ubuntu0.1
python-apt fixed: 1.9.0ubuntu1.2
pip install python-apt>=1.9.0ubuntu1.2
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 python-apt

How to Check if You Are Affected

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

pip show python-apt

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm, where the product uses a broken or risky cryptographic algorithm or protocol. In Python apt, 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

python-apt only checks the MD5 sums of downloaded files in `Version.fetch_binary()` and `Version.fetch_source()` of apt/package.py in version 1.9.0ubuntu1 and earlier. This allows a man-in-the-middle attack which could potentially be used to install altered packages and has been fixed in versions 1.9.0ubuntu1.2, 1.6.5ubuntu0.1, 1.1.0~beta1ubuntu0.16.04.7, 0.9.3.5ubuntu3+esm2, and 0.8.3ubuntu7.5.

CVE-2019-15795 Affected Python apt Versions

5 component(s)
Fixed Versions:
0.8.3ubuntu7.50.9.3.5ubuntu31.1.01.6.5ubuntu0.11.9.0ubuntu1.2
Product / Package Ecosystem Affected Versions Fixed Version
python-apt
PyPI
< 0.8.3ubuntu7.5
0.8.3ubuntu7.5
python-apt
PyPI
≥ 0.9.0
< 0.9.3.5ubuntu3
0.9.3.5ubuntu3
python-apt
PyPI
≥ 1.0.0
< 1.1.0
1.1.0
python-apt
PyPI
≥ 1.2.0
< 1.6.5ubuntu0.1
1.6.5ubuntu0.1
python-apt
PyPI
≥ 1.7.0
< 1.9.0ubuntu1.2
1.9.0ubuntu1.2

References

Frequently Asked Questions

What is CVE-2019-15795?
CVE-2019-15795 is a security vulnerability in Python apt involving python-apt Flawed Package Integrity Check under CWE-327: Use of a Broken or Risky Cryptographic Algorithm.
Which Python apt versions are affected?
Affected versions include releases prior to 0.8.3ubuntu7.5, 0.9.3.5ubuntu3, 1.1.0, 1.6.5ubuntu0.1, 1.9.0ubuntu1.2 across affected packages: python-apt.
What version fixes CVE-2019-15795?
Upgrading to 0.8.3ubuntu7.5, 0.9.3.5ubuntu3, 1.1.0, 1.6.5ubuntu0.1, 1.9.0ubuntu1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is python-apt affected?
Yes, python-apt is affected in releases prior to 0.8.3ubuntu7.5, 0.9.3.5ubuntu3, 1.1.0, 1.6.5ubuntu0.1, 1.9.0ubuntu1.2. Upgrade your dependency to 0.8.3ubuntu7.5, 0.9.3.5ubuntu3, 1.1.0, 1.6.5ubuntu0.1, 1.9.0ubuntu1.2 or later.
What is the CVSS score of CVE-2019-15795?
CVE-2019-15795 has a CVSS v3.1 base score of 4.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2019-15795?
CVE-2019-15795 is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm (The product uses a broken or risky cryptographic algorithm or protocol.).
How can I check PyPI dependencies for CVE-2019-15795?
Run the dependency tree command: 'pip show python-apt'. 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-rp8m-h266-53jh",
  "modified" : "2023-09-26T20:44:28Z",
  "published" : "2022-05-24T17:12:47Z",
  "aliases" : [ "CVE-2019-15795" ],
  "summary" : "python-apt Flawed Package Integrity Check",
  "details" : "python-apt only checks the MD5 sums of downloaded files in `Version.fetch_binary()` and `Version.fetch_source()` of apt/package.py in version 1.9.0ubuntu1 and earlier. This allows a man-in-the-middle attack which could potentially be used to install altered packages and has been fixed in versions 1.9.0ubuntu1.2, 1.6.5ubuntu0.1, 1.1.0~beta1ubuntu0.16.04.7, 0.9.3.5ubuntu3+esm2, and 0.8.3ubuntu7.5.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "python-apt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.3ubuntu7.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "python-apt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.0"
      }, {
        "fixed" : "0.9.3.5ubuntu3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "python-apt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.1.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "python-apt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "fixed" : "1.6.5ubuntu0.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "python-apt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7.0"
      }, {
        "fixed" : "1.9.0ubuntu1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-15795"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/excid3/python-apt"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4247-1"
  }, {
    "type" : "WEB",
    "url" : "https://usn.ubuntu.com/4247-3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-327" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-18T22:34:38Z",
    "nvd_published_at" : "2020-03-26T13:15:00Z"
  }
}