{"id":"CVE-2026-30852","published":"2026-03-07T16:28:26Z","modified":"2026-03-09T18:24:55Z","title":"Caddy: vars_regexp double-expands user input, leaking env vars and files","vendor":"caddyserver","product":"caddy","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:P","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00466,"percentile":0.41262,"provenance":"source"},"cwes":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"},{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"references":[{"url":"https://github.com/caddyserver/caddy/security/advisories/GHSA-m2w3-8f23-hxxf","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/caddyserver/caddy/pull/5408","tags":["x_refsource_MISC"]},{"url":"https://github.com/caddyserver/caddy/releases/tag/v2.11.2","tags":["x_refsource_MISC"]}],"priority":{"score":12.1,"factors":[{"name":"EPSS percentile","points":8.25},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"caddyserver","affectedVersions":[{"vendor":"caddyserver","product":"caddy","versions":[">= 2.7.5, < 2.11.2"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-03-09T18:19:34.437219Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"github.com/caddyserver/caddy/v2/modules/caddyhttp","vulnerableRanges":[">=2.7.5, <2.11.2"],"patched":["2.11.2"],"from":["GHSA-m2w3-8f23-hxxf"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/caddyserver/caddy/v2","vulnerableRanges":[">=2.7.5, <2.11.2"],"patched":["2.11.2"],"from":["GO-2026-4644"],"provenance":"source"}],"summary":{"text":"The vars_regexp matcher in Caddy's server platform, in versions from 2.7.5 up to but not including 2.11.2, double-expands user-controlled input through the Caddy replacer, so a placeholder value supplied in a request is evaluated a second time. An unauthenticated remote attacker with network access to the server can exploit this by sending a crafted request header containing replacer placeholders such as environment or file references, which the server evaluates, exposing environment variables, file contents, and system information.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:57:12Z"},"euvd":{"id":"EUVD-2026-10177","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-27589","published":"2026-02-24","fixed":"2.11.1","kev":false},{"cve":"CVE-2026-27590","published":"2026-02-24","fixed":"2.11.1","kev":false},{"cve":"CVE-2026-30851","published":"2026-03-07","fixed":"2.11.2","kev":false},{"cve":"CVE-2026-30852","published":"2026-03-07","fixed":"2.11.2","kev":false},{"cve":"CVE-2026-45135","published":"2026-06-23","fixed":"2.11.3","kev":false,"link":{"from":"CVE-2026-30852","to":"CVE-2026-45135","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:github.com/caddyserver/caddy/v2","fromFixed":"2.11.2","toFixed":"2.11.3","daysApart":108}]}},{"cve":"CVE-2026-45692","published":"2026-06-23","fixed":"2.11.3","kev":false,"link":{"from":"CVE-2026-30852","to":"CVE-2026-45692","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:github.com/caddyserver/caddy/v2","fromFixed":"2.11.2","toFixed":"2.11.3","daysApart":108}]}},{"cve":"CVE-2026-52844","published":"2026-06-23","fixed":"2.11.4","kev":false}],"package":"Go:github.com/caddyserver/caddy/v2"}}