Vulnerability · Published Mar 7, 2026 · Assigned by GitHub_M

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

Medium 5.5

In plain English

A medium-severity information exposure in caddy from caddyserver. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 41% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)5.5Medium
Exploit odds (30 days)0.5%top 59.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.23caddy2.11.2-r0ALPINE-CVE-2026-30852
Alpine:v3.24caddy2.11.2-r0ALPINE-CVE-2026-30852
Gogithub.com/caddyserver/caddy/v22.11.2GO-2026-4644
Gogithub.com/caddyserver/caddy/v2/modules/caddyhttp2.11.2GHSA-m2w3-8f23-hxxf
Ubuntu:25.10caddyno fix listedUBUNTU-CVE-2026-30852
Ubuntu:26.10caddyno fix listedUBUNTU-CVE-2026-30852

Affected products (as reported)

VendorProductVersions
caddyserver caddy >= 2.7.5, < 2.11.2

Weakness: CWE-200, CWE-74 · 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

References