Summary
Pocket ID accepts a client-controlled resource value when creating an access token and places it in the token's audience claim without checking whether that audience is authorized for the client. An authenticated OIDC client may obtain a Pocket ID-signed token that appears valid to a resource server trusting that audience, potentially bypassing service-to-service access controls.
Affected context
The issue affects Pocket ID deployments using the OIDC client-credentials flow in the affected component. It becomes exploitable when an authenticated client can request a token with an arbitrary resource audience and a resource server relies on Pocket ID tokens or introspection for authorization. Deployments that do not use these tokens for resource-server authorization have no immediate exploitable impact.
Exploit preconditions
- Attack surface: OIDC client-credentials token issuance and the token introspection endpoint
- Required access: An authenticated OIDC client able to request a token
- Trigger point: Token creation with a client-controlled resource parameter, followed by use at a resource server
- Why exploitation is possible: The requested audience is embedded in the signed token without checking that it is registered or authorized for the requesting client; introspection may treat the token as active when the introspecting client matches that audience
Why this happens
The token-creation logic trusts a client-controlled resource value when assigning the access token's audience claim. Because it does not validate that the audience is registered and permitted for the requesting client, a client can obtain a signed token that names another client or an arbitrary audience. This is an authorization failure mapped to CWE-863: Incorrect Authorization, with insufficient validation of the supplied value also relating to CWE-20: Improper Input Validation.
Potential impact
- A resource server may accept a token for an audience the requesting client is not authorized to access.
- An attacker could gain unauthorized access to data or service actions.
- Service-to-service authorization boundaries may be weakened where resource servers trust these tokens.
- Deployments that do not rely on these tokens for resource-server authorization may have no immediate exploitable impact.
General mitigation guidance
Defensive patterns focus on binding token audiences to explicit authorization decisions:
- Validate resource and audience values against registered resources and the requesting client's allowed scopes or grants.
- Use secure-by-default token issuance that rejects unknown or unauthorized audiences.
- Ensure resource servers verify that a token's audience is appropriate for the requested service and that the client is authorized.
- Treat client-supplied resource values as untrusted input and enforce consistent validation at token issuance and introspection.
- Limit client privileges and avoid relying on token activity alone as proof of authorization.
How teams detect issues like this
High-level detection approaches include:
- Static analysis and code review checks for client-controlled values copied into token claims without authorization checks.
- Reviewing token issuance and introspection logic for consistent audience validation and client-to-resource permission checks.
- Monitoring for tokens whose audiences are not registered or are not associated with the requesting client.
- Enforcing policies that require resource servers to validate both token activity and audience authorization.
Automated code review tools may help identify unchecked input flows into security-sensitive claims.

