Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-111642 Overview
CVE-2026-111642 affects FastapiAdmin through version 3.0. The application ships with a hard-coded JSON Web Token (JWT) signing secret in backend/app/config/setting.py. Any low-privileged user can self-register through the unauthenticated /api/v1/system/user/register endpoint, authenticate, and then forge an HS256 token that keeps their valid session_id while naming the superuser in the user_name claim. The forged token grants full superuser privileges on the application. The vulnerability is tracked under [CWE-321: Use of Hard-coded Cryptographic Key].
Critical Impact
Unauthenticated attackers can register an account and escalate to superuser by forging JWTs signed with the publicly known embedded secret.
Affected Products
- FastapiAdmin versions up to and including 3.0
- Deployments using the default backend/app/config/setting.py configuration
- Any instance exposing /api/v1/system/user/register to untrusted networks
Discovery Timeline
- 2026-10-16 - CVE-2026-111642 published to the National Vulnerability Database (NVD)
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-111642
Vulnerability Analysis
FastapiAdmin issues session tokens as HS256-signed JWTs. The signing secret used to validate those tokens is hard-coded in the project source at backend/app/config/setting.py. Because the repository is public, the secret is effectively known to every attacker who inspects the source tree.
Token validation in backend/app/core/dependencies.py trusts the user_name claim inside the JWT to resolve the acting identity, while the session_id claim is validated against the user's active session. An authenticated attacker can therefore craft a token that pairs their own valid session_id with the user_name of the superuser account and pass server-side checks.
Root Cause
The root cause is the embedded cryptographic key in setting.py, combined with authorization logic that derives the privileged identity from a user-controlled claim rather than from a server-side session binding. The design pattern violates the principle that signing keys must be deployment-specific secrets and that privilege decisions must be bound to the authenticated session, not to arbitrary token fields.
Attack Vector
The attack is remote and requires no prior credentials. An attacker calls the unauthenticated /api/v1/system/user/register endpoint to create a low-privileged account, logs in to obtain a legitimate session_id, then re-signs a modified JWT payload using the hard-coded secret. The forged token substitutes the default superuser name (for example admin) into the user_name claim. Subsequent API calls bearing the forged token are processed with superuser authority.
Technical details are available in the HackMD analysis of the autologin and hardcoded JWT secret and the VulnCheck advisory.
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2026-111642
Indicators of Compromise
- Unexpected account creations against /api/v1/system/user/register from untrusted source IPs.
- Authenticated API requests where the JWT user_name claim resolves to a superuser but the originating session_id belongs to a recently registered low-privileged account.
- Administrative actions (user management, role changes, configuration updates) performed shortly after a self-registration event.
Detection Strategies
- Decode server-side JWTs and alert when the user_name claim does not match the username that owns the referenced session_id.
- Correlate /api/v1/system/user/register and /api/v1/base/access_token requests with subsequent privileged endpoint calls from the same client within short time windows.
- Flag any JWT verified against the public default secret published in the FastapiAdmin configuration file.
Monitoring Recommendations
- Enable verbose audit logging for authentication, registration, and role-change events in FastapiAdmin.
- Forward web server and application logs to a centralized analytics platform for behavioral correlation across registration, login, and admin actions.
- Monitor egress from the application host for post-exploitation activity such as new outbound connections or credential dumping.
How to Mitigate CVE-2026-111642
Immediate Actions Required
- Restrict network exposure of FastapiAdmin administrative endpoints, especially /api/v1/system/user/register, until a fix is applied.
- Replace the hard-coded JWT secret in backend/app/config/setting.py with a high-entropy value sourced from an environment variable or secrets manager.
- Invalidate all existing sessions and JWTs, then force password resets for every account, particularly superusers.
- Audit user tables for unauthorized accounts and recent privilege changes.
Patch Information
No vendor patch is referenced in the NVD entry at publication time. Review the upstream repository for updates beyond v3.0 and consult the VulnCheck advisory for remediation guidance. Until an official release is available, operators should apply the configuration changes described below.
Workarounds
- Disable or remove the unauthenticated /api/v1/system/user/register route if self-registration is not required.
- Override the JWT signing secret via a deployment-specific environment variable and ensure it is not committed to source control.
- Modify authorization logic (see dependencies.py reference) so that the privileged identity is derived from the server-side session record rather than the user_name JWT claim.
- Place the application behind an authenticating reverse proxy or VPN to limit exposure.
# Configuration example: supply JWT secret from the environment
export FASTAPIADMIN_JWT_SECRET="$(openssl rand -hex 48)"
# Then reference it in setting.py instead of a hard-coded literal:
# SECRET_KEY: str = os.environ["FASTAPIADMIN_JWT_SECRET"]
# JWT_ALGORITHM: str = "HS256"
# Optional: block self-registration at the proxy layer (nginx example)
# location = /api/v1/system/user/register {
# return 403;
# }
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

