CVE-2020-29128: Petl Security Vulnerability Vulnerability
HIGHCVE-2020-29128 is a HIGH (CVSS 9.8) security vulnerability vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Petl libraries in the PyPI ecosystem. The issue involves xxe in petl. Remediation is available by upgrading affected packages to version 1.6.8.
CVE-2020-29128 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2020-29128
To remediate this vulnerability, upgrade all affected Petl dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install petl>=1.6.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show petl
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2020-29128, inspect your installed packages using pip:
pip show petl
Analyze the terminal output to locate any version of Petl in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.8), your application is affected.
Note: The pip show petl command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Petl, 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
CVE-2020-29128 Affected Petl Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
petl
|
PyPI |
< 1.6.8
|
1.6.8
|
References
Frequently Asked Questions
What is CVE-2020-29128?
Which Petl versions are affected?
What version fixes CVE-2020-29128?
Is petl affected?
What is the CVSS score of CVE-2020-29128?
What CWE is associated with CVE-2020-29128?
How can I check PyPI dependencies for CVE-2020-29128?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f5gc-p5m3-v347",
"modified" : "2024-10-09T20:55:04Z",
"published" : "2020-12-02T18:28:30Z",
"aliases" : [ "CVE-2020-29128" ],
"summary" : "XXE in petl",
"details" : "### Impact\nInformation Disclosure\n\n### Summary\n\n[petl](https://github.com/petl-developers/petl) is a Python library that provides functions for extraction, transformation, and loading (ETL) of data.\n\npetl before 1.68, in some configurations, allows resolution of entities in XML input.\n\nAn attacker who is able to submit XML input to an application using petl can disclose arbitrary files on the file system in the context of the user under which the application is running.\n\n### Affected Applications\n\nApplications that:\n\n- accept attacker-supplied XML input that is processed using petl < 1.68\n- return the response generated by petl back to the attacker\n- configure lxml as the underlying XML processing library used by petl\n- have read privileges in filesystem files with sensitive information\n\n### Mitigation\nUpdate to petl >= 1.68\n\n### Workarounds\n\n- Assure there is no user/external access to the application using [petl](https://github.com/petl-developers/petl)\n- Assure your application is not using the function [fromxml()](https://petl.readthedocs.io/en/stable/io.html#petl.io.xml.fromxml)\n\n### References\n- https://github.com/nvn1729/advisories/blob/master/cve-2020-29128.md\n- https://github.com/petl-developers/petl/pull/527\n- https://github.com/petl-developers/petl/releases/tag/v1.6.8\n- https://petl.readthedocs.io/en/stable/changes.html\n- https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Add a comment in the Github [issue](https://github.com/petl-developers/petl/pull/527)\n\nThaks to Naveen Sunkavally.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "petl"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.6.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/petl-developers/petl/security/advisories/GHSA-f5gc-p5m3-v347"
}, {
"type" : "WEB",
"url" : "https://github.com/petl-developers/petl/issues/526"
}, {
"type" : "WEB",
"url" : "https://github.com/petl-developers/petl/pull/527"
}, {
"type" : "WEB",
"url" : "https://github.com/petl-developers/petl/commit/07420ef8463cc387aea84e2d6241cf556574e2a5"
}, {
"type" : "WEB",
"url" : "https://github.com/nvn1729/advisories/blob/master/cve-2020-29128.md"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/petl-developers/petl"
}, {
"type" : "WEB",
"url" : "https://github.com/petl-developers/petl/compare/v1.6.7...v1.6.8"
}, {
"type" : "WEB",
"url" : "https://github.com/petl-developers/petl/releases/tag/v1.6.8"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/petl/PYSEC-2020-75.yaml"
}, {
"type" : "WEB",
"url" : "https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing"
}, {
"type" : "WEB",
"url" : "https://petl.readthedocs.io/en/stable/changes.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-611" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-12-02T02:29:45Z",
"nvd_published_at" : null
}
}