# CVE-2025-58438: internetarchive is vulnerable to Directory Traversal through file downloads

> Attackers can exploit unsanitized filenames in the internetarchive library to write files outside intended directories, potentially leading to code execution or privilege escalation.

- **Severity:** Critical 9.4 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Sep 2025
- **Updated:** 3 Nov 2025
- **Also known as:** DEBIAN-CVE-2025-58438, DLA-4314-1, DSA-6035-1, GHSA-wx3r-v6h7-frjp, PYSEC-2026-357, UBUNTU-CVE-2025-58438, USN-7989-1

## What is CVE-2025-58438?

CVE-2025-58438 is a critical path traversal vulnerability in jjjake internetarchive, published on 6 Sep 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

internetarchive is a Python and Command-Line Interface to Archive.org In versions 5.5.0 and below, there is a directory traversal (path traversal) vulnerability in the File.download() method of the internetarchive library. The file.download() method does not properly sanitize user-supplied filenames or validate the final download path. A maliciously crafted filename could contain path traversal sequences (e.g., ../../../../windows/system32/file.txt) or illegal characters that, when processed, would cause the file to be written outside of the intended target directory. An attacker could potentially overwrite critical system files or application configuration files, leading to a denial of service, privilege escalation, or remote code execution, depending on the context in which the library is used.  The vulnerability is particularly critical for users on Windows systems, but all operating systems are affected. This issue is fixed in version 5.5.1.

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

## Which versions are affected by CVE-2025-58438?

3 open source packages ship an affected version, including internetarchive.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `internetarchive` | PyPI | All versions | 5.5.1 |
| `internetarchive` | PyPI | All versions | 5.5.1 |
| `internetarchive` | PyPI | All versions | 5.5.1 |

## How do I fix CVE-2025-58438?

Upgrade internetarchive to 5.5.1 or later.

## Is CVE-2025-58438 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-58438 and fix it if it is affected.

What it is: CVE-2025-58438 is a critical path traversal vulnerability in jjjake internetarchive, published on 6 Sep 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-58438 in the wild and no public exploit code.

Affected packages and fixed versions:
- internetarchive (PyPI): affected all versions; fixed in 5.5.1
- internetarchive (PyPI): affected all versions; fixed in 5.5.1
- internetarchive (PyPI): affected all versions; fixed in 5.5.1

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-2025-58438/ (Markdown: https://insights.sbomify.com/CVE-2025-58438/index.md)
```

## Sources

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

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