Skip to content
OAuth / SSO Write-up Intermediate

CVE-2020-13294

GitLab's OpenID Connect implementation did not revoke authorization codes when a user revoked consent, allowing a malicious service provider to redeem a previously issued code for tokens and restore the revoked consent persistently.

Lauritz Holtmann Follow

Published on security.lauritz-holtmann.de

The following (slightly modified) advisory was sent to GitLab using Hackerone on 19th June 2020.

Lauritz Holtmann (@_lauritz_), on security.lauritz-holtmann.de

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 authorization code issued before consent revocation was not invalidated, and the revoked application's permissions were not properly removed from the database.

Impact

A malicious service provider could obtain sensitive data and bearer tokens without the user's consent, and could persistently restore the revoked consent, leading to future access to resources and information.

What the attacker needed

GitLab configured as OpenID Connect Identity Provider; User has previously given consent to the service provider; Attacker controls a malicious service provider

The fix

The issue was fixed in GitLab 13.2.3, 13.1.6 and 13.0.12 by invalidating all tokens and codes issued for a client when an end-user revokes permissions.

How it was found

  1. Start an OpenID Connect login flow from a service provider.
  2. Intercept the token request and save it for later use.
  3. Revoke the application's authorization in GitLab.
  4. Send the saved token request to GitLab's token endpoint.
  5. Observe that fresh tokens and an id_token are returned.
  6. Refresh the applications overview and see the revoked authorization reappear.

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 use 'Log in with GitLab' on another website, GitLab asks for your permission to share your details. If you later change your mind and revoke that permission, GitLab should stop sharing. This report shows that a malicious website could still get your details and even make the permission come back, because GitLab did not cancel a temporary login code.

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.

More by Lauritz Holtmann

View all

7 more disclosed reports, best first.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

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.