Issuer not verified from obtained token in user_oidc
The user_oidc app did not verify that the issuer of an OIDC token matched the issuer discovered during the OIDC discovery phase. An attacker able to intercept traffic could therefore present a token from a different issuer and have it accepted.
- Triaged in under an hour
- Fixed in 16 days
- Paid in 22 days
- Disclosed after 2 months
Summary by the program
https://github.com/nextcloud/security-advisories/security/advisories/GHSA-xx3h-v363-q36j
The report
As per OIDC spec the issues of the token should be verified to match the issuer obtained in the discovery phase. https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation (step 2)
Very similar to the aud check in https://github.com/nextcloud/user_oidc/blob/main/lib/Controller/LoginController.php
There are some more steps in that document that I don't think are currently implemented correctly. However I do not have an OIDC setup to check/verify. So might be worth it to have a look.
Impact
Without verifying the issuer a MITM is possible.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application did not compare the token's issuer claim against the issuer obtained during OIDC discovery, as the OIDC specification requires.
What the attacker needed
Attacker in MITM position; OIDC login flow in use
The fix
The token's issuer claim should be validated against the discovery issuer, similar to the existing audience check.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a website lets you log in through an identity provider, it first fetches that provider's details, including its official name (the issuer). The app then receives a token saying who issued it, but it never checked that this name matched the one it fetched. Someone sitting between the user and the server could swap in a token from a provider they control.
What is OAuth / SSO?
Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.