Vulnerabilities in pkg:pypi/xmpp-http-upload

PACKAGE
Advisory Identifier: GHSA-hwv5-w8gm-fq9f
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/xmpp-http-upload

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/xmpp-http-upload. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hwv5-w8gm-fq9f CVE-2020-15239 LOW Directory Traversal vulnerability in GET/PUT allows attackers to Disclose Information or Write Files via a crafted GET/PUT request

CVE-2020-15239 at a Glance

CVE Identifier CVE-2020-15239
GHSA Identifier GHSA-hwv5-w8gm-fq9f
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Xmpp http upload
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (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.

xmpp-http-upload fixed: 0.4.0
pip install xmpp-http-upload>=0.4.0
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 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

### Impact #### Information Disclosure When 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. For 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. If 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. #### File Write If 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. ### Patches PR #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. ### Workarounds - Apache can apparently be configured to filter such malicious paths when reverse-proxying. - There are no other workarounds known. ### References - [Pull Request #12](https://github.com/horazont/xmpp-http-upload/pull/12)

CVE-2020-15239 Affected Xmpp http upload Versions

1 component(s)
Fixed Versions:
0.4.0
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?
CVE-2020-15239 is a security vulnerability in Xmpp http upload involving Directory Traversal vulnerability in GET/PUT allows attackers to Disclose Information or Write Files via a crafted GET/PUT request under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Xmpp http upload versions are affected?
Affected versions include releases prior to 0.4.0 across affected packages: xmpp-http-upload.
What version fixes CVE-2020-15239?
Upgrading to 0.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xmpp-http-upload affected?
Yes, xmpp-http-upload is affected in releases prior to 0.4.0. Upgrade your dependency to 0.4.0 or later.
What is the CVSS score of CVE-2020-15239?
CVE-2020-15239 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2020-15239?
CVE-2020-15239 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check PyPI dependencies for CVE-2020-15239?
Run the dependency tree command: 'pip show xmpp-http-upload'. 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-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
  }
}