p PatchFirst

CVE-2026-30852

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

CVSS 5.5 · Medium · EPSS 0.5% · Fix available

Compare with your installed version

Affected products and known fixed versions are public information. Compare them with your installed version.

  • caddyNo fix published
  • caddy Alpine 3.23Update to 2.11.2-r0
  • caddy Alpine 3.24Update to 2.11.2-r0
  • caddy Ubuntu Pro 24.04 LTSNo fix published
  • and 3 more

Check the installed version:

apk list -I -o caddy
dpkg-query -W -f='${source:Package} ${binary:Package} ${Version}\n' | awk '$1=="caddy"'

Assess your server’s risks

The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.

Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.

curl -fsSL https://patchfirst.dev/check.sh | sh
Check your server for free →

Channels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.

This page contains facts from public vulnerability sources. Check the original advisory before updating.

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.

Published
Updated

Fixes in distributions

Stack: system

Affected products and versions

  • caddy

    Versions
    • >= 2.7.5, < 2.11.2: Affected

    No fix published

  • caddy Alpine 3.23

    Affected ranges
    • ECOSYSTEM: ≥ 2.7.5, < 2.11.2-r0

    Update to 2.11.2-r0

  • caddy Alpine 3.24

    Affected ranges
    • ECOSYSTEM: ≥ 2.7.5, < 2.11.2-r0

    Update to 2.11.2-r0

  • caddy Ubuntu Pro 24.04 LTS

    Versions
    • 2.6.2-6
    • 2.6.2-6ubuntu0.24.04.1
    • 2.6.2-6ubuntu0.24.04.2
    • 2.6.2-6ubuntu0.24.04.2+esm1
    • 2.6.2-6ubuntu0.24.04.3
    • 2.6.2-6ubuntu0.24.04.3+esm1
    All versions (7)
    • 2.6.2-6ubuntu0.24.04.3+esm2
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • caddy Ubuntu 25.10

    Versions
    • 2.6.2-9
    • 2.6.2-11
    • 2.6.2-12
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • caddy Ubuntu 26.10

    Versions
    • 2.6.2-14
    • 2.11.4-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • caddy Ubuntu Pro 26.04 LTS

    Versions
    • 2.6.2-12
    • 2.6.2-14
    • 2.6.2-14ubuntu0.26.04.1~esm1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →