/

CVE-2026-52844

Severity:

HIGH RISK

(7.5)

Path Traversal Auth Bypass (CWE-22) in Caddy Server

CVE-2026-52844

Analyzed

Vulnerability type

Category:

Path Traversal / Access Control Bypass

CWE:

CWE-22, CWE-284

Impact:

Unauthorized Access to Protected Resources

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

A path handling inconsistency in Caddy on Windows lets certain request URLs bypass path-scoped authentication and deny rules intended to protect private files.

When a URL uses mixed slashes, the matcher may treat it as outside protected paths while the file server resolves it inside them, allowing unauthenticated access to sensitive content under specific path patterns.

Affected context

This vulnerability arises in Caddy deployments running on Windows where path-based routing and access control are used to protect directories like /private/*.

The issue is triggered when clients send URLs that mix forward and backslashes, causing the path matcher to interpret the request as outside a protected scope while the filesystem resolution treats it as inside the directory.

It primarily affects configurations that rely on path matchers for authentication or deny rules around sensitive file paths, rather than additional enforcement layers.

Exploit preconditions

  • Attack surface: HTTP(S) interface exposed by Caddy on Windows systems
  • Required access: Unauthenticated remote access to the Caddy server
  • Trigger point: Requests targeting protected routes (e.g., /private/*) using crafted paths such as /private\secret.txt
  • Why exploitation is possible: The URL path matching logic normalizes and evaluates paths differently than the underlying file server, so a request can appear outside the protected pattern to the matcher while still resolving to a protected file on disk.

Why this happens

The root cause is a mismatch between logical path matching and filesystem resolution, linked to CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-284: Improper Access Control.

Caddy's path matchers on Windows evaluate route scopes using one interpretation of the URL (treating /private\secret.txt as outside /private/*), while the file server uses Windows path semantics and resolves private\secret.txt as a file inside the protected directory.

This discrepancy breaks assumptions about path-scoped security rules: access control checks are performed on one path representation while actual resource access is based on another, causing certain requests to bypass intended restrictions.

Potential impact

  • Unauthenticated clients can access files intended to be protected under path-limited auth or deny rules
  • Exposure of sensitive configuration, logs, or user data stored in "private" directories
  • Bypass of application-level authorization enforced via path-based matchers
  • Potential information disclosure that can assist further attacks against the server or backend systems

General mitigation guidance

Mitigation centers on aligning path validation with resource resolution and reducing reliance on fragile path semantics.

Secure patterns include consistently normalizing and canonicalizing request paths before applying matchers or authorization rules, avoiding mixed slash forms in route definitions, and designing access control based on explicit resource mappings instead of loosely defined path prefixes.

Deployments can also layer defenses by combining path-based rules with stronger authentication and authorization controls, and by minimizing the exposure of sensitive files through separate storage locations or processes that do not depend solely on web path patterns.

How teams detect issues like this

Detection can focus on identifying inconsistent path handling between routing logic and filesystem access.

Static analysis and configuration reviews may look for path-based auth or deny rules that rely on glob-style patterns (e.g., /private/*) on Windows deployments, especially where backslash handling is unclear.

Log analysis can flag repeated access to protected directories using mixed-slash paths, indicating possible probing or exploitation attempts.

Policy enforcement in CI/CD pipelines can require explicit path normalization and canonicalization in server configuration, and security testing tools can incorporate test cases that exercise mixed path separators against protected routes to reveal inconsistencies.

Sources

SourceLink
github.comgithub.com/caddyserver/caddy/security/advisories/GHSA-qrp7-cvwr-j2c6

Frequently asked

questions

Yes. An unauthenticated remote client can exploit the path handling inconsistency over HTTP(S) by sending crafted URLs to access files that should be protected by path-scoped rules.

Only network access to the affected Caddy instance on Windows is required. No prior authentication or local system access is necessary, but the attacker must know or guess paths to sensitive files.

Ensure that path normalization and canonicalization are applied consistently before routing and access control decisions, and that the same normalized representation is used by both matchers and the file-serving logic. Avoid relying on ambiguous patterns that can be interpreted differently by URL parsing and the underlying filesystem.

Adopt a defense-in-depth approach where sensitive resources are protected by robust authentication and authorization mechanisms, not solely by path prefixes. Incorporate security reviews for configuration changes, add automated checks for path normalization issues (especially on Windows), and test access control rules with varied path encodings and separators to validate that they behave as intended.

Find out what's already
exploitable in your codebase.