Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

fideloper/trustedproxy
master @ a751f2b
4
Fixes
0
CVEs
HIGH
Peak severity
Highlights
Auth Bypass: 3 prior fixes. Scrutinize any change in this area.
src/TrustProxies.php: most-fixed (2 issues). Treat as high-risk during review.
2 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Auth Bypass: Flaws in translating user-configured trusted proxy headers into bitmask integers allow malicious actors to inject custom headers (e.g., X-Forwarded-For). When null headers intended for disabling trust are ignored, or when configuration arrays are incorrectly processed instead of bitfields, the application may trust unvalidated headers and bypass upstream authentication controls.
IP Address Spoofing: A switch-case fallthrough logic bug in the middleware's configuration processing causes the system to trust all X-Forwarded headers (equivalent to HEADER_X_FORWARDED_ALL) even when a developer explicitly configures only a restricted subset of headers to be trusted.
Auth Bypass: When 'trust all proxies' is configured, failing to evaluate the entire proxy chain instead of only the immediate connecting IP can result in incorrect trust propagation, leading to authentication bypasses if client IPs are incorrectly resolved.