CVE-2025-59342
vulnerability analysis and mitigation

Overview

CVE-2025-59342 affects esm.sh, a nobuild content delivery network (CDN) for modern web development. The vulnerability was discovered and disclosed on September 17, 2025, impacting versions 136 and earlier of the software. The flaw involves a path-traversal vulnerability in the handling of the X-Zone-Id HTTP header that allows attackers to write files outside the intended storage location (GitHub Advisory).

Technical details

The vulnerability stems from improper handling of the X-Zone-Id HTTP header in the application's file handling logic. The header value is used to construct filesystem paths but lacks proper canonicalization and restriction to the application's storage base directory. When attackers supply '../' sequences in the X-Zone-Id header, they can manipulate the path to write files to arbitrary directories outside the intended storage location. The vulnerable code is located in the server/router.go file. The CVSS v4.0 score is 5.5 (Medium) with the vector string 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 (NVD).

Impact

The vulnerability allows attackers to perform arbitrary file creation and overwrite operations outside the intended storage directory. This could potentially lead to remote code execution, persistence mechanisms, tampering with application files, or facilitate further path-traversal attacks. The impact is particularly concerning as it affects the application's file storage security boundaries (GitHub Advisory).

Mitigation and workarounds

The recommended remediation is to remove any '../' sequences from the X-Zone-Id header before processing the file. As of the disclosure, no patched versions are available (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management