Vulnerabilities in pkg:pypi/parso

PACKAGE
Advisory Identifier: GHSA-22mf-97vh-x8rw
Advisory Summary

CVE-2019-12760 is a HIGH (CVSS 7.5) deserialization vulnerability exists vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Parso libraries in the PyPI ecosystem. The issue involves deserialization vulnerability exists in parso. Remediation is available in the latest vendor maintenance releases.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/parso

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-22mf-97vh-x8rw CVE-2019-12760 HIGH Deserialization vulnerability exists in parso

CVE-2019-12760 at a Glance

CVE Identifier CVE-2019-12760
GHSA Identifier GHSA-22mf-97vh-x8rw
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Parso
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2019-12760

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

parso fixed: Latest secure release
pip install parso>=Latest secure release
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 parso

How to Check if You Are Affected

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

pip show parso

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Parso, 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

** DISPUTED ** A deserialization vulnerability exists in the way parso through 0.4.0 handles grammar parsing from the cache. Cache loading relies on pickle and, provided that an evil pickle can be written to a cache grammar file and that its parsing can be triggered, this flaw leads to Arbitrary Code Execution. NOTE: This is disputed because "the cache directory is not under control of the attacker in any common configuration."

CVE-2019-12760 Affected Parso Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
parso
PyPI
≤ 0.4.0

References

Frequently Asked Questions

What is CVE-2019-12760?
CVE-2019-12760 is a security vulnerability in Parso involving Deserialization vulnerability exists in parso under CWE-502: Deserialization of Untrusted Data.
Which Parso versions are affected?
Affected versions include releases prior to current release patches across affected packages: parso.
What version fixes CVE-2019-12760?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is parso affected?
Yes, parso is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2019-12760?
CVE-2019-12760 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2019-12760?
CVE-2019-12760 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for CVE-2019-12760?
Run the dependency tree command: 'pip show parso'. 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-22mf-97vh-x8rw",
  "modified" : "2024-10-09T20:52:02Z",
  "published" : "2019-06-13T16:12:57Z",
  "withdrawn" : "2019-07-03T16:48:55Z",
  "aliases" : [ "CVE-2019-12760" ],
  "summary" : "Deserialization vulnerability exists in parso",
  "details" : "** DISPUTED ** A deserialization vulnerability exists in the way parso through 0.4.0 handles grammar parsing from the cache. Cache loading relies on pickle and, provided that an evil pickle can be written to a cache grammar file and that its parsing can be triggered, this flaw leads to Arbitrary Code Execution.  NOTE: This is disputed because \"the cache directory is not under control of the attacker in any common configuration.\"",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "parso"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.4.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-12760"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/davidhalter/parso/issues/75"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/dhondta/f71ae7e5c4234f8edfd2f12503a5dcc7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-22mf-97vh-x8rw"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/davidhalter/parso"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/parso/PYSEC-2019-109.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-13T15:48:35Z",
    "nvd_published_at" : "2019-06-06T19:29:00Z"
  }
}