Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Zephyr HTTP Static FS

CVE-2026-8023

Modified

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-23

Impact:

Arbitrary File Read / Information Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Zephyr's HTTP server static-filesystem handler concatenates attacker-controlled URL paths directly with a configured root directory without normalizing ./.. segments.

When a static FS resource is registered, an unauthenticated remote client can issue crafted HTTP/1 or HTTP/2 requests that traverse outside the web root and read arbitrary files from the mounted filesystem.

Affected context

This vulnerability appears in Zephyr-based systems that:

  • Enable CONFIG_FILE_SYSTEM and mount a filesystem (e.g., LittleFS, FAT)
  • Register an HTTP static-filesystem resource (HTTP_RESOURCE_TYPE_STATIC_FS)
  • Use the built-in HTTP/1 or HTTP/2 front-ends without additional path validation

In such deployments, HTTP requests are processed by the static FS handler when wildcard or leading-directory matching routes the request path to that resource.

Exploit preconditions

  • Attack surface: HTTP server endpoint exposed by a Zephyr-based device or application.
  • Required access: Remote network reachability to the HTTP server; no authentication or TLS is required by default.
  • Trigger point: A crafted URL path such as /prefix/../../sensitive_file sent via HTTP/1 GET or HTTP/2 :path header.
  • Why exploitation is possible: The HTTP server copies the raw request path into client_url_buffer and concatenates it with the configured static FS root using snprintk("%s%s", fs_path, client_url_buffer). The filesystem (fs_open) then resolves .. segments, allowing traversal outside the intended web root.

Why this happens

The bug stems from treating the incoming URL path as a trusted, already-canonical filesystem path and failing to remove or normalize dot segments before resource lookup.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-23: Relative Path Traversal, where user-supplied relative paths (including ../) are concatenated with a base directory and handed to the filesystem.

The underlying pattern is direct string-based path construction from unvalidated input, relying on the filesystem to interpret and normalize the path instead of enforcing an application-level boundary.

Potential impact

  • An attacker may read arbitrary readable files on the mounted volume.
  • Sensitive configuration data, credentials, or keys could be exposed.
  • Internal application logs and debugging information can be disclosed.
  • Information leakage may enable further attacks against the device or backend services.

General mitigation guidance

Mitigation focuses on enforcing strict path canonicalization and directory boundaries before accessing the filesystem.

Common defensive patterns include:

  • Canonicalizing URL paths by removing dot segments (. and ..) before routing or file resolution.
  • Rejecting requests that resolve outside the configured web root after normalization.
  • Using high-level APIs that perform safe path joining and boundary checks rather than manual string concatenation.
  • Limiting what is stored on or exposed via the mounted volume, and segregating sensitive data from web-served content.
  • Applying least-privilege filesystem permissions so the HTTP server process can read only the minimum set of files required.

How teams detect issues like this

Organizations can detect similar path traversal issues through:

  • Static analysis rules that flag direct concatenation of user-controlled paths with filesystem roots (e.g., base + user_path before open/fs_open).
  • Code review checklists that require explicit path normalization and boundary checks for any file-serving or download endpoints.
  • Unit and integration tests that send ../ and ./../ sequences in request paths to confirm they are safely rejected or constrained.
  • Policy enforcement in CI pipelines to ensure HTTP and filesystem handlers always apply canonicalization routines and restrict traversal.

Sources

SourceLink
github.comgithub.com/zephyrproject-rtos/zephyr/commit/f4a423c98554f209c5d2f22f041822422c9263b8
github.comgithub.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-hch3-53g6-jj3h

Frequently asked

questions

It affects both HTTP/1 and HTTP/2 front-ends because each copies the raw request path or :path pseudo-header directly into the buffer used for filesystem access.

Only network access to the Zephyr HTTP server endpoint is required. No authentication is needed, and the attack can be performed remotely over plain HTTP if the server is reachable.

Normalize the request path to a canonical form by removing dot segments, then verify that the resulting path remains within the configured web root before performing any filesystem operations.

Treat all paths derived from client input as untrusted, centralize path normalization and boundary checking logic, avoid raw string concatenation for filesystem paths, and incorporate tests and static analysis rules targeting directory traversal patterns.

Find out what's already
exploitable in your codebase.