Skip to content

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

MediumCVSS 5.5 EPSS 0.47%
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.

PackageAffectedFixed inStatus
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

ProductAffected versionsFixed 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