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

- Severity: Medium 5.5 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.46%, higher than 41% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-03-06T23:40:19.000Z
- Modified: 2026-06-17T10:33:02.100Z
- Also known as: GHSA-m2w3-8f23-hxxf, GO-2026-4644
- Weaknesses: CWE-74, CWE-200
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- caddyserver caddy: >= 2.7.5, < 2.11.2; from 2.7.5 before 2.11.2
- github.com/caddyserver/caddy/v2/modules/caddyhttp (Go): from 2.7.5 before 2.11.2
- github.com/caddyserver/caddy/v2 (Go): from 2.7.5 before 2.11.2

## Every score

- GitHub_M: CVSS:4.0 5.5 Medium `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`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`

## References

- <https://github.com/caddyserver/caddy/security/advisories/GHSA-m2w3-8f23-hxxf> (exploit, advisory, mitigation, vendor-advisory, web)
- <https://github.com/caddyserver/caddy/pull/5408> (fix, issue-tracking, patch, web)
- <https://github.com/caddyserver/caddy/releases/tag/v2.11.2> (product, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-30852> (advisory)
- <https://github.com/caddyserver/caddy> (package)

## Sources

- CVE List: [CVE-2026-30852](https://www.cve.org/CVERecord?id=CVE-2026-30852), CVE Terms of Use, modified 2026-03-09
- GitHub Advisory Database: [GHSA-m2w3-8f23-hxxf](https://github.com/advisories/GHSA-m2w3-8f23-hxxf), CC-BY-4.0, modified 2026-03-23
- Go Vulnerability Database: [GO-2026-4644](https://pkg.go.dev/vuln/GO-2026-4644), CC-BY-4.0, modified 2026-03-23
- NVD: [CVE-2026-30852](https://nvd.nist.gov/vuln/detail/CVE-2026-30852), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-30852 · Whole record: https://cve.day/CVE-2026-30852.json · Rebuilt by cve.day 2026-11-25T22:59:15.483Z
