Ad
 
Learn More

Configured env wins is the Important line in Caddy

Caddy 2.11.9 stops clients from overriding FastCGI env values with request headers, fixes the 2.11.8 PHP directory index regression, and turns conflicting client_auth into a config error. Validate your Caddyfile before you roll it out.

Written by Watch Changelog Team

•3 min read

Configured env wins is the Important line in Caddy

Caddy shipped 2.11.9 on November 5, and we flagged it as Important on Caddy Releases. It's a quick follow-up to 2.11.8, which came out a day earlier. The maintainers say that if you're on 2.11.8 and serve PHP, you should upgrade. There are two reasons: a regression that broke PHP directory indexes, and a set of security fixes that are mostly in FastCGI.

The regression is the one you would notice first. In 2.11.8, a request for a directory with a trailing slash, like /wp-admin/, matched the directory itself instead of its index.php, so it never reached PHP and usually came back as a 404. That broke WordPress admin pages and any other app that serves an index through a trailing slash URL. In 2.11.9, a try_files pattern only matches a directory when the pattern ends in a slash.

The security fix I would read twice is GHSA-q34h-28rj-5hjm. If you set HTTP_* variables with the env subdirective of the FastCGI transport or php_fastcgi, a client could override them by sending a request header with the matching name. The release gives the example of choosing the user an application sees in HTTP_X_AUTH_USER. If your PHP app trusts a value like that because Caddy set it, the client could set it too. In 2.11.9 your configured values win.

The other fixes in the release:

  • On Windows, NTFS 8.3 short names (like ADMINI~1) and alternate data streams could run a script that a path rule was meant to deny. This finishes the FastCGI fix from 2.11.8 (GHSA-9cr8-wmhh-39pm).
  • Encoded slashes and dot segments could make a path matcher that contains % approve one script while a different one runs.
  • Over HTTP/2, a host field sent next to :authority could make the app see a different HTTP_HOST than the host Caddy routed the request to.
  • A stricter client_auth could be silently dropped when two site blocks shared TLS connection policies for the same hostname.
  • go-jose is updated to v4.1.6 for GHSA-mgcc-cww5-fp2q.

The notes warn that these patches may break things if your app relies on the old behavior, and they list what changes. Conflicting client_auth settings for the same hostname are now a Caddyfile error, so a config that loaded yesterday can refuse to load today. That's the right call, because the old behavior could quietly remove an mTLS requirement, but it means a reload can fail. FastCGI requests where the escaped and decoded paths would pick different scripts now get a 400, and so do Windows script paths with a short name or a colon in them. And headers no longer override env values, which is the point of the fix but will surprise anyone who was using a header to set one on purpose.

What I would do: run caddy validate against your config on 2.11.9 before you roll it out, so a client_auth conflict shows up in a terminal and not in a failed reload. If you set HTTP_* values with env for PHP, upgrade first and then check whether any app was reading those values for auth. If you're on 2.11.8 and run WordPress, upgrade today. Plugin maintainers should note that the Caddy team asks you to bump the Caddy dependency in go.mod only if an exported API you use changed. The rest of the day's flagged changes are on /sources/important.

Official notes: Caddy v2.11.9.