The Cause of the Sign in with Apple Zero-Day
Apple's Sign in with Apple consent form did not validate the email address submitted by the client, allowing an attacker to replace their own email with a victim's email. This caused Apple to issue a JWT containing the victim's email, which some applications used to identify users, enabling account takeover.
aaronparecki.com
Published on aaronparecki.com
Last week, a security researcher discovered and disclosed a zero-day bug in Sign In with Apple, and collected a $100,000 bounty.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server-side code that processed the consent form accepted the email address value from the client without verifying it matched one of the user's registered emails or the generated proxy address.
Impact
An attacker could take over accounts on third-party applications that use only the email claim from the Sign in with Apple JWT to identify users; Apple's own applications may also have been affected, as suggested by the bounty amount.
What the attacker needed
Attacker has an Apple ID; Attacker can intercept own requests; Victim's email address is known; Target app uses email claim for identification
The fix
The server should either send opaque values (like 'real_email' or 'proxy_email') and resolve the actual email server-side, or validate that the submitted email matches one already on the user's account.
How it was found
- Start signing in to an application with Sign in with Apple.
- Intercept the request sent when submitting the consent form.
- Replace the email value with the victim's email address.
- Submit the modified request to Apple.
- Apple generates a JWT containing the victim's email.
- The application receives the JWT and, if it uses only the email to identify the user, logs the attacker in as the victim.
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 write-up has not been written yet. The Original tab links to the source.
When you sign in with Apple, you choose whether to share your real email or a hidden one. The form that sends this choice to Apple could be tampered with, so an attacker could put someone else's email in the request. Apple would then create a login token with that wrong email, and apps that trust the email could log the attacker in as the victim.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.