# CVE-2026-137031: arduino-esp32: Path traversal in Webserver's `serveStatic()`

> Unauthenticated attackers can read files outside the static root on ESP32 devices using arduino-esp32's WebServer serveStatic().

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Harmful if only installed:** No
- **Needs a specific call:** Yes (`serveStatic()`)
- **Fix available:** Yes
- **Published:** 30 Nov 2026
- **Updated:** 1 Dec 2026
- **Also known as:** GHSA-vqp8-ppw3-8mc7

## What is CVE-2026-137031?

CVE-2026-137031 is a high-severity path traversal vulnerability in espressif arduino-esp32, published on 30 Nov 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

arduino-esp32 is an Arduino core for the ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 and ESP32-H2 microcontrollers. Prior to 3.3.12 and in 4.0.0-alpha1, the WebServer library's serveStatic() implementation does not reject literal or percent-encoded . and .. path segments. An unauthenticated network attacker can submit a crafted HTTP request that resolves outside the configured static document root and reads files elsewhere on the LittleFS or SPIFFS filesystem. Applications that do not call serveStatic(), or that mount only a dedicated public filesystem without sensitive files, are not materially affected. This issue is fixed in versions 3.3.12 and 4.0.0.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-137031?

An affected version is only exploitable if your software calls serveStatic(). Many projects that include it are not exposed.


## How do I fix CVE-2026-137031?

Upgrade espressif arduino-esp32 to the fixed version for your release line. The advisory names 3.3.12 and 4.0.0.

## Is CVE-2026-137031 being exploited?

There is no known exploitation of CVE-2026-137031 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-137031 and fix it if it is affected.

What it is: CVE-2026-137031 is a high-severity path traversal vulnerability in espressif arduino-esp32, published on 30 Nov 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-137031 in the wild and no public exploit code.
Exposure: An affected version is only exploitable if your software calls serveStatic(). Many projects that include it are not exposed.

Affected product: espressif arduino-esp32. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
   If an affected version is present, also search the code for calls to serveStatic() and report whether any exist.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-137031/ (Markdown: https://insights.sbomify.com/CVE-2026-137031/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-137031
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-137031
- OSV: https://osv.dev/vulnerability/CVE-2026-137031

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-137031/
Summaries are generated and may contain mistakes; the official description above is the record.
