[Meetup][World ID][OIDC] Insufficient Filtering of "state" Parameter in Response Mode form_post leads to XSS and ATO
The OIDC authentication flow did not properly validate the 'state' parameter when using form_post response mode, allowing HTML injection into the response body. An attacker could craft a link that, when clicked, would exfiltrate the victim's access token to an attacker-controlled site, leading to account takeover.
- Triaged in under an hour
- Fixed in 5 days
- Paid in 32 hours
- Disclosed after 28 days
Summary by the program
A lack of proper validation in the state parameter of the World ID OIDC authentication logic allowed the injection of HTML characters into the response body when using form_post as the OIDC response mode. This vulnerability could enable attackers to obtain access tokens from targeted users with minimal user interaction. Additionally, an XSS vulnerability was identified in the same parameter but was mitigated by our Content Security Policy (CSP).
The researcher was able to demonstrate this vulnerability by injecting a button that, when clicked, would direct users to an attacker-controlled site. Since the access token is included in the form HTML, clicking the button would include it in the request, exposing the user's access token.
A bounty of $7,000 was awarded as part of a HackerOne event.
Summary by the researcher
A blog post about this report including technical details can be found here: https://security.lauritz-holtmann.de/advisories/tfh-form_post-xss-ato/
I would like to especially thank Ian and Juan of Tools for Humanity for their continuous support throughout and after the meetup. 😊
Join your local H1 Community!
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
Likely the application failed to sanitise or validate the 'state' parameter before embedding it in the HTML form used for form_post response mode.
Impact
An attacker could obtain a victim's access token with minimal user interaction, leading to account takeover; a separate XSS in the same parameter was mitigated by the Content Security Policy.
What the attacker needed
Victim clicks a crafted link; OIDC response mode set to form_post
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 you log in using a service like 'Sign in with World ID', the website sends a 'state' value to prevent cross-site request forgery. This report found that the state value was not properly checked, so an attacker could put HTML code in it. That HTML could include a button that, when clicked, sends the user's access token (a secret key that proves who they are) to the attacker, letting the attacker take over the account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.