See https://mailarchive.ietf.org/arch/msg/oauth/K8Wnw08GzPstyAQAh0JmSB47pOQ/, https://datatracker.ietf.org/doc/slides-124-oauth-sessa-browser-swapping/ and https://openid.net/specs/fapi-security-profile-2_0-final.html#name-browser-swapping-attacks
Specifically:
- the
openidc_authorization_response function, in case of state, iss or client_id (?) mismatch, errors out without calling the token endpoint, so the code is still valid (in case it's been somehow intercepted or exfiltrated by an attacker) and can be injected into another session
- in the sample code in the README for how to use the module, in case of error, an error HTTP response is sent back, but this doesn't account for the specific error of a missing
code, which can happen in a response mode downgrade attack where the response mode has been changed somehow by an attacker to fragment; in this case, the code might still be present in the URL, accessible in the browser, and exfiltrable.
See https://mailarchive.ietf.org/arch/msg/oauth/K8Wnw08GzPstyAQAh0JmSB47pOQ/, https://datatracker.ietf.org/doc/slides-124-oauth-sessa-browser-swapping/ and https://openid.net/specs/fapi-security-profile-2_0-final.html#name-browser-swapping-attacks
Specifically:
openidc_authorization_responsefunction, in case ofstate,issorclient_id(?) mismatch, errors out without calling the token endpoint, so thecodeis still valid (in case it's been somehow intercepted or exfiltrated by an attacker) and can be injected into another sessioncode, which can happen in a response mode downgrade attack where the response mode has been changed somehow by an attacker tofragment; in this case, thecodemight still be present in the URL, accessible in the browser, and exfiltrable.