Summary
OpenAM's OAuth token handling can accept attacker-controlled data from the Core Token Store (CTS) as OAuth token claims without adequately binding the record to a trusted token type or verifying its integrity. If an attacker can write controlled data to CTS under a known token identifier, the flaw may let them create OAuth bearer tokens and OpenID Connect ID tokens with chosen claims; it does not by itself create an OpenAM SSO session or grant console access.
Affected context
The issue occurs in OpenAM's OAuth token store and adapter when they retrieve caller-supplied token identifiers from CTS without an OAuth-only namespace and accept records based on BLOB contents without trusted type binding or integrity verification. Exploitation depends on an attacker being able to place controlled JSON in CTS under a known identifier. In an enabled realm, Push Registration followed by an anonymous SNS callback may provide a route to do so.
Exploit preconditions
- Attack surface: OpenAM OAuth token retrieval and CTS-backed token handling.
- Required access: A way to place controlled JSON in CTS under a known token identifier; the described Push Registration and anonymous SNS callback path may enable this in a realm where it is configured.
- Trigger point: OAuthAdapter reads and accepts the corresponding CTS row as an OAuth token.
- Why exploitation is possible: The lookup lacks an OAuth-only namespace, and the adapter does not sufficiently bind the row to a trusted CTS type or verify its integrity.
Why this happens
The token store accepts identifiers that are not isolated to an OAuth-specific namespace, while the adapter trusts a row's BLOB contents as OAuth claims without adequately verifying the record's trusted type or integrity. This is an authorization weakness consistent with CWE-639: Authorization Bypass Through User-Controlled Key: a caller-influenced identifier can select data that is then treated as an authorized token. The insecure pattern is using a user-controlled lookup key to retrieve security-sensitive data without strong namespace separation and validation.
Potential impact
- An attacker may mint OAuth bearer tokens with chosen subject, client, realm, and scope claims.
- An attacker may mint OpenID Connect ID tokens with chosen claims.
- Services that trust the forged tokens could grant access according to those claims.
- The flaw does not, by itself, create an OpenAM SSO session or grant console access.
General mitigation guidance
Defensive patterns include separating token records into OAuth-specific namespaces and binding each record to a trusted token type and integrity check before use. Treat identifiers and CTS contents as untrusted, validate token claims and context against trusted server-side state, and restrict who and what can write to CTS. Secure-by-default callback authentication and configuration, along with least-privilege access to token storage, can reduce exposure if a write path is available.
How teams detect issues like this
- Use static analysis and code review to find token lookups keyed by caller-supplied identifiers without namespace or ownership checks.
- Review adapters and deserialization paths for acceptance of security claims without trusted type binding or integrity verification.
- Audit CTS write permissions and enabled callback flows, including whether anonymous callbacks can result in token-store writes.
- Apply policy checks that require integrity validation and context binding for token records; automated code review tools may help identify these patterns.

