Summary
When redirect following is enabled in the Vert.x HTTP client transport, a redirected POST request may be sent to a different authority with the original request headers intact. If that destination is attacker-controlled, credentials and other sensitive headers could be disclosed.
Affected context
The issue occurs in the Vert.x HTTP client transport's POST redirect handling when PostBuilder.followRedirects(true) is enabled. The redirect follower copies the request's headers to the redirected request without stripping credentials or checking whether the destination has the same authority. Other transports in the project are described as stripping Authorization on cross-authority redirects.
Exploit preconditions
- Attack surface: HTTP POST requests made through the Vert.x transport
- Required access: The client must send a request containing credentials or other sensitive headers, and redirect following must be enabled.
- Trigger point: The responding agent returns a 30x redirect with an absolute
Locationpointing to a different authority. - Why exposure is possible: The redirect follower forwards the full header map without checking the destination authority or removing credentials.
Why this happens
The POST redirect handler copies request headers verbatim when constructing the redirected request. This fails to distinguish trusted same-authority redirects from cross-authority ones, leaving credentials such as Authorization and API-key headers attached to a request sent to another host. This is an insufficient protection of credentials, corresponding to CWE-522.
Potential impact
- Bearer, Basic, or OAuth credentials may be disclosed to an attacker-controlled authority.
- API keys and other sensitive request headers could be exposed.
- Exposed credentials could be used to access services or data, depending on their scope and validity.
General mitigation guidance
Defensive patterns include:
- Strip credentials and other sensitive headers on cross-authority redirects, or reject those redirects by default.
- Apply consistent redirect policies across client transports.
- Keep redirect following disabled unless the application requires it, and make opt-in behavior explicit.
- Reduce the sensitivity and scope of credentials sent in requests, and avoid forwarding headers that are not needed at the destination.
- Use least-privilege credentials and limit their validity and authorized destinations where feasible.
How teams detect issues like this
- Review redirect-handling code for copied request headers and missing cross-authority checks.
- Use static analysis or code-review rules to flag redirect followers that forward Authorization, API-key, or other sensitive headers.
- Add tests that verify sensitive headers are removed or redirects are rejected when the authority changes.
- Enforce client policies that restrict redirect destinations and prevent sensitive headers from crossing trust boundaries.

