Summary
OpenAM's OAuth 2.0 device authorization flow may be vulnerable to cross-site request forgery when consent is skipped for implied-consent clients. If a logged-in user is lured to a crafted page, an attacker may cause the user to approve a device authorization and obtain tokens that can be used to access APIs as that user.
Affected context
The issue concerns OpenAM's OAuth 2.0 device authorization flow, specifically configurations where consent is skipped for implied-consent clients. Risk depends on the flow accepting a forged browser request in a logged-in user's session and issuing tokens after the resulting device authorization is approved.
Exploit preconditions
- Attack surface: OpenAM's OAuth 2.0 device authorization flow
- Required access: The victim must be logged in to OpenAM; the attacker must be able to initiate a device authorization
- Trigger point: The victim visits an attacker-controlled or crafted page while authenticated
- Why exploitation is possible: The flow may accept a cross-origin request that causes the victim's session to approve a device code when consent is skipped for an implied-consent client
Why this happens
The issue is a cross-site request forgery weakness, mapped to CWE-352. A state-changing authorization action may rely on the browser's ambient authenticated session without sufficiently verifying that the request was intentionally initiated by the user. In the affected consent scenario, a forged request can result in approval of a device authorization.
Potential impact
- An attacker may obtain access and ID tokens associated with the victim
- Tokens could allow API calls with the victim's privileges
- The victim's account may be used for unauthorized actions permitted by those tokens
General mitigation guidance
Defensive patterns include requiring an explicit, verifiable user action before approving device authorizations and ensuring state-changing requests are protected against cross-origin forgery. Apply robust request-origin or anti-CSRF protections, avoid implicitly trusting browser-submitted authorization actions, and use least-privilege scopes and token lifetimes to limit potential exposure.
How teams detect issues like this
Review device authorization handlers for state-changing operations that accept browser requests without effective CSRF protections. Examine consent-skipping paths for implied-consent clients and check whether requests are bound to an intentional user action and the expected authorization transaction. Static analysis, code review, and policy checks can flag missing anti-CSRF controls or unsafe cross-origin request handling.

