CVE-2020-15239: Xmpp http upload Path Traversal Vulnerability
LOWCVE-2020-15239 is a LOW (CVSS 3.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Xmpp http upload libraries in the PyPI ecosystem. The issue involves directory traversal vulnerability in get/put allows attackers to disclose information or write files via a crafted get/put request. Remediation is available by upgrading affected packages to version 0.4.0.
CVE-2020-15239 at a Glance
Security Impact
CVSS: 3.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N).
How to Fix CVE-2020-15239
To remediate this vulnerability, upgrade all affected Xmpp http upload 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 xmpp-http-upload>=0.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show xmpp-http-upload
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2020-15239, inspect your installed packages using pip:
pip show xmpp-http-upload
Analyze the terminal output to locate any version of Xmpp http upload in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.0), your application is affected.
Note: The pip show xmpp-http-upload command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Xmpp http upload, 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-15239 Affected Xmpp http upload Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
xmpp-http-upload
|
PyPI |
< 0.4.0
|
0.4.0
|
References
Frequently Asked Questions
What is CVE-2020-15239?
Which Xmpp http upload versions are affected?
What version fixes CVE-2020-15239?
Is xmpp-http-upload affected?
What is the CVSS score of CVE-2020-15239?
What CWE is associated with CVE-2020-15239?
How can I check PyPI dependencies for CVE-2020-15239?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hwv5-w8gm-fq9f",
"modified" : "2024-11-19T18:08:50Z",
"published" : "2020-10-06T18:21:02Z",
"aliases" : [ "CVE-2020-15239" ],
"summary" : "Directory Traversal vulnerability in GET/PUT allows attackers to Disclose Information or Write Files via a crafted GET/PUT request",
"details" : "### Impact\n\n#### Information Disclosure\n\nWhen the GET method is attacked, attackers can read files which have a `.data` suffix and which are accompanied by a JSON file with the `.meta` suffix. This can lead to Information Disclosure and in some shared-hosting scenarios also to circumvention of authentication or other limitations on the outbound (GET) traffic.\n\nFor example, in a scenario where a single server has multiple instances of the application running (with separate DATA_ROOT settings), an attacker who has knowledge about the directory structure is able to read files from any other instance to which the process has read access.\n\nIf instances have individual authentication (for example, HTTP authentication via a reverse proxy, source IP based filtering) or other restrictions (such as quotas), attackers may circumvent those limits in such a scenario by using the Directory Traversal to retrieve data from the other instances.\n\n#### File Write\n\nIf the associated XMPP server (or anyone knowing the SECRET_KEY) is malicious, they can write files outside the DATA_ROOT. The files which are written are constrained to have the `.meta` and the `.data` suffixes; the `.meta` file will contain the JSON with the Content-Type of the original request and the `.data` file will contain the payload.\n\n### Patches\n\nPR #12 fixes the issue. The PR has been merged into version 0.4.0 and 0.4.0 has been released and pushed to PyPI. Users are advised to upgrade immediately.\n\n### Workarounds\n\n- Apache can apparently be configured to filter such malicious paths when reverse-proxying. \n- There are no other workarounds known.\n\n### References\n\n- [Pull Request #12](https://github.com/horazont/xmpp-http-upload/pull/12)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "xmpp-http-upload"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/horazont/xmpp-http-upload/security/advisories/GHSA-hwv5-w8gm-fq9f"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15239"
}, {
"type" : "WEB",
"url" : "https://github.com/horazont/xmpp-http-upload/pull/12"
}, {
"type" : "WEB",
"url" : "https://github.com/horazont/xmpp-http-upload/commit/82056540191e89f0cd697c81f57714c00962ed75"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/horazont/xmpp-http-upload"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/xmpp-http-upload/PYSEC-2020-158.yaml"
}, {
"type" : "WEB",
"url" : "https://pypi.org/project/xmpp-http-upload/#history"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2020-10-06T18:20:50Z",
"nvd_published_at" : null
}
}