High severity · published Mar 7, 2026
CVE-2026-30852
Caddy: vars_regexp double-expands user input, leaking env vars and files
7.5
CVSS
0.4%
EPSS
No
On KEV
Description
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 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
High
Integrity
None
Availability
None
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.4% · higher than 38% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
CA
caddy · caddyserver
>= 2.7.5, < 2.11.2 · source: vendor, NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2026-30852
CVE.org
https://www.cve.org/CVERecord?id=CVE-2026-30852
Issue Tracking
https://github.com/caddyserver/caddy/pull/5408
Product
https://github.com/caddyserver/caddy/releases/tag/v2.11.2
Exploit
https://github.com/caddyserver/caddy/security/advisories/GHSA-m2w3-8f23-hxxf
More from caddy
7.5
CVE-2023-44487
HTTP/2 Rapid Reset Attack Vulnerability
9.8
CVE-2026-27590
Caddy: Unicode case-folding length expansion causes incorrect split_path index (SCRIPT_NAME/PATH_INFO confusion) in FastCGI transport
9.8
CVE-2018-21246
Caddy before 0.10.13 mishandles TLS client authentication, as demonstrated by an authentication bypass caused by the lack of the StrictHostMatching mode
9.1
CVE-2026-27588
Caddy: MatchHost becomes case-sensitive for large host lists (>100), enabling host-based route/auth bypass
9.1
CVE-2026-27587
Caddy: MatchPath %xx (escaped-path) branch skips case normalization, enabling path-based route/auth bypass
