{"answers":{"affected":"3 open source packages ship an affected version, including github.com/esm-dev/esm.sh.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59342 exists.","fix":"Upgrade github.com/esm-dev/esm.sh to 136.1 or later.","what":"CVE-2025-59342 is a medium-severity path traversal vulnerability in esm-dev esm.sh, published on 17 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-59342 and fix it if it is affected.\n\nWhat it is: CVE-2025-59342 is a medium-severity path traversal vulnerability in esm-dev esm.sh, published on 17 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59342 exists.\n\nAffected packages and fixed versions:\n- github.com/esm-dev/esm.sh (Go): affected all versions; no fix listed\n- github.com/esm-dev/esm.sh (Go): affected all versions; fixed in 136.1\n- github.com/esm-dev/esm.sh (Go): affected all versions; fixed in 136.1\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-59342/ (Markdown: https://insights.sbomify.com/CVE-2025-59342/index.md)","id":"CVE-2025-59342","markdown":"https://insights.sbomify.com/CVE-2025-59342/index.md","name":"CVE-2025-59342","record":{"aliases":["GHSA-g2h5-cvvr-7gmw","GO-2025-3967"],"analysis":{"component_type":"server_software","fix_type":"patch","impacts":["data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"esm.sh CDN","requires_auth":"none","summary":"Attackers can write arbitrary files to the server via path traversal in the X-Zone-Id header, potentially compromising the CDN infrastructure.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":5.5,"severity":"medium","source":"cna","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","version":"4.0"},"cwes":[{"id":"CWE-24","name":"Path Traversal: '../filedir'"}],"description":"esm.sh is a nobuild content delivery network(CDN) for modern web development. In 136 and earlier, a path-traversal flaw in the handling of the X-Zone-Id HTTP header allows an attacker to cause the application to write files outside the intended storage location. The header value is used to build a filesystem path but is not properly canonicalized or restricted to the application’s storage base directory. As a result, supplying ../ sequences in X-Zone-Id causes files to be written to arbitrary directories. Version 136.1 contains a patch.","ecosystems":["Go"],"exploits":{"exploitdb":1,"first_seen":"2025-09-18","github_poc":1,"max_poc_stars":1,"metasploit":0,"nuclei":1,"refs":[{"date":"2025-09-18T22:34:59Z","kind":"github_poc","ref":"https://github.com/byteReaper77/CVE-2025-59342","stars":1,"title":"Exploit Path Traversal in esm-dev "},{"date":"2025-12-16","kind":"exploitdb","ref":"52461","stars":null,"title":"esm-dev 136 - Path Traversal"},{"date":null,"kind":"nuclei","ref":"http/cves/2025/CVE-2025-59342.yaml","stars":null,"title":"esm.sh \u003c= v136 - Arbitrary File Write via Path Traversal"}],"tier":"weaponised"},"has_fix":true,"headline":"esm.sh writes arbitrary files via path traversal in `X-Zone-Id` header","id":"CVE-2025-59342","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Go","product":null,"products":[],"type":"path_traversal","year":"2025"},"n_packages":3,"n_references":4,"next":{"headline":"tar-fs has a symlink validation bypass if destination directory is predictable with a specific tarball","id":"CVE-2025-59343"},"packages":[{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/esm-dev/esm.sh","purl":"pkg:golang/github.com/esm-dev/esm.sh","source":"GO-2025-3967"},{"ecosystem":"Go","fixed":["136.1"],"introduced":["0"],"last_affected":[],"package":"github.com/esm-dev/esm.sh","purl":null,"source":"GHSA-g2h5-cvvr-7gmw"},{"ecosystem":"Go","fixed":["136.1"],"introduced":["0"],"last_affected":[],"package":"github.com/esm-dev/esm.sh","purl":"pkg:golang/github.com/esm-dev/esm.sh","source":"GHSA-g2h5-cvvr-7gmw"}],"prev":{"headline":"Local File Inclusion in esm.sh","id":"CVE-2025-59341"},"products":["esm.sh"],"published":"2025-09-17","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"GPL-2.0-or-later","name":"Exploit-DB"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-01-14","vendors":["esm-dev"]},"summary":"Attackers can write arbitrary files to the server via path traversal in the X-Zone-Id header, potentially compromising the CDN infrastructure.","url":"https://insights.sbomify.com/CVE-2025-59342/"}