Weak OAuth, Big Problem: Grafana Login Bypass Explained
A Grafana instance using GitHub OAuth was configured without an organisation restriction, so any GitHub user could log in and obtain a regular user session. The attacker could then view dashboards, metrics and data sources, and create dashboards or alerts.
Free Link
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 Grafana GitHub OAuth configuration omitted the allowed_organizations setting, so no organisation membership check was performed at login.
Impact
An unauthorised user could view internal dashboards, business metrics and data sources that might leak secrets, and could create dashboards or alerts; the text notes that the extent depends on the permissions and sensitivity of the content.
What the attacker needed
Grafana with GitHub OAuth enabled; No organisation restriction configured; A GitHub account
The fix
The GitHub OAuth configuration should restrict logins to the intended organisation, for example by setting allowed_organizations.
How it was found
- Find a Grafana login page that uses GitHub OAuth.
- Use a GitHub account that is not related to the target organisation.
- Authenticate through GitHub.
- Land on the Grafana panel with full user-level access.
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 is a way to log in to a site using another account, such as GitHub. Grafana can be told to accept only GitHub users from a particular company, but that check was left out. As a result, anyone with a GitHub account could sign in and see the dashboards.
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.