Medium

A2A Java SDK send client credentials under server-controlled HTTP header name, enabling leakage via redirect

  • Disclosed: 20.10.2026
  • Updated: 21.10.2026 00:18

Impact

A malicious or compromised A2A agent can cause the client's API key credential to be forwarded to an arbitrary third-party server. The agent serves an AgentCard with an APIKeySecurityScheme specifying a custom header name, then responds with an HTTP redirect. The JDK HttpClient follows the redirect and forwards the custom header containing the credential, since only the standard Authorization header may be stripped on cross-origin redirects.

Where

client/transport/spi/src/main/java/org/a2aproject/sdk/client/transport/spi/interceptors/auth/AuthInterceptor.java:69 in intercept

What

The apiKeySecurityScheme.name() field from the remote agent's AgentCard (untrusted, server-controlled data) is used directly as the HTTP header name when placing client credentials. Combined with JdkA2AHttpClient's followRedirects(NORMAL) policy, credentials under custom header names survive cross-origin redirects (only Authorization is stripped on newer JDKs), allowing a malicious agent to leak client credentials to third-party servers. Additionally, AuthInterceptor does not check that location==HEADER before placing the credential as a header.

Exploit Scenario

  1. The client configures an API key credential for agent's security scheme myAuth.
  2. The malicious agent returns an AgentCard where securitySchemes includes myAuth as APIKeySecurityScheme with name='X-Leaked-Cred' and location=HEADER.
  3. AuthInterceptor places the credential in the X-Leaked-Cred header.
  4. The agent responds with an HTTP 302 redirect to https://evil.com/collect.
  5. JdkA2AHttpClient follows the redirect, forwarding all custom headers including X-Leaked-Cred to evil.com. The attacker captures the client's credential.

Preconditions

  • The client application has configured API key credentials via CredentialService for the agent's security scheme.
  • The agent is malicious or compromised (controls its own AgentCard response).
  • The default JdkA2AHttpClient is used (with followRedirects=NORMAL).
  • The JDK version does not strip custom headers on cross-origin redirects (all current versions).

Fix

Validate the APIKeySecurityScheme.name() field against a whitelist of safe header names. Check that apiKeySecurityScheme.location() equals Location.HEADER before placing the credential as a header. Consider using followRedirects(NEVER) and implementing manual redirect handling that strips all authentication headers on cross-origin redirects.

Verification

2/3 lens verifiers confirmed.

What to do

Validate the APIKeySecurityScheme.name() field against an allowlist of safe header names. Verify that apiKeySecurityScheme.location() equals Location.HEADER before adding credentials as headers. Consider using followRedirects(NEVER) and implementing manual redirect handling that strips all authentication headers on cross-origin redirects. Update to version 1.3.0.Final or later.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) org.a2aproject.sdk:a2a-java-sdk-parent < 1.3.0.Final 1.3.0.Final

References

CVSS score -
CVSS vector
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Weakness (CWE)
CWE-522
Platform
Java / Kotlin (Maven)
Package
org.a2aproject.sdk:a2a-java-sdk-parent
Disclosed
20.10.2026
Updated
21.10.2026 00:18

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-9rhm-2h4x-jwmx - CC BY 4.0

Vulnerability history: org.a2aproject.sdk:a2a-java-sdk-parent

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

This is the only known vulnerability of this package.

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.