The destination for the credential response came straight from caller input. Point it at your own server and the signed payload follows.
What goes wrong
In a credential exchange flow, the server posts the result back to a URL, and that URL came from the caller and was used exactly as given. There is no host allowlist and no check that it matches the request that was actually authorized.
Two things go wrong at once. The first is plain SSRF: the caller can aim that POST at an internal service, at loopback, or at the cloud metadata endpoint, using your server as the sender. The second is the payload. The POST body carries the authorization session and the serialized credential response, so the attacker can point it at their own server and collect signed credential material.
The response destination has to be bound to the request that was authenticated, not taken on trust. When it is caller-controlled, the two most sensitive properties of the flow, where it goes and what it carries, are both in the attacker's hands.
The pattern
function finish(requestData, session) {
const dest = requestData.responseUrl; // caller-controlled
post(dest, { session, credential: buildResponse() });
}function finish(requestData, session) {
const dest = session.registeredResponseUrl; // bound at request time
if (!allowlisted(dest)) {
return reject();
}
post(dest, { session, credential: buildResponse() });
}Every gate held. The exploit path was reproduced against a negative control, the impact was calibrated, and the finding was signed report-ready.
Why it matters to you
If any part of a request tells your server where to send the answer, someone will tell it to send the answer to them. This shows up wherever a callback URL or a webhook target rides in on the request. Decide the destination from state you established and trust, then refuse anything else. High severity here because the payload is credential data and the target is arbitrary.
Check your own code
- Find outbound requests whose URL comes from the request body or query string.
- Bind callback and response destinations to server-side state set at request time.
- Allowlist by scheme and host, and block loopback, link-local, and metadata ranges.
- Never send credentials or session tokens to a caller-supplied address.