Arbitrary Code Injection Affecting caddy package, versions <2.11.2-r0


Severity

Recommended
0.0
high
0
10

Snyk's Security Team recommends NVD's CVSS assessment. Learn more

Threat Intelligence

EPSS
0.4% (32nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-MINIMOSLATEST-CADDY-17178458
  • published5 Jun 2026
  • disclosed7 Mar 2026

Introduced: 7 Mar 2026

CVE-2026-30852  (opens in a new tab)
CWE-74  (opens in a new tab)
CWE-200  (opens in a new tab)

How to fix?

Upgrade Minimos:latest caddy to version 2.11.2-r0 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream caddy package and not the caddy package as distributed by Minimos. See How to fix? for Minimos:latest relevant fixed versions and status.

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.

CVSS Base Scores

version 3.1