Summary
A logic error in Outline's OAuth scope validation allows an attacker to bypass intended read-only restrictions by combining a valid scope with the wildcard * scope in a single request.
When this condition is met, a token that should only grant read access can instead gain full API permissions, including write, delete, and administrative operations.
Affected context
This vulnerability occurs in Outline deployments that:
- Use OAuth-based integrations for third-party applications or clients
- Rely on OAuth scopes to differentiate read-only and privileged access
- Run versions where
OAuthInterface.validateScope()validates requested scopes withArray.some()
The issue manifests when a client can specify compound scope strings (such as read *) and the server incorrectly treats the entire request as valid if any individual scope token passes validation.
Exploit preconditions
- Attack surface: OAuth authorization endpoint / token issuance flow exposed to clients.
- Required access: Ability to initiate an OAuth authorization request (e.g., as a normal user or app integrating with Outline).
- Trigger point: Submission of a crafted scope parameter that mixes a valid, restricted scope (like
read) with the wildcard*. - Why exploitation is possible: The
validateScope()function usesArray.some()to check scopes, so it accepts the overall scope request if any element is valid, instead of ensuring that all requested scopes are explicitly allowed. This allows unauthorized, broader scopes to be smuggled in alongside legitimate ones.
Why this happens
The root cause is an authorization logic flaw in the scope validation routine.
Instead of enforcing that every requested scope be individually validated against an allowlist, the implementation uses Array.some()—a construct that returns true if any element matches. This results in partial validation, where the presence of a single valid scope causes the function to accept the entire scope array, including unvalidated or overly broad entries such as *.
Conceptually, this maps to CWE-269: Improper Privilege Management, where the system fails to correctly enforce access constraints derived from OAuth scopes, leading to over-privileged tokens.
Potential impact
- Elevation of read-only OAuth tokens to full-access tokens via scope smuggling.
- Unauthorized write operations on documents and workspaces that should be read-only.
- Deletion of content and potential data loss in shared documentation spaces.
- Unauthorized access to administrative or configuration APIs, depending on how
*is interpreted. - Lateral movement by abusing elevated API access to exfiltrate or manipulate additional resources.
General mitigation guidance
Effective mitigation focuses on tightening authorization semantics around scope handling and avoiding partial validation patterns:
- Ensure scope validation requires all requested scopes to be explicitly allowed (e.g., using constructs equivalent to
Array.every()or per-scope checks). - Normalize and parse scopes into atomic values before validation, avoiding ambiguous or concatenated forms that can conceal
*or other broad scopes. - Treat wildcard scopes (
*) as highly sensitive and either disallow them for external clients or gate them behind explicit, separate administrative flows. - Implement defense-in-depth by enforcing permissions at the resource and operation level, not solely relying on high-level scope strings.
- Apply least-privilege principles to OAuth clients, offering separate, narrowly-scoped tokens for read-only and administrative operations and avoiding scope overloading.
How teams detect issues like this
Detection typically combines code-centric review with runtime monitoring:
- Static analysis / code review: Look for scope validation code that:
- Uses
Array.some()or equivalent "any-match" logic where "all-match" is required. - Accepts mixed-scope strings without splitting and validating each scope individually.
- Treats wildcard scopes specially but does not enforce strict checks or isolation.
- Security tests: Add automated tests in CI that:
- Request combinations like
read *orscope1 scope2 *and assert they are rejected when*is not explicitly allowed. - Verify that tokens issued with restricted scopes cannot access privileged operations.
- Runtime monitoring: Inspect authorization logs and API gateways for:
- Tokens with unexpectedly broad scopes issued to clients normally limited to read-only access.
- Access patterns where read-only clients perform write/delete/admin operations, indicating scope misuse.
- Automated security scanners and SAST tools that reason about authorization logic can be configured to flag "any-scope-accepted" patterns and wildcard scope handling.

