OAuth Scope Misconfiguration and API Access

x32x01
  • by x32x01 ||
OAuth Scope Misconfiguration and API Access
OAuth scopes are supposed to limit what an application can access after a user grants permission. But what happens when an access token issued with identity-only scopes can also read sensitive data from a REST API?
This scenario demonstrates a potential Broken Access Control issue caused by improper OAuth scope enforcement, where an application authorized with openid profile email could access additional API resources that were not disclosed on the consent screen.



🔎 How the OAuth Authorization Flow Worked​


1. Identity-Only OAuth Scopes​

The application requested authorization using the following scopes: openid profile email
On the consent screen, the user was told: “Read your full name and email address.”
This suggested that the application only needed access to basic profile information, such as the user's name and email address.
After the user approved the request, the application received an Authorization Code and exchanged it for an Access Token through:
POST /trust/oauth/token
The returned token was associated with the requested identity scopes, which was the expected behavior at this stage.

2. Broken Access Control: Improper Scope Enforcement​

The issue appeared when the identity-only Access Token was used against REST API endpoints instead of being limited to identity-related resources.
Despite being issued with identity scopes, the token could read additional resources through several API endpoints, including:
  • /api/v2/projects
  • /api/v2/flags/default
  • /api/v2/members
  • /api/v2/tokens
  • /api/v2/integrations
  • /api/v2/webhooks
  • /api/v2/projects//environments//sdk-keys
The tested requests returned 200 OK, indicating that the API accepted the token and returned the requested data.



🚨 Why Is This a Security Vulnerability?​

OAuth scopes are intended to restrict what an application can access. In this case, there was a mismatch between the permissions presented to the user and the access actually granted by the API.
An application authorized with identity-only scopes could potentially access additional resources, including:
  • Project information and configurations.
  • API token metadata.
  • Webhooks and integrations.
  • Environment SDK keys.
  • Team members' information, email addresses, and roles.
This creates a Broken Access Control vulnerability and potentially an OAuth scope enforcement failure, allowing an application to access data beyond what the user was led to expect when granting authorization.
P1.webp
 
Similar threads
x32x01
Replies
0
Views
236
x32x01
x32x01
x32x01
Replies
0
Views
110
x32x01
x32x01
x32x01
Replies
0
Views
143
x32x01
x32x01
x32x01
Replies
0
Views
166
x32x01
x32x01
x32x01
Replies
0
Views
248
x32x01
x32x01
Register & Login Faster
Forgot your password?
Forum Statistics
Threads
1,254
Messages
1,262
Members
20
Latest Member
cositaricagerra
Back
Top