Caddy 2.11.8 upgrade: security fixes and breaking changes
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_SERVICEpermitted (not effective), so packagers can usesetcap cap_net_bind_service=+p. - New
log_leveldirective,{time.now.rfc3339}placeholder,notmatcher for TLS connection policies, andtls()in CEL expressions. - Many reverse proxy,
encode, FastCGI, TLS/ECH, Caddyfile,file_serverandtemplatesfixes. - 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..) get400on every protocol. request_bodymax_sizereturns413as soon asContent-Lengthis over the limit.php_fastcgisites without anindex.php: non-existent paths now go to PHP asindex.phpinstead of returning404.PATH_INFOandDOCUMENT_URInow use the normalized path.- A
try_files/filecandidate ending in/only matches a directory. encodenow compresses even when the request hasCache-Control: no-transform, and always addsVary: Accept-Encodingto responses that could have been encoded.- Stricter config validation. These are now errors: more than one
expressionin a matcher set, unknown TLScurvesorprotocol_min/protocol_maxnames (such asTLS1.3instead oftls1.3), a repeatedsni_regexp, out-of-rangeip_masksizes,basic_authusernames that become identical after placeholder expansion, and ports longer than 11 characters. handle_errorsblocks andvarsnow 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.8after 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: ..returned200on 2.11.7 and400on 2.11.8, matching the release notes. Vary: Accept-Encodingappeared on a normal response after the upgrade (it was absent from the/response in 2.11.7), matching theencodechange.- A request to
/matched myfile {path}/test matcher on 2.11.7 (it returned therespondtext) but fell through tofile_serveron 2.11.8. This fits the trailing-slashfilematcher change, but I did not test it any further. If you usefileortry_fileswith 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.