{"id":"CVE-2025-58438","kind":"vulnerability","aliases":["CVE-2025-58438","GHSA-wx3r-v6h7-frjp"],"related":[],"title":"internetarchive Vulnerable to Directory Traversal in File.download()","description":"### 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 `< 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?\nThere 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","summary":"The internetarchive Python library's File.download() does not sanitize filenames or check the final download path, so a crafted filename with traversal sequences writes files outside the intended directory. An attacker who controls a filename the library downloads can overwrite system or application config files, which the advisory says can lead to denial of service, privilege escalation or remote code execution.","severity":"critical","cvss":9.4,"epss":0.0159,"exploited":false,"exploited_at":null,"products":[{"name":"internetarchive","fixed":["5.5.1"],"affected":"<= 5.5.0","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["cwe-22","internetarchive","package","pypi","python"],"not_affected_if":["library-not-used","version-5.5.1-or-later"],"how_to_check":"- Run `pip show internetarchive` and check whether the version is below `5.5.1`\n- Check `requirements.txt`, `poetry.lock` or `Pipfile.lock` for `internetarchive` pinned below `5.5.1`","fix":"- Upgrade the `internetarchive` package to `5.5.1` or later (`pip install --upgrade internetarchive>=5.5.1`)\n- The advisory states there is no workaround short of upgrading","status":"open","published_at":"2025-09-05T21:00:42+00:00","first_seen_at":"2026-10-27T17:27:29+00:00","triaged_at":"2026-10-27T17:28:01+00:00","updated_at":"2026-10-27T17:32:47+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-27T17:28:01Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade the `internetarchive` package to `5.5.1` or later (`pip install --upgrade internetarchive>=5.5.1`)\n- The advisory states there is no workaround short of upgrading","reach":"unknown","title":"internetarchive: directory traversal in File.download() lets files be written anywhere","impact":"high","summary":"The internetarchive Python library's File.download() does not sanitize filenames or check the final download path, so a crafted filename with traversal sequences writes files outside the intended directory. An attacker who controls a filename the library downloads can overwrite system or application config files, which the advisory says can lead to denial of service, privilege escalation or remote code execution.","category":"package","nicknames":[],"who_cares":["python","pypi","internetarchive"],"confidence":0.8,"needs_auth":"unknown","worst_case":"Attacker overwrites system or config files, possibly leading to code execution","analyst_note":"","how_to_check":"- Run `pip show internetarchive` and check whether the version is below `5.5.1`\n- Check `requirements.txt`, `poetry.lock` or `Pipfile.lock` for `internetarchive` pinned below `5.5.1`","needs_analyst":false,"not_affected_if":["version-5.5.1-or-later","library-not-used"],"who_is_affected":"Any application that uses internetarchive versions up to and including 5.5.0 to call File.download() on filenames it does not fully control, such as names taken from Internet Archive item metadata or user input. The advisory says Windows systems are especially at risk, but all operating systems are affected. Projects that do not use this library, or that pin 5.5.1 or later, can skip it.","user_interaction":"no","needs_special_setup":"no","severity_if_unknown":"critical"},"cost_usd":0.000704,"input_tokens":3985,"output_tokens":610,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2025':9A,17A,386C '-22':21B '-58438':10A,18A,387C '/../../../windows/system32/file.txt':176C '/jjjake/internetarchive/commit/cba2d459e10a9489fb35caeba0b03e80f5f5d7c2)':382C '/jjjake/internetarchive/releases/tag/v5.5.1)':375C '1':315C '2':324C '5.5.1':122C,255C 'absolut':303C,329C 'advisori':73B 'affect':140C 'altern':299C 'applic':68B,207C 'attack':56B,199C 'cannot':304C 'caus':184C 'charact':179C 'check':37B 'code':85B,220C 'commit':376C 'config':69B 'configur':208C 'contain':171C 'context':225C 'control':58B 'core':290C 'could':170C,200C 'craft':44B,168C 'critic':97C,129C,203C 'custom':311C 'cve':8A,16A,383C,385C 'cwe':20B 'denial':78B,213C 'depend':222C 'descript':141C 'direct':276C 'directori':4A,54B,99C,195C,339C 'download':40B,63B,164C,295C,312C,333C 'e.g':175C 'escal':82B,217C 'essenti':346C 'execut':86B,221C 'exist':147C 'file':50B,70B,186C,205C,209C,294C,343C 'file.download':7A,31B,106C,150C 'filenam':35B,45B,60B,159C,169C,319C 'final':39B,163C 'fix':266C,351C,379C 'frjp':15A 'function':313C 'ghsa':12A 'ghsa-wx3r-v6h7-frjp':11A 'github.com':374C,381C 'github.com/jjjake/internetarchive/commit/cba2d459e10a9489fb35caeba0b03e80f5f5d7c2)':380C 'github.com/jjjake/internetarchive/releases/tag/v5.5.1)':373C 'howev':344C 'identifi':384C 'illeg':178C 'impact':87C,114C,124C,197C 'implement':308C,349C 'intend':53B,193C,338C 'internetarch':1A,22B,27B,110C,119C 'internetarchive':19A 'involv':281C 'kind':89C 'later':257C 'lead':76B,210C 'librari':29B,62B,111C,120C,229C,284C 'logic':291C 'malici':167C 'manual':316C 'method':107C,151C,323C 'must':251C 'note':370C 'oper':137C 'outsid':51B,190C 'overwrit':65B,202C 'packag':23B 'particular':128C 'patch':232C,237C,243C,359C 'path':41B,101C,165C,172C,330C 'potenti':196C,201C 'privileg':81B,216C 'problem':235C,240C 'process':182C,296C 'proper':154C 'pypi':24B 'python':25B,28B 're':348C 're-impl':347C 'recommend':355C 'refer':368C 'releas':369C 'remedi':268C 'remot':84B,219C 'resolv':328C 'robust':322C 'safe':364C 'sanit':34B,155C,317C 'say':74B 'sequenc':48B,174C 'servic':80B,215C 'sever':98C 'solut':367C 'suppli':158C 'support':366C 'system':66B,134C,138C,204C 'target':194C,334C 'travers':5A,47B,100C,102C,173C 'upgrad':248C,252C,272C,282C,305C,356C 'use':231C,320C 'user':116C,131C,157C,247C,250C,264C,301C 'user-suppli':156C 'v5.5.1':372C 'v6h7':14A 'valid':161C,325C 'version':121C,245C,254C,360C 'vulner':2A,91C,103C,126C,144C,146C,270C,286C 'way':262C 'window':133C 'within':336C 'without':271C 'workaround':258C,277C 'would':183C 'write':49B,341C 'written':189C 'wx3r':13A 'yes':238C","nicknames":[],"mitigations":[],"who_affected":"Any application that uses internetarchive versions up to and including 5.5.0 to call File.download() on filenames it does not fully control, such as names taken from Internet Archive item metadata or user input. The advisory says Windows systems are especially at risk, but all operating systems are affected. Projects that do not use this library, or that pin 5.5.1 or later, can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2025-09-05T21:00:42+00:00","kev":null,"cvss_vector":"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","cvss_by":"security-advisories@github.com","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-wx3r-v6h7-frjp","url":"https://github.com/advisories/GHSA-wx3r-v6h7-frjp","severity":"critical","published_at":"2025-09-05T21:00:42+00:00","modified_at":"2026-10-27T17:25:04+00:00","first_seen_at":"2026-10-27T17:27:29+00:00","fetched_at":"2026-10-27T17:27:29+00:00","note":null},{"source":"nvd","external_id":"CVE-2025-58438","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-58438","severity":null,"published_at":"2025-09-06T19:15:38+00:00","modified_at":"2026-06-17T09:44:27+00:00","first_seen_at":"2026-10-27T17:32:47+00:00","fetched_at":"2026-10-27T17:32:47+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}