When you install or authorize an app on a platform like Shopify, Slack etc, you’re redirected to an OAuth authorization URL.
https://example.com/v2/oauth?scope=read,write&redirect_url=https://test.com
We click “Allow” and move on. But most of us don’t check what that scope parameter means. The scope parameter defines what permissions the generated access token will have on the API.
| Scope Value | Token Can Do |
|---|---|
read |
Read-only access to API resources |
read,write |
Read and write access |
read,write,admin |
Full administrative access |
If you request scope=read, the token should only be able to read data. If you request scope=read,write, it should be able to read and modify data. That’s the theory but implementations break. Few years ago someone on Twitter tweeted about testing on oauth scopes sadly i couldn’t find that tweet it was a cool post. Luckily at that time I was already testing an app with OAuth scopes and found few oauth scopes realted vuln. The fact that I found no duplicates confirmed it that people rarely test this stuff, for a few reasons I will explain later.
Not every OAuth implementation is testable. You need programs that:
Note: Creating an app and generating tokens is not always straightforward. You will need to manually read the platform’s developer documentation. There are nuances around redirect URLs, client secrets, authorization flows, and token exchange endpoints that vary per platform. Take the time to understand the target’s OAuth implementation before testing. Because of these hurdles most people don’t bother creating OAuth apps and without creating apps you can’t test permission related issues in Oauth scopes.
When setting up your test OAuth app check if there is multiple oauth scopes because more scopes means more permission to play with if your Oauth app has just read and write permission you might find some Priviledge Escalation but the number of vectors will be limited. The more you can enable disable permissions in your token, the more attack surface you have to work with when testing for scope bypass vulnerabilities.
read, write, delete).write).# Original (after removing write from dev console):
https://example.com/v2/oauth?scope=read&redirect_url=https://yourapp.com
# Modified (adding write back via URL):
https://example.com/v2/oauth?scope=read,write&redirect_url=https://yourapp.com
write permission by performing write operations via the API.
If the API allows write operations with this token that’s a vulnerability. The server trusted the client-supplied scope instead of enforcing the developer configured restrictions.If not all but most OAuth apps display a consent screen to the user that lists what the app will be able to do:
┌─────────────────────────────────────┐
│ "ExampleApp" wants to: │
│ │
│ ✅ Read your profile │
│ ✅ Edit your profile │
│ ✅ Read Write other users profile │
│ │
│ [Allow] [Deny] │
└─────────────────────────────────────┘
The attack:
OAuth scopes are usually object-based each scope corresponds to a specific resource type (e.g: users.read, users.write, teams.read etc).
The attack:
teams.read).team) leaks into API responses from other permitted endpoints.
For example the generated token has users.read permission check whether the /users endpoint response includes nested team objects or references that should be restricted.
// Response from /users — should NOT include team data after teams scope removal
{
"users": [
{
"id": "12345",
"name": "John Doe",
"team": {
// ← This shouldn't be here
"id": "team_99",
"name": "Engineering"
}
}
]
}
If restricted object data appears in other responses that’s a vulnerability.
Some OAuth apps might generate tokens without explicitly configuring granular permissions.
Standard IDOR testing applies to OAuth-scoped tokens:
If anyone tests for OAuth scopes in a different way than what’s covered here and wants to share, please let me know — I’ll update and add those methods as well.
Tried writing for the first time after being lazy about it for so many years, so if there are any errors or something incorrect let me know and I will correct those mistakes.
Ping me on X/Twitter
Happy Hacking and be kind to each other :) :)
Used AI to help structure and clean up this writeup.