CVE-2026-30852

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

HIGH
7.5
CVSS Score
Published: March 7, 2026 at 04:28 PM UTC
Updated: June 17, 2026 at 10:33 AM UTC
1 product affected across 1 vendorCaddy

Using caddy by caddyserver?

Get instant alerts when new vulnerabilities affect caddy - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.5
Exploit prediction
EPSS 0.4%
SSVC
PoC

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 2.11.22.7.5 ≤ v < 2.11.2
Affected range stops below 2.11.2, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (3)

x_refsource_CONFIRMExploitMitigationVendor Advisory
Source: cverecord
https://github.com/caddyserver/caddy/security/advisories/GHSA-m2w3-8f23-hxxf
x_refsource_MISCIssue TrackingPatch
Source: cverecord
https://github.com/caddyserver/caddy/pull/5408
x_refsource_MISCProductRelease Notes
Source: cverecord
https://github.com/caddyserver/caddy/releases/tag/v2.11.2

SSVC — Action Prioritization

SSVCPoCAutomatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusANALYZED
CWE
CWE-200CWE-74

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card