Skip to content

fastcgi: reject Win 8.3 aliases and alt data streams paths - #8356

Merged
francislavoie merged 1 commit into
caddyserver:masterfrom
dunglas:fastcgi-windows-script-aliases
Nov 4, 2026
Merged

francislavoie merged 1 commit into
caddyserver:masterfrom
dunglas:fastcgi-windows-script-aliases

Conversation

@dunglas

@dunglas dunglas commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

On NTFS volumes with 8.3 aliases, /UPLOAD~1.PHP names uploadedpayload.phpx, so the split matches and the backend runs a file without a split extension. Alternate data streams (/a.txt:b.php) reach a non-PHP file the same way. Path matchers cannot see through either, which is why the file server already rejects them. 4ec5a5c3 left this case out of scope.

On Windows, script paths with an 8.3-shaped component or a : now get a 400. The short name check moves from fileserver to caddyhttp.HasWindowsShortName so both modules share it, and buildEnv errors now keep their status code.

Port of the FrankenPHP fix: php/frankenphp@de3de81

Assistance Disclosure

Claude Code (Claude Opus 5.5) ported this fix from the FrankenPHP patch and wrote the tests. I reviewed and tested the result.

โ€ฆipt paths

On NTFS volumes with 8.3 aliases, "/UPLOAD~1.PHP" names
"uploadedpayload.phpx", so the split matched and the backend ran a file
without a split extension. Alternate data streams ("/a.txt:b.php") reach
a non-PHP file the same way. Path matchers cannot see through either,
which is why the file server already rejects them.

On Windows, script paths with an 8.3-shaped component or a ":" now get
a 400. The short name check moves to caddyhttp so the file server and
the FastCGI transport share it, and buildEnv errors keep their status.

Backport of the FrankenPHP fix reported by Daybreak Red.
@francislavoie francislavoie added the bug ๐Ÿž Something isn't working label Nov 4, 2026
@francislavoie francislavoie added this to the v2.11.9 milestone Nov 4, 2026
@francislavoie
francislavoie merged commit 7145e5e into caddyserver:master Nov 4, 2026
26 checks passed
francislavoie pushed a commit that referenced this pull request Nov 5, 2026
@github-actions github-actions Bot mentioned this pull request Nov 5, 2026
5 tasks
steadytao added a commit to MangoGovo/caddy that referenced this pull request Nov 5, 2026
this was moved during caddyserver#8356 and is not required

Signed-off-by: Zen Dodd <mail@steadytao.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ๐Ÿž Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants