Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-59342: CWE-24: Path Traversal: '../filedir' in esm-dev esm.sh

0
Medium
VulnerabilityCVE-2025-59342cvecve-2025-59342cwe-24
Published: Wed Sep 17 2025 (09/17/2025, 17:59:34 UTC)
Source: CVE Database V5
Vendor/Project: esm-dev
Product: esm.sh

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.

AI-Powered Analysis

AILast updated: 01/14/2026, 19:12:41 UTC

Technical Analysis

CVE-2025-59342 is a path traversal vulnerability identified in esm.sh, a no-build content delivery network widely used in modern web development. The vulnerability exists in esm.sh versions 136 and earlier due to improper handling of the X-Zone-Id HTTP header. Specifically, the application uses the header value to construct filesystem paths without proper canonicalization or restriction to the application's designated storage directory. This allows an attacker to include '../' sequences in the header, enabling them to traverse directories and write files outside the intended storage location. Such unauthorized file writes can lead to overwriting critical files, injecting malicious code, or disrupting application functionality. The vulnerability requires no authentication or user interaction, making it remotely exploitable over the network. The CVSS 4.0 vector indicates network attack vector, low attack complexity, no privileges or user interaction required, and limited impact on integrity. Although no known exploits are reported in the wild, the flaw poses a tangible risk to affected deployments. Version 136.1 of esm.sh includes a patch that properly canonicalizes and restricts the X-Zone-Id header input, mitigating the vulnerability. Organizations relying on esm.sh should prioritize upgrading to this patched version and review their input validation practices to prevent similar issues.

Potential Impact

For European organizations, this vulnerability could lead to unauthorized file writes on servers hosting esm.sh services, potentially compromising data integrity and availability. Attackers could overwrite or inject malicious files, leading to service disruptions, defacement, or further exploitation such as remote code execution if chained with other vulnerabilities. Since esm.sh is a CDN used in modern web development, compromised servers might serve malicious content to end users, damaging organizational reputation and trust. The lack of authentication requirement increases the risk of widespread exploitation. Organizations in sectors with high reliance on web services, such as finance, e-commerce, and government, could face operational and compliance risks if exploited. Although no exploits are currently known, the vulnerability's presence in a widely used CDN component necessitates proactive mitigation to avoid potential supply chain attacks impacting European digital infrastructure.

Mitigation Recommendations

1. Upgrade esm.sh to version 136.1 or later immediately to apply the official patch addressing the path traversal issue. 2. Implement strict input validation and sanitization on all HTTP headers, especially those used in filesystem path construction, to reject or canonicalize any '../' sequences or other traversal patterns. 3. Employ filesystem access controls and sandboxing to limit the directories where the application can write files, minimizing the impact of any potential traversal attempts. 4. Monitor server logs for suspicious X-Zone-Id header values or unusual file write activities indicative of exploitation attempts. 5. Conduct regular security audits and code reviews focusing on path handling and input validation in web-facing components. 6. Consider deploying Web Application Firewalls (WAFs) with rules to detect and block path traversal payloads targeting HTTP headers. 7. Educate development teams on secure coding practices related to path handling to prevent recurrence of similar vulnerabilities.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-09-12T12:36:24.636Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 68caf94c33b75e972181a55c

Added to database: 9/17/2025, 6:09:16 PM

Last enriched: 1/14/2026, 7:12:41 PM

Last updated: 2/6/2026, 4:17:06 AM

Views: 216

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats