{"id":"PYSEC-2026-357","summary":"internetarchive Vulnerable to Directory Traversal in File.download()","details":"### Impact\n**What kind of vulnerability is it?**\nThis is a **Critical** severity directory traversal (path traversal) vulnerability in the `File.download()` method of the `internetarchive` library.\n\n**Who is impacted?**\nAll users of the `internetarchive` library versions `\u003c 5.5.1` are impacted. The vulnerability is particularly critical for users on **Windows systems**, but all operating systems are affected.\n\n**Description of the vulnerability:**\nThe vulnerability existed because the `file.download()` method did 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.\n\n**Potential Impact:**\nAn 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.\n\n### Patches\n**Has the problem been patched?**\nYes, the problem has been patched.\n\n**What versions should users upgrade to?**\nUsers must upgrade to version **5.5.1** or later.\n\n### Workarounds\nIs there a way for users to fix or remediate the vulnerability without upgrading?\n There is no direct workaround that does not involve upgrading the library. The vulnerability is in the core logic of the file download process.\n\nThe only alternative for users who absolutely cannot upgrade is to implement their own custom download function that:\n\n1. Manually sanitizes all filenames using a robust method.\n2. Validates that the resolved absolute path of the download target is within the intended directory before writing any files.\n\nHowever, this essentially re-implements the fix and is not recommended. Upgrading to the patched version is the only safe and supported solution.\n\n### References\n\n- [Release Notes for v5.5.1](https://github.com/jjjake/internetarchive/releases/tag/v5.5.1)\n - [Commit with the fix](https://github.com/jjjake/internetarchive/commit/cba2d459e10a9489fb35caeba0b03e80f5f5d7c2)\n - **CVE Identifier:**  CVE-2025-58438","aliases":["CVE-2025-58438","GHSA-wx3r-v6h7-frjp"],"modified":"2026-07-01T20:22:54.516702Z","published":"2026-06-29T11:50:37.387123Z","references":[{"type":"WEB","url":"https://github.com/jjjake/internetarchive/security/advisories/GHSA-wx3r-v6h7-frjp"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-58438"},{"type":"WEB","url":"https://github.com/jjjake/internetarchive/commit/cba2d459e10a9489fb35caeba0b03e80f5f5d7c2"},{"type":"PACKAGE","url":"https://github.com/jjjake/internetarchive"},{"type":"WEB","url":"https://github.com/jjjake/internetarchive/releases/tag/v5.5.1"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/09/msg00030.html"},{"type":"PACKAGE","url":"https://pypi.org/project/internetarchive"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-wx3r-v6h7-frjp"}],"affected":[{"package":{"name":"internetarchive","ecosystem":"PyPI","purl":"pkg:pypi/internetarchive"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.5.1"}]}],"versions":["0.2.5","0.2.6","0.2.7","0.2.8","0.2.9","0.3.0","0.3.1","0.3.2","0.3.3","0.3.4","0.3.6","0.3.7","0.3.8","0.3.9","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.4.5","0.4.6","0.4.7","0.4.8","0.4.9","0.5.0","0.5.1","0.5.2","0.5.4","0.5.5","0.5.7","0.5.9","0.6.0","0.6.1","0.6.2","0.6.3","0.6.5","0.6.6","0.6.8","0.6.9","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.7.7","0.7.8","0.7.9","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5","0.8.9","0.9.0","0.9.1","0.9.2","0.9.3","0.9.5","0.9.6","0.9.7","0.9.8","1.0.0","1.0.1","1.0.10","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9","1.1.0","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.7","1.8.0","1.8.1","1.8.2","1.8.3","1.8.4","1.8.5","1.9.0","1.9.2","1.9.3","1.9.4","1.9.5","1.9.6","1.9.9","2.0.0","2.0.2","2.0.3","2.1.0","2.2.0","2.3.0","3.0.0","3.0.1","3.0.2","3.1.0","3.2.0","3.3.0","3.4.0","3.5.0","3.6.0","3.7.0","4.0.1","4.1.0","5.0.0","5.0.1","5.0.2","5.0.3","5.0.3.dev1","5.0.4","5.0.5","5.1.0","5.2.0","5.2.1","5.3.0","5.3.1","5.4.0","5.4.1","5.5.0"],"database_specific":{"source":"https://github.com/pypa/advisory-database/blob/main/vulns/internetarchive/PYSEC-2026-357.yaml","last_known_affected_version_range":"\u003c= 5.5.0"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V4","score":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"}]}