# CVE-2020-15239: Directory Traversal in xmpp-http-upload

> Attackers can read arbitrary files with specific suffixes and bypass authentication or quotas in shared hosting environments via directory traversal.

- **Severity:** Low 3.5 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Oct 2020
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-hwv5-w8gm-fq9f, PYSEC-2020-158

## What is CVE-2020-15239?

CVE-2020-15239 is a low-severity path traversal vulnerability in horazont xmpp-http-upload, published on 6 Oct 2020. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

In xmpp-http-upload before version 0.4.0, 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. 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. The issue is patched in version 0.4.0.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2020-15239?

3 open source packages ship an affected version, including xmpp-http-upload. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `xmpp-http-upload` | PyPI | All versions | 0.4.0 |
| `xmpp-http-upload` | PyPI | All versions | 0.4.0 |
| `xmpp-http-upload` | PyPI | All versions | 0.4.0 |

Products: Xmpp-Http-Upload Project Xmpp-Http-Upload.

## How do I fix CVE-2020-15239?

Upgrade xmpp-http-upload to 0.4.0 or later.

## Is CVE-2020-15239 being exploited?

There is no known exploitation of CVE-2020-15239 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-15239 and fix it if it is affected.

What it is: CVE-2020-15239 is a low-severity path traversal vulnerability in horazont xmpp-http-upload, published on 6 Oct 2020. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2020-15239 in the wild and no public exploit code.

Affected packages and fixed versions:
- xmpp-http-upload (PyPI): affected all versions; fixed in 0.4.0
- xmpp-http-upload (PyPI): affected all versions; fixed in 0.4.0
- xmpp-http-upload (PyPI): affected all versions; fixed in 0.4.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-15239/ (Markdown: https://insights.sbomify.com/CVE-2020-15239/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-15239
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-15239
- OSV: https://osv.dev/vulnerability/CVE-2020-15239

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-15239/
Summaries are generated and may contain mistakes; the official description above is the record.
