OpenAM's OAuth 2.0 device authorization flow — used to sign in devices such as TVs and command-line tools by entering a user code — does not protect the step that approves a device against cross-site request forgery when consent is skipped for the client. A link or page on another site can cause a logged-in user's browser to approve a device code without the user seeing a form or making a decision.
The issue applies only where the OAuth 2.0 provider allows clients to skip consent (off by default) and the client is configured with implied consent.
Technical details are deliberately withheld for now, to give operators time to upgrade to OpenAM 16.1.4.
An attacker who can start a device authorization for an OAuth 2.0 client that is allowed to skip consent — any such client in the realm, and with no secret where the client is public — can obtain access and ID tokens for any user who is logged in to OpenAM and opens a link or page prepared by the attacker. The tokens carry every scope granted to that client, so the attacker can read the user's profile claims and call the APIs available to those scopes as that user, until the tokens expire or are revoked.
OpenAM 14.5.1 up to and including 16.1.3. Earlier releases do not skip consent in the device flow.
Fixed in OpenAM 16.1.4. Approving a device code now always requires a CSRF token and a user code typed by the user.
Upgrade note: customised copies of the device flow user code page must be updated to carry the CSRF token, as described in the upgrade guide, or every user code submitted through them will be refused. Links or QR codes that open the verification page with the user code already filled in will lead to an empty form instead, and the consent decision is accepted only from the request body, on the device verification page and the authorization endpoint alike. Clients that submit the user code without the page must send the CSRF token as documented.
Until 16.1.4 is deployed:
Turn off "Allow clients to skip consent" in the OAuth 2.0 provider settings of every realm that does not need it. This closes the issue for that realm.
Where skipping consent is required, grant implied consent only to first-party confidential clients whose credentials are held by the deployment itself, never to public clients. Restricting a client's grant types does not keep it out of the device flow.
Block the device flow endpoints ( /oauth2/device/code and /oauth2/device/user ) at the reverse proxy if the device flow is not used.
Review issued tokens for clients with implied consent and revoke any that do not correspond to devices users actually approved.
Reported by @santhreal .
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
