CVE-2026-30852: Caddy: vars_regexp double-expands user input, leaking env vars and files

CVE-2026-30852 affects 14 listed versions of Caddy in the Dawnsentry catalogue.

7.5CVSS high
Proof of concept publicexploitation
under 1%EPSS (next 30 days)
7 March 2026published

Affected products and versions

The versions in the Dawnsentry catalogue this CVE affects, judged from the vendor's own advisory where there is one, otherwise from the CVE record and NVD, as each version's own page says.

Caddy

14 of 58 listed versions are affected. Fixed in 2.11.2. The newest release, 2.11.9, is not affected.

2.11.1 2.11.0 2.10.2 2.10.1 2.10.0 2.9.1 2.9.0 2.8.4 2.8.3 2.8.2 2.8.1 2.8.0 2.7.6 2.7.5

What it is

Caddy is an extensible server platform that uses TLS by default. From version 2.7.5 to before version 2.11.2, the vars_regexp matcher in vars.go:337 double-expands user-controlled input through the Caddy replacer. When vars_regexp matches against a placeholder like {http.request.header.X-Input}, the header value gets resolved once (expected), then passed through repl.ReplaceAll() again (the bug). This means an attacker can put {env.DATABASE_URL} or {file./etc/passwd} in a request header and the server will evaluate it, leaking environment variables, file contents, and system info. This issue has been patched in version 2.11.2.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N (NVD)

Published by GitHub on 7 March 2026. Last changed 17 June 2026.

Sources

Check one version you run: look CVE-2026-30852 up, or pick a product and version in the quick lookup.

Updated 2 December 2026.