Skip to content
Vendor Advisory github.com/caddyserver/caddy/security/advisories/GHSA-m675-2p33-xv9g ↗

Vendor Advisory github.com/caddyserver/caddy/security/advisories/GHSA-m675-2p33-xv9g ↗

github.com • November 23, 2026

The FastCGI transport's splitPos() in modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go misuses golang.org/x/text/ with .IgnoreCase when the request path contains a non-ASCII byte. Two distinct flaws in that fallback let an attacker mislead Caddy's FastCGI splitting into treating a non- .php (or other configured split_path extension) file as a script. In any deployment where the attacker can place content into a file served via FastCGI (uploads, file storage, etc.), this can be escalated to remote code execution by crafting a URL whose path triggers either flaw.

This function was adapted from FrankenPHP's code (see the source ) and inherits the same bugs. Both were originally reported against FrankenPHP by @KC1zs4 as GHSA-3g8v-8r37-cgjm (which absorbed the duplicate GHSA-v4h7-cj44-8fc8). Credit for finding the underlying flaws belongs to @KC1zs4 .

Flaw 1 — Control-flow: stale match after inner non-ASCII fallback

In the inner for j loop, when a byte satisfies c >= utf8.RuneSelf and splitSearchNonASCII.IndexString(...) returns -1 , the loop break s without setting match = false . The outer code then evaluates if match { return i + splitLen } with match still true , returning a position as if the configured extension had been matched. The script-name suffix actually present at that offset is whatever bytes the attacker chose, so a file named name. .txt gets routed as PHP.

Flaw 2 — Unicode equivalence: .IgnoreCase folds non-ASCII lookalikes onto ASCII

.New(language.Und, .IgnoreCase) performs Unicode equivalence matching (compatibility decomposition + case folding), which goes far beyond the ASCII-only case folding the surrounding code is built for. Many code points fold onto ASCII . , p , h , p , so a path containing ﹒php , .php , .php , .ⓟⓗⓟ , .𝗽𝗵𝗽 , .𝓅𝒽𝓅 , .𝖕𝖍𝖕 , etc. is reported as .php .

Both flaws the same root cause: invoking .IgnoreCase to match an ASCII-only, validated-lower-case SplitPath entry against an arbitrary path. Provision() already guarantees every entry is ASCII and lower-cased, so any byte >= utf8.RuneSelf in the path can never be part of a legitimate match — but the fallback ignored that guarantee.

Run against a Caddy build serving FastCGI to PHP-FPM (or any FastCGI app where script lookup is gated by split_path ). Caddyfile:

Place attacker-controlled files in /app/public :

/app/public/poc-match-unset.\xc2\xa1. — = utf8.RuneSelf in the path as a non-match. SplitPath entries are validated ASCII-only and lower-cased upstream, so this preserves correct behavior for every legitimate path while making the Unicode bypasses unrepresentable. The replacement is a tight byte loop with no library calls in the hot path. See fix/fastcgi-splitpos-unicode-bypass (commit 4ddad83c ) for the implementation and regression tests.

Both flaws were originally found and reported by @KC1zs4 against FrankenPHP, where the offending splitPos() function was first introduced before being adapted into this module. The Caddy maintainers thank @KC1zs4 for the high-quality reports.