CVE-2026-30852 Caddy: vars_regexp double-expands user input, leaking env vars and files
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: yes · technical impact: partial
- Technology
- UbuntuDebian
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.
Upgrade path
8 packages: 5 fixed, 3 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| ubuntu/caddy(Ubuntu 24.04) | All versions | No fix listed | No fix yet |
| ubuntu/caddy(Ubuntu 26.04) | All versions | No fix listed | No fix yet |
| ubuntu/caddy(Ubuntu 26.10) | All versions | No fix listed | No fix yet |
| alpine/caddy(Alpine v3.23) | >= 2.7.5, < 2.11.2-r0 | 2.11.2-r0 | Fixed |
| alpine/caddy(Alpine v3.24) | >= 2.7.5, < 2.11.2-r0 | 2.11.2-r0 | Fixed |
| caddyserver github.com/caddyserver/caddy | = >= 2.7.5, < 2.11.2; >= 2.7.5, < 2.11.2 | 2.11.2 | Fixed |
| caddyserver github.com/caddyserver/caddy(Go) | >= 2.7.5, < 2.11.2 | 2.11.2 | Fixed |
| caddyserver github.com/caddyserver/caddy/v2/modules/caddyhttp(Go) | >= 2.7.5, < 2.11.2; >= 2.7.5, <= 2.11.1 | 2.11.2 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| caddyserver github.com/caddyserver/caddy/v2/modules/caddyhttp(Go) | >= 2.7.5, < 2.11.2 | 2.11.2 |
| caddyserver github.com/caddyserver/caddy(Go) | >= 2.7.5, < 2.11.2 | 2.11.2 |
| caddyserver github.com/caddyserver/caddy | = >= 2.7.5, < 2.11.2 | No fix listed |
| caddyserver github.com/caddyserver/caddy/v2/modules/caddyhttp(Go) | >= 2.7.5, <= 2.11.1 | No fix listed |
| alpine/caddy(Alpine:v3.23) | >= 2.7.5, < 2.11.2-r0 | 2.11.2-r0 |
| alpine/caddy(Alpine:v3.24) | >= 2.7.5, < 2.11.2-r0 | 2.11.2-r0 |
| ubuntu/caddy(Ubuntu:24.04) | All versions | No fix listed |
| ubuntu/caddy(Ubuntu:26.04) | All versions | No fix listed |
| ubuntu/caddy(Ubuntu:26.10) | All versions | No fix listed |
| caddyserver github.com/caddyserver/caddy | >= 2.7.5, < 2.11.2 | 2.11.2 |
References
- https://github.com/caddyserver/caddy/security/advisories/GHSA-m2w3-8f23-hxxf exploit mitigation vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- https://github.com/caddyserver/caddy/pull/5408 issue-tracking patch
- github.com product
- https://github.com/caddyserver/caddy/releases/tag/v2.11.2 product release-notes
- github.com
- security.alpinelinux.org vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- www.cve.org
- Debian Security Tracker CVE-2026-30852 vendor-advisory