Authentication and Authorization Confusion Across Services
The gateway validates a token but a downstream service trusts an unverified identity header supplied by the caller, bypassing authentication.
Failure explanation
A gateway or upstream service authenticates a request, but downstream services incorrectly trust identity or permission information. A common defect is trusting caller-supplied headers such as X-User-ID or X-Role without proving they were inserted by a trusted gateway. Another is forwarding a token with the wrong audience or confusing service identity with end-user identity.
Example
A caller sends X-User-Role: admin directly to a backend endpoint. The backend trusts the header even though the request bypassed the gateway that normally sets it, granting administrative access.
How to test
- Attempt direct backend access where the test environment permits.
- Supply forged identity headers and conflicting claims.
- Test token audience, delegation, service credentials, and end-user context propagation.
- Verify trusted proxy boundaries and header stripping/rewriting.
Expected behavior
Services derive identity and permissions only from authenticated, trusted sources. Caller-controlled identity headers cannot elevate privileges or bypass authorization.
Runnable examples
Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.