How Sigstore quickly patched an upstream vulnerability
Dex, the identity provider used by Sigstore, used a predictable request ID that an attacker could guess to fetch an OAuth code before the victim's browser, allowing the attacker to obtain the victim's identity token. The attack required a phishing campaign to direct the victim to a malicious site that initiated the login flow.
Published on blog.sigstore.dev
On October 3, 2022, Dex, the federated identity provider that Sigstore uses to issue identity tokens, published CVE-2022-39222 with a GitHub Security Advisory. Sigstore was vulnerable to this CVE, but we were able to quickly mitigate the vulnerability in June before an official fix was published.
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
The request ID used to look up the OAuth code was predictable, allowing an attacker to guess it and retrieve the code before the legitimate user.
Impact
An attacker could obtain a user's identity token, potentially allowing them to impersonate the user, though the attack required a phishing campaign and a race condition.
What the attacker needed
Victim clicks a link; attacker can initiate login requests; attacker can race the victim's browser
The fix
The /approval endpoint was fixed by requiring an HMAC (a message authentication code) that only the legitimate redirect from the federated connector could provide, so attacker requests would be rejected.
How it was found
- Victim navigates to a malicious website.
- The malicious webserver initiates a connection with a Dex instance for a specific federated connector.
- Dex returns a redirect to the federated connector, and the attacker records the state parameter value.
- The malicious website redirects the victim's browser to the federated connector.
- The user authenticates to the connector.
- While the user authenticates, the malicious webserver repeatedly requests the /approval endpoint with the recorded state; if it calls before the victim's browser, it obtains the OAuth code.
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 log in to a website using another service like Google, a temporary code is created that proves who you are. The bug was that this code could be guessed or stolen by someone who tricked you into starting a login. They could then use the code to pretend to be you.
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.