Summary
The A2A Java HTTP client does not apply its redirect protections to GET, asynchronous SSE GET, or DELETE requests. When an application uses a redirect-capable client and sends one of these requests with an allowlisted custom credential header, a cross-authority redirect may forward that credential to the redirect destination.
Affected context
The issue occurs in the core JDK HTTP client when an application injects an HttpClient configured to follow redirects, such as Redirect.NORMAL or Redirect.ALWAYS. The SDK's redirect handling covers the POST path but not JdkGetBuilder.get(), JdkGetBuilder.getAsyncSSE(), or JdkDeleteBuilder.delete(). Risk depends on whether credentialed requests can be directed to a response that redirects to another authority.
Exploit preconditions
- Attack surface: Credentialed GET, asynchronous SSE GET, or DELETE requests made through the affected client.
- Required access: The ability to influence a response or destination so the request encounters a cross-authority redirect; this may depend on the application's request and service trust boundaries.
- Trigger point: The injected redirect-capable
HttpClientfollows a redirect during one of the uncovered request paths. - Why exploitation is possible: The redirect gate is not applied to these paths, and the JDK may forward the allowlisted custom credential headers to the redirected authority.
Why this happens
This is an incomplete redirect-protection fix. The client applies redirect neutralization to POST requests but calls the injected HttpClient directly for GET, asynchronous SSE GET, and DELETE. When that client follows a cross-authority redirect, custom credential headers such as X-API-Key, API-Key, X-Auth-Token, and X-Authentication may be forwarded. This is a credential-protection weakness associated with CWE-522.
Potential impact
- An attacker-controlled redirect destination may receive forwarded custom credentials.
- Exposed credentials could be used to access services or resources within their authorized scope.
- Credential exposure could lead to further compromise if the same credentials are accepted by other systems.
General mitigation guidance
Common defensive patterns include applying consistent redirect controls to every HTTP method and request path, rather than protecting only POST requests. Cross-authority redirects can be rejected by default or handled through explicit, narrowly scoped trust decisions. Applications can also avoid attaching credentials to requests whose destinations are not trusted, minimize the use and scope of custom credentials, and use clients and service identities with least privilege.
How teams detect issues like this
Review HTTP client wrappers and builder methods for inconsistent redirect handling across methods, including GET, streaming GET, and DELETE. Static analysis and code review can flag direct use of redirect-capable clients for credentialed requests, as well as custom credential headers that are not reconsidered when destinations change. Tests and policy checks can verify that cross-authority redirects are rejected or that sensitive headers are removed before following them. Automated code review tools may help identify gaps across request paths.

