Summary
FastapiAdmin contains unprotected auto-login endpoints that allow unauthenticated users to obtain sessions for arbitrary accounts.
An attacker may use these endpoints to acquire a superuser JWT and gain full administrative control when the affected authentication routes are publicly reachable.
FastapiAdmin contains unprotected auto-login endpoints that allow unauthenticated users to obtain sessions for arbitrary accounts.
An attacker may use these endpoints to acquire a superuser JWT and gain full administrative control when the affected authentication routes are publicly reachable.
Affected context
The vulnerability occurs in FastapiAdmin deployments where auto-login functionality is exposed without effective authentication or authorization checks. The affected flow includes an endpoint that lists users, an endpoint that issues auto-login credentials, and a token exchange that produces a JWT session, allowing the trust boundary around administrative authentication to be bypassed.
The vulnerability occurs in FastapiAdmin deployments where auto-login functionality is exposed without effective authentication or authorization checks. The affected flow includes an endpoint that lists users, an endpoint that issues auto-login credentials, and a token exchange that produces a JWT session, allowing the trust boundary around administrative authentication to be bypassed.
Exploit preconditions
- Attack surface: Network-accessible FastapiAdmin auto-login API endpoints
- Required access: No prior authentication is required when the endpoints are exposed
- Trigger point: Requests to the user-listing and auto-login token exchange flow
- Why exploitation is possible: The application permits unauthenticated users to select an account and obtain a session without verifying authorization for the requested identity
- Attack surface: Network-accessible FastapiAdmin auto-login API endpoints
- Required access: No prior authentication is required when the endpoints are exposed
- Trigger point: Requests to the user-listing and auto-login token exchange flow
- Why exploitation is possible: The application permits unauthenticated users to select an account and obtain a session without verifying authorization for the requested identity
Why this happens
The root cause is a missing authentication and authorization control on security-sensitive auto-login functionality.
The application treats unauthenticated requests as trusted when identifying users and issuing session credentials. This behavior maps to CWE-306: Missing Authentication for Critical Function, because a critical account-session operation can be invoked without first establishing the caller's identity and permissions.
The root cause is a missing authentication and authorization control on security-sensitive auto-login functionality.
The application treats unauthenticated requests as trusted when identifying users and issuing session credentials. This behavior maps to CWE-306: Missing Authentication for Critical Function, because a critical account-session operation can be invoked without first establishing the caller's identity and permissions.
Potential impact
- An attacker may obtain sessions for arbitrary users
- An attacker could gain full administrative control through a superuser session
- Unauthorized users may access, alter, or delete managed application data
- The application could be used to create persistence or change security-related settings
- Connected services or administrative workflows may be disrupted
- An attacker may obtain sessions for arbitrary users
- An attacker could gain full administrative control through a superuser session
- Unauthorized users may access, alter, or delete managed application data
- The application could be used to create persistence or change security-related settings
- Connected services or administrative workflows may be disrupted
General mitigation guidance
Mitigation generally focuses on protecting every authentication and session-issuance path with explicit identity and authorization checks.
Common defensive patterns include:
- Disabling or removing auto-login endpoints when they are not required
- Requiring strong authentication before user selection or token issuance
- Enforcing server-side authorization for the requested account and session role
- Preventing user enumeration through unauthenticated API responses
- Applying least privilege to administrative accounts and service tokens
- Restricting administrative interfaces behind network access controls and additional authentication layers
- Using short-lived, audience-bound session tokens with secure revocation and audit controls
Mitigation generally focuses on protecting every authentication and session-issuance path with explicit identity and authorization checks.
Common defensive patterns include:
- Disabling or removing auto-login endpoints when they are not required
- Requiring strong authentication before user selection or token issuance
- Enforcing server-side authorization for the requested account and session role
- Preventing user enumeration through unauthenticated API responses
- Applying least privilege to administrative accounts and service tokens
- Restricting administrative interfaces behind network access controls and additional authentication layers
- Using short-lived, audience-bound session tokens with secure revocation and audit controls
How teams detect issues like this
Organizations can detect this class of issue through:
- Static analysis and code review for authentication routes that lack middleware or authorization checks
- Review of endpoints that accept user identifiers before establishing caller identity
- API inventory checks for unauthenticated routes capable of issuing JWTs or equivalent sessions
- Dynamic tests that verify protected endpoints reject anonymous requests and cross-account access attempts
- Monitoring for unusual auto-login activity, rapid token issuance, user enumeration, and new administrative sessions
- Policy enforcement requiring security review for endpoints that create or elevate sessions
Automated application-security and API-security review tools may help identify missing access-control enforcement, but coverage should be validated against the application's authorization model.
Organizations can detect this class of issue through:
- Static analysis and code review for authentication routes that lack middleware or authorization checks
- Review of endpoints that accept user identifiers before establishing caller identity
- API inventory checks for unauthenticated routes capable of issuing JWTs or equivalent sessions
- Dynamic tests that verify protected endpoints reject anonymous requests and cross-account access attempts
- Monitoring for unusual auto-login activity, rapid token issuance, user enumeration, and new administrative sessions
- Policy enforcement requiring security review for endpoints that create or elevate sessions
Automated application-security and API-security review tools may help identify missing access-control enforcement, but coverage should be validated against the application's authorization model.

