Caddy 2.11.8 upgrade: security fixes and breaking changes

released
lab run
upgraded from
2.11.7
guest
Debian 13 container
tested
yes, in our lab

Summary

Caddy 2.11.8 is a large patch release from the 2.11 branch. It mixes many bug fixes with security hardening. The maintainers recommend upgrading, especially if you serve PHP or use {host} in file paths. Highlights from the release notes:

  • More fixes for the idle read/write timeouts added in 2.11.6.
  • Caddy can bind privileged ports with only CAP_NET_BIND_SERVICE permitted (not effective), so packagers can use setcap cap_net_bind_service=+p.
  • New log_level directive, {time.now.rfc3339} placeholder, not matcher for TLS connection policies, and tls() in CEL expressions.
  • Many reverse proxy, encode, FastCGI, TLS/ECH, Caddyfile, file_server and templates fixes.
  • Release builds now use Go 1.27 (Go 1.26 is still the minimum to build).

Breaking changes and deprecations

All of this is from the release notes (reported, not all tested by us):

  • Requests with an invalid or dots-only Host (like ..) get 400 on every protocol.
  • request_body max_size returns 413 as soon as Content-Length is over the limit.
  • php_fastcgi sites without an index.php: non-existent paths now go to PHP as index.php instead of returning 404. PATH_INFO and DOCUMENT_URI now use the normalized path.
  • A try_files / file candidate ending in / only matches a directory.
  • encode now compresses even when the request has Cache-Control: no-transform, and always adds Vary: Accept-Encoding to responses that could have been encoded.
  • Stricter config validation. These are now errors: more than one expression in a matcher set, unknown TLS curves or protocol_min/protocol_max names (such as TLS1.3 instead of tls1.3), a repeated sni_regexp, out-of-range ip_mask sizes, basic_auth usernames that become identical after placeholder expansion, and ports longer than 11 characters.
  • handle_errors blocks and vars now follow Caddyfile order, so with overlapping codes or repeated variables a different block or value may win.

Security fixes listed in the notes (reported): Host/:authority path escape with {host} in file paths (GHSA-r766-rf9f-588h), FastCGI SCRIPT_FILENAME normalization (GHSA-f278-mgc7-46j3), file matcher bypass of path rules such as path *.env (GHSA-25cw-38mq-q7m6), double-encoded path info in rewrite (GHSA-69hv-5jfc-mvmv), exposure of the data directory by file_server (GHSA-jf74-f69g-hcj9), an open redirect in php_fastcgi, hidden files shown in browse, hop-by-hop headers in 1xx responses (GHSA-8qx7-j2v2-x6q5), and the query log filter and #.

Tested in our lab

We tested a small setup only: a static site served by file_server with encode gzip and a file matcher, installed from the official Caddy apt repository.

  • Upgrade from 2.11.7 to 2.11.8 with apt-get install caddy=2.11.8 after stopping the service. It started cleanly and stayed active.
  • Site content was unchanged after the upgrade.
  • No warnings or errors in the journal after the upgrade.
  • A request with Host: .. returned 200 on 2.11.7 and 400 on 2.11.8, matching the release notes.
  • Vary: Accept-Encoding appeared on a normal response after the upgrade (it was absent from the / response in 2.11.7), matching the encode change.
  • A request to / matched my file {path}/ test matcher on 2.11.7 (it returned the respond text) but fell through to file_server on 2.11.8. This fits the trailing-slash file matcher change, but I did not test it any further. If you use file or try_files with candidates ending in /, check them.

We did not test PHP/FastCGI, reverse proxy, TLS/ECH, the admin API, timeouts, or plugins.

Lab log

$ apt-get install -y -qq caddy=2.11.7
$ caddy version
v2.11.7 h1:yj0Y4fYZGPkSvibBJ1sTWE33xC0fxztVyXEW5iIdUT4=
$ curl -s -i localhost:8080/
[...]
dir-match
$ curl -s -H "Host: .." -o /dev/null -w "host-dots %{http_code}\n" localhost:8080/
host-dots 200

$ systemctl stop caddy
$ apt-get install -y -qq caddy=2.11.8
Unpacking caddy (2.11.8) over (2.11.7) ...
Setting up caddy (2.11.8) ...
$ systemctl start caddy
$ caddy version
v2.11.8 h1:E2pv1BoZ5bJaWqFkU6QvLa21iGAX8bDzlEQG4dDQ/Vc=
$ systemctl is-active caddy
active
$ curl -s -i localhost:8080/
[...]
Vary: Accept-Encoding
[...]
hello-before
$ curl -s -H "Host: .." -o /dev/null -w "host-dots %{http_code}\n" localhost:8080/
host-dots 400
$ journalctl -u caddy --no-pager -p warning
-- No entries --

Reported by others

We did not look at issues or forum reports for this release. Everything in “Breaking changes” and the security list comes from the official release notes.

Verdict

Upgrade now. The release fixes several path-handling security problems, and our basic upgrade worked without errors. Before you upgrade, check your Caddyfile against the breaking changes. It matters most if you use php_fastcgi, try_files or file with trailing slashes, encode with no-transform, or TLS curves/protocol_min names. Run caddy validate --config /etc/caddy/Caddyfile with the new binary before restarting your service.

sources

other Caddy releases