/

CVE-2026-53779

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in WebP Server Go on Windows

CVE-2026-53779

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read

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

WebP Server Go on Windows mishandles path normalization, allowing percent-encoded backslashes to bypass directory restrictions around the configured IMG_PATH.

An unauthenticated attacker can craft HTTP requests that traverse directories and read arbitrary files accessible to the server process outside the intended image root.

Affected context

This vulnerability affects WebP Server Go deployments running on Windows where the server:

  • Relies on path.Clean() or similar logic to sanitize request paths
  • Exposes HTTP endpoints that map URL paths to files under a configured IMG_PATH
  • Runs under an account that has read access to sensitive files on the host

The issue arises from a mismatch between Go's forward-slash-only path cleaning and the Windows filesystem, which treats both forward slashes and backslashes as directory separators.

Exploit preconditions

  • Attack surface: Public or internal HTTP interface of WebP Server Go on Windows
  • Required access: No authentication required; network reachability to the server is sufficient
  • Trigger point: File-serving handlers in handler/router.go that:
  • Decode URL paths
  • Pass them through path.Clean() (or equivalent)
  • Join the result with IMG_PATH and open files on disk
  • Why exploitation is possible: The sanitizer normalizes only forward slashes, but Windows APIs treat decoded backslashes (\) as path separators. By embedding percent-encoded backslashes (%5C) in the URL, an attacker can construct paths that escape the IMG_PATH directory after cleaning and gain read access to unintended filesystem locations.

Why this happens

The root cause is a path traversal flaw stemming from platform-inconsistent path normalization (CWE-22). The code trusts path.Clean() to enforce containment within a configured root directory, but path.Clean() is designed for slash-separated paths and does not consider backslashes as directory separators.

On Windows, once the percent-encoded backslashes are decoded, the OS-level file APIs interpret them as valid path separators, effectively reintroducing ..-style traversal or cross-directory access that the application believed it had neutralized. This mismatch between application-level sanitization and underlying filesystem semantics creates an insecure pattern where user-controlled paths are insufficiently validated before being used in file operations.

Potential impact

  • Attackers may read arbitrary files accessible to the WebP Server Go process, including configuration files and application logs.
  • Credentials, tokens, or API keys stored on disk could be disclosed and reused in further attacks.
  • Sensitive user data or internal system information (e.g., environment-specific configuration, hostnames, network layout) could be exposed.
  • File disclosure may facilitate follow-on attacks such as privilege escalation, lateral movement, or service impersonation.

General mitigation guidance

Effective mitigation focuses on enforcing strict, platform-aware path handling and minimizing the trust placed in user-supplied paths:

  • Use path-joining and cleaning APIs that are appropriate for the underlying OS (e.g., filepath.Clean and filepath.Join in Go on Windows).
  • Normalize both forward slashes and backslashes at the earliest point, or reject requests containing unexpected separator characters.
  • After computing the target path, verify that it remains within the intended root directory by comparing canonical/absolute paths before allowing access.
  • Implement a whitelist-based approach to file access (e.g., serving only from a curated directory tree or a manifest of allowed resources) instead of directly mirroring user-specified paths.
  • Run the server with least-privilege filesystem permissions so that even if traversal occurs, the process cannot read highly sensitive system or application files.

How teams detect issues like this

Detection typically combines code-centric and operational approaches:

  • Static analysis and code review:
  • Flag any use of user-controlled path segments passed into file operations (os.Open, ioutil.ReadFile, etc.) without explicit root containment checks.
  • Verify that path normalization uses OS-aware APIs and that both forward slashes and backslashes are considered on Windows.
  • Look for path-join patterns that trust path.Clean() or equivalent without subsequent validation of the resulting absolute path.
  • Security testing and DAST:
  • Use automated scanners or custom test harnesses to probe file-serving endpoints with encoded traversal patterns (e.g., %2e%2e%5C, %5C..%5C) and monitor responses for unexpected file contents.
  • Runtime monitoring:
  • Enable logging of requested paths and the resolved filesystem paths, then alert on access attempts outside the configured IMG_PATH.
  • Monitor access to unusually sensitive files by the WebP Server Go process, using host-based intrusion detection or EDR tools.

Sources

SourceLink
github.comgithub.com/webp-sh/webp_server_go/commit/eb3b5f9289b331cb639cd610b0d1c532d2cc24e0
github.comgithub.com/webp-sh/webp_server_go/pull/451
vulncheck.comvulncheck.com/advisories/webp-server-go-path-traversal-via-backslash-encoding-on-windows

Frequently asked

questions

Yes. Any attacker who can reach the WebP Server Go HTTP interface on a vulnerable Windows deployment can attempt to exploit the path traversal without prior authentication.

No specific credentials are required. The vulnerability occurs before authorization checks on the path, so anonymous requests can carry malicious traversal sequences.

Adopt OS-aware path handling (e.g., filepath.Clean/filepath.Join in Go), normalize both forward and backslash separators, and enforce a strict check that the resolved absolute path remains within the configured root directory before performing any file operation.

Design file access layers that never use raw user input as a direct filesystem path. Normalize and validate paths against a well-defined root, use whitelists or indirect identifiers for files where possible, and include platform-specific behavior in your threat models and secure coding guidelines.

Find out what's already
exploitable in your codebase.