- New plain_time_format option for file_server browse sets the time layout of plain-text directory listings (Accept: text/plain)
- New httpcaddyfile.Helper.IsNamedRoute() method tells a directive whether it is being parsed inside a named route
- Reduced allocations in path cleaning, header rewriting and weighted_round_robin selection
- Conflicting client_auth values across TLS connection policies for the same hostname are now a Caddyfile error instead of silently dropping one of them behavior changed · vendor-flagged, marked in the notes below
- FastCGI requests whose escaped path and decoded path would select different scripts now receive a 400 response
- On Windows, FastCGI script paths containing an 8.3 short name component or a colon (NTFS alternate data streams) now receive a 400 response
- FastCGI env values now take precedence over request headers, so clients can no longer override HTTP_* variables set with env behavior changed · vendor-flagged, marked in the notes below
- A try_files pattern now only matches a directory when the pattern ends in a trailing slash, so requests like /wp-admin/ reach index.php instead of returning 404 (regression in 2.11.8)
- Placeholders such as {env.FOO} in path matchers are no longer lower-cased before lookup, and their values are compared case-insensitively against the request path
- FastCGI: a client could override HTTP_* variables set with the env subdirective by sending a matching request header; configured values now win (GHSA-q34h-28rj-5hjm)
- FastCGI on Windows: NTFS 8.3 short names and alternate data streams could run a script that a path rule was meant to deny (GHSA-9cr8-wmhh-39pm)
- FastCGI: encoded slashes and dot segments could make a %-containing path matcher approve one script while another ran
- FastCGI over HTTP/2: a host field sent alongside :authority could make the application see a different HTTP_HOST than the host Caddy routed to behavior changed · vendor-flagged, marked in the notes below
- httpcaddyfile: a stricter client_auth could be silently dropped when merging TLS connection policies
- Updated go-jose to v4.1.6 to address GHSA-mgcc-cww5-fp2q
4 changes to check, marked in the notes below
From Caddy
This is a quick follow-up on top of 2.11.8, to fix a regression it introduced and a few more security issues, mostly in FastCGI. It contains only fixes backported from master, plus a couple of small additions. If you're on 2.11.8 and serve PHP, we recommend upgrading.
Huge thank you to our sponsors for keeping the project alive with resources, and for our maintainers who triage and assist tirelessly in this relentless new age of AI.
Highlights
- Fixed: PHP directory indexes (regression in 2.11.8). A request for a directory with a trailing slash, like
/wp-admin/, was matched by the directory itself instead of itsindex.php, so it never reached PHP and usually got a 404. This broke WordPress admin pages and other apps that serve an index through a trailing-slash URL. Atry_filespattern now only matches a directory when it ends in/. Thanks @dunglas! (#8352) - Path matchers with placeholders now work as expected: placeholders like
{env.FOO}are no longer lower-cased into{env.foo}before they're looked up, and their values are compared case-insensitively against the request path, like static patterns. Thanks @BenMacha! (#8343) - New
plain_time_formatoption forfile_server browse: sets the time layout of plain-text directory listings (Accept: text/plain). Thanks @steffenbusch! (#8084) - Fewer allocations in path cleaning, header rewriting and
weighted_round_robinselection. Thanks @jvoisin! (#7842) - For plugin authors: new
httpcaddyfile.Helper.IsNamedRoute()tells a directive whether it's being parsed inside a named route. (#8354)
:warning: Breaking changes
- Conflicting
client_authis now a Caddyfile error. When two site blocks share TLS connection policies for the same hostname but set differentclient_auth, the adapter used to keep the first one and silently drop the other, which could quietly remove a stricter mTLS requirement. (#8306) behavior changed · vendor-flagged - FastCGI requests that are ambiguous about which script they run get
400: behavior changed · vendor-flagged- when the escaped path (which
%-containing path matchers see) and the decoded path would select different scripts, e.g./public/tool.php%2f..%2f..%2fadmin%2ftool.php(#8357) - on Windows, script paths with an 8.3 short name component (like
ADMINI~1) or a:(NTFS alternate data streams) (#8356)
- when the escaped path (which
- FastCGI
envvalues now take precedence over request headers, so a client can no longer overrideHTTP_*variables you set withenv(see below). (#8358) behavior changed · vendor-flagged
Security fixes
Thank you to everyone who reported responsibly and helped with patches:
- fastcgi: A client could override any
HTTP_*variable set with the FastCGI transport's (orphp_fastcgi's)envsubdirective by sending a matching request header, for example choosing the user an application sees inHTTP_X_AUTH_USER. Configured values now win. Reported by @JebeenLee and @Camel4, fixed by @dunglas. (GHSA-q34h-28rj-5hjm, #8358) - fastcgi: On Windows, NTFS 8.3 short names and alternate data streams could run a script that a path rule was meant to deny, completing the FastCGI fix from 2.11.8. Thanks @dunglas. (GHSA-9cr8-wmhh-39pm, #8356)
- fastcgi: Encoded slashes and dot segments could make a
%-containing path matcher approve one script while another one runs. Thanks @dunglas. (#8357) - fastcgi: Over HTTP/2, a
hostfield sent next to:authoritycould make the application see a different host (HTTP_HOST) than the one Caddy routed the request to. Thanks @dunglas. (#8355) behavior changed · vendor-flagged - httpcaddyfile: A stricter
client_authcould be silently dropped when merging TLS connection policies (see above). Thanks @sam-kota. (#8306) - Updated
go-joseto v4.1.6 for GHSA-mgcc-cww5-fp2q. (#8299)
:warning: These security patches may be breaking if your application relies on the buggy behaviors.
:rotating_light: Notice for Caddy plugin maintainers: Dependabot will probably alert you to the security fixes in Caddy and urge you to upgrade it in your go.mod file. Please ONLY upgrade the Caddy dependency if there's a change to an exported API your plugin uses.
What's Changed
- caddyhttp: lower-case path patterns with placeholders at request time by @BenMacha in https://github.com/caddyserver/caddy/pull/8343
- httpcaddyfile: reject conflicting client_auth when merging TLS policies by @sam-kota in https://github.com/caddyserver/caddy/pull/8306
- build(deps): bump the actions-deps group across 1 directory with 10 updates by @dependabot[bot] in https://github.com/caddyserver/caddy/pull/8340
- build(deps): bump github.com/go-jose/go-jose/v4 from 4.1.5 to 4.1.6 by @dependabot[bot] in https://github.com/caddyserver/caddy/pull/8299
- fileserver: make plain-text browse time format configurable by @steffenbusch in https://github.com/caddyserver/caddy/pull/8084
- fileserver: only match a dir when the pattern ends by / by @dunglas in https://github.com/caddyserver/caddy/pull/8352
- httpcaddyfile: add Helper.IsNamedRoute by @dunglas in https://github.com/caddyserver/caddy/pull/8354
- fastcgi: take HTTP_HOST from the routed host only by @dunglas in https://github.com/caddyserver/caddy/pull/8355
- fastcgi: reject Win 8.3 aliases and alt data streams paths by @dunglas in https://github.com/caddyserver/caddy/pull/8356
- caddyhttp: presize buffers in hot paths to reduce allocations by @jvoisin in https://github.com/caddyserver/caddy/pull/7842
- fastcgi: let configured env variables override request headers by @dunglas in https://github.com/caddyserver/caddy/pull/8358
- fastcgi: reject paths whose escaped form selects another script by @dunglas in https://github.com/caddyserver/caddy/pull/8357
Full Changelog: https://github.com/caddyserver/caddy/compare/v2.11.8...v2.11.9