The vulnerability CVE-2026-107808 in Nginx UI is an authentication bypass where the password login endpoint (POST /api/login) fails to enforce passkey-only two-factor authentication (2FA). The core issue stems from a mismatch between the declared 2FA policy (which considers both TOTP and passkeys) and the actual enforcement logic, which only checked for TOTP.
My analysis focused on the provided commit 95cd21b70814e5d9a48a359aa238aeea1ac97429, which is explicitly stated as the patch. I examined the diff for each modified file to identify the functions directly involved in the vulnerability and its fix.
-
api/user/auth.go - Login function: This function was the primary entry point for password-based logins. The patch clearly shows that the if u.EnabledOTP() condition was expanded to include an else if u.EnabledPasskey() block. This new block initiates a passkey pre-authentication flow, which was entirely missing before the fix. This directly addresses the vulnerability where passkey-only 2FA was not enforced. Additionally, the token generation was refactored to use user.IssueLoginToken, indicating a move towards centralized policy enforcement.
-
internal/user/user.go - GenerateJWT function: Before the patch, this function was responsible for generating JWT tokens and was called directly by Login and other SSO callbacks. The vulnerability description highlights that the lack of proper 2FA enforcement in Login led to the issuance of tokens without passkey verification. The patch introduces a new function, IssueLoginToken, which acts as a centralized policy gate for all interactive login paths. The original GenerateJWT is then modified to call IssueLoginToken with a LoginProofSystem, effectively making IssueLoginToken the new, secure way to issue tokens after proper 2FA validation. Therefore, the original GenerateJWT (when called by vulnerable login paths) was implicitly vulnerable as it did not incorporate the necessary 2FA checks.
Other files mentioned in the vulnerability description (model/user.go, api/user/2fa.go, internal/middleware/secure_session.go) did not show any modifications in the provided patch. While they might be related to the overall 2FA mechanism, the specific fix for this CVE, as evidenced by the commit, primarily targets the Login and GenerateJWT functions to correct the 2FA enforcement logic.
An attacker could exploit this by obtaining a user's password. If the victim had only a passkey configured for 2FA, the attacker could log in successfully with just the password, bypassing the intended second factor. This grants full access to the Nginx UI, which, as stated, can lead to full control of the managed Nginx instance/host.