Skip to content
Access control Write-up Intermediate

GitHub OAuth Security Issue

GitHub's OAuth App access restrictions had a logic error that allowed third-party OAuth integrations to receive the same permissions as the authorizing user on organization-owned private forks of user-owned parent repositories. An attacker controlling such an integration could therefore read or write those private forks beyond the intended restrictions.

gist.github.com

Published on gist.github.com

Clone this repository at <script src="https://gist.github.com/explodingcamera/57013844da41feea4daa7dae0437d694.js"></script> - Save explodingcamera/57013844da41feea4daa7dae0437d694 to your computer and use it in GitHub Desktop.

The author, on gist.github.com

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 a logic flaw in how OAuth App access restrictions were evaluated for organisation-owned private forks of user-owned parent repositories, causing the integration to inherit the authorizing user's permissions instead of being limited.

Impact

A third-party OAuth integration could have read or written organisation-owned private forks of user-owned repositories, potentially exposing secrets stored there; the text does not say whether any integration actually did so.

What the attacker needed

Organisation enables OAuth App access restrictions; user authorises a third-party OAuth integration; integration has a repo-capable scope; affected repo is an org-owned private fork

The fix

GitHub resolved the error so that private organisation resources are properly protected when OAuth App access restrictions are enabled.

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.

OAuth lets you grant a third-party app limited access to your account. GitHub has a setting that restricts such apps from seeing an organisation's private code. A bug meant that in a specific case (private forks owned by the organisation but originally from a user's repository), the app got the same access as the person who approved it, which was more than intended.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.