Caddy: vars_regexp double-expands user input, leaking env vars and files
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- Low · None · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-200.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| caddyserver | caddy | 2.7.5 to before 2.11.2 | 2.11.2 | Patch available | CNA |
| — | github.com/caddyserver/caddy/v2/modules/caddyhttp (Go) | 2.7.5 to before 2.11.2 | 2.11.2 | Patch available | GHSA-m2w3-8f23-hxxf |
- caddy Vendorcaddyserver Affected 2.7.5 to before 2.11.2 Fixed in 2.11.2 Patch available CNA
- github.com/caddyserver/caddy/v2/modules/caddyhttp (Go) Vendor— Affected 2.7.5 to before 2.11.2 Fixed in 2.11.2 Patch available GHSA-m2w3-8f23-hxxf
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:caddyserver:caddy:*:*:*:*:*:*:*:* | 2.7.5 to before 2.11.2 | Vulnerable | caddyserver |
- cpe:2.3:a:caddyserver:caddy:*:*:*:*:*:*:*:* Versions 2.7.5 to before 2.11.2 Vulnerable ·caddyserver
Remediation
- Fix · CNA caddy (caddyserver) Fixed in 2.11.2
- Fix · GHSA-m2w3-8f23-hxxf github.com/caddyserver/caddy/v2/modules/caddyhttp (Go) Fixed in 2.11.2 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2026-30852
- 2026-10-03 Alias added: GHSA-m2w3-8f23-hxxf
References
More caddyserver Caddy vulnerabilities
- TI-2023-23979 The HTTP/2 protocol allows a denial of service (server resource consumption) because… KEVCVSS 3.1HIGH 7.5
- TI-2026-21978 Improper input validation in caddyserver caddy CVSS 4.0HIGH 8.9
- TI-2026-21974 Caddy's mTLS client authentication silently fails open when CA certificate file is missing or malformed CVSS 4.0HIGH 8.8
- TI-2026-23680 Improper authentication in caddyserver caddy CVSS 3.1HIGH 8.8
- TI-2026-21976 Caddy: MatchHost becomes case-sensitive for large host lists (>100), enabling host-based route/auth bypass CVSS 4.0HIGH 7.7
- TI-2026-21975 Caddy: MatchPath %xx (escaped-path) branch skips case normalization, enabling path-based route/auth bypass CVSS 4.0HIGH 7.7
Sources
- CVE-2026-30852 · CVE Program
- CVE-2026-30852 · NVD
- FIRST EPSS
- GHSA-m2w3-8f23-hxxf · GitHub Advisory Database · CC BY 4.0
- CVE-2026-30852 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences