Summary
New API exposes user bearer tokens through administrator-facing user listing and lookup APIs because serialized user objects include the access_token field. An authenticated administrator may obtain the root user's token and use it to access root-only system configuration APIs.
Affected context
The issue occurs in New API deployments where administrator user-management endpoints serialize complete User model objects after excluding only password data. It is most relevant when the serialized response includes bearer tokens and the root account has access to privileged system configuration interfaces.
Exploit preconditions
- Attack surface: Administrator-facing user list and lookup APIs, including
GET /api/user/ - Required access: An authenticated administrator account capable of calling these endpoints
- Trigger point: User records are returned through API serialization after database queries
- Why exploitation is possible: Excluding password fields alone does not prevent the
access_tokenfield from being exposed, allowing a privileged session to obtain a more powerful root credential
Why this happens
The underlying bug is excessive exposure of sensitive authentication data in API responses. User model objects are serialized after applying an incomplete field exclusion that removes passwords but leaves bearer tokens available to clients.
This maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor. Although the requesting administrator may be authorized to view user-management data, that authorization does not imply permission to retrieve another account's reusable authentication credential.
Potential impact
- An attacker with administrator access may obtain the root user's bearer token
- The exposed token could enable unauthorized access to root-only APIs
- System configuration may be read or modified
- AI assets, gateway behavior, or connected services could be altered
- The incident could facilitate data exposure, persistence, or further privilege abuse
General mitigation guidance
Mitigation generally focuses on minimizing response data and separating authentication secrets from user profile models.
Common defensive patterns include:
- Use explicit response schemas or allowlists rather than serializing complete user objects
- Never return bearer tokens, refresh tokens, API keys, or equivalent credentials in user-management responses
- Keep credential material in separate internal representations that cannot be serialized by default
- Apply field-level authorization so administrative visibility does not imply credential access
- Require short-lived, scoped tokens and limit the privileges of service and administrative identities
- Treat token rotation and revocation as standard controls when exposure is suspected
How teams detect issues like this
Organizations can detect this class of issue through:
- API contract tests that assert sensitive fields are absent from user list and lookup responses
- Static analysis and code review checks for direct serialization of database or ORM user models
- Searches for response schemas containing fields such as
access_token,refresh_token, secrets, or API keys - Authorization tests verifying that administrative roles cannot retrieve reusable credentials
- API gateway or data-loss-prevention policies that block credential-shaped fields from ordinary JSON responses
- Audit-log review for unusual root-token use or privileged configuration changes

