/

CVE-2026-84312

Severity:

HIGH RISK

(7.1)

OAuth Login CSRF (CWE-352) in Nginx UI Admin Portal

CVE-2026-84312

Deferred

Vulnerability type

Category:

Cross-Site Request Forgery

CWE:

CWE-287, CWE-352

Impact:

Authentication Bypass and Session Confusion

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Nginx UI prior to 2.4.1 contains a login CSRF weakness in its Casdoor OAuth integration. Because the OAuth state value is predictable and is not bound to the browser session that initiated the flow, an unauthenticated attacker may cause a victim's browser to establish a Nginx UI session for an attacker-controlled identity.

Nginx UI prior to 2.4.1 contains a login CSRF weakness in its Casdoor OAuth integration. Because the OAuth state value is predictable and is not bound to the browser session that initiated the flow, an unauthenticated attacker may cause a victim's browser to establish a Nginx UI session for an attacker-controlled identity.

Affected context

The issue occurs in Nginx UI deployments that enable Casdoor authentication and use the affected OAuth authorization and callback handlers. Risk arises when the callback accepts a submitted authorization state without verifying that it matches a unique value previously issued to the initiating browser session.

The issue occurs in Nginx UI deployments that enable Casdoor authentication and use the affected OAuth authorization and callback handlers. Risk arises when the callback accepts a submitted authorization state without verifying that it matches a unique value previously issued to the initiating browser session.

Exploit preconditions

  • Attack surface: Casdoor OAuth login and callback endpoints exposed through the Nginx UI web interface
  • Required access: No authentication to Nginx UI is required; the attacker needs to influence a victim's browser and control or initiate an authorization flow
  • Trigger point: Processing of the Casdoor OAuth callback
  • Why exploitation is possible: The OAuth state is derived from a configured application name rather than a per-session value, and the callback does not verify that the returned state belongs to the initiating browser session
  • Attack surface: Casdoor OAuth login and callback endpoints exposed through the Nginx UI web interface
  • Required access: No authentication to Nginx UI is required; the attacker needs to influence a victim's browser and control or initiate an authorization flow
  • Trigger point: Processing of the Casdoor OAuth callback
  • Why exploitation is possible: The OAuth state is derived from a configured application name rather than a per-session value, and the callback does not verify that the returned state belongs to the initiating browser session

Why this happens

The vulnerability is caused by failing to bind an OAuth authorization response to the browser session that initiated the login request. Using a constant or predictable state value and omitting server-side comparison allows an attacker-controlled authorization response to be accepted in another user's browser.

This behavior maps primarily to CWE-352: Cross-Site Request Forgery, because a victim's authenticated session state can be changed through an unintended cross-site request. It also relates to CWE-287: Improper Authentication, because the callback does not adequately authenticate the relationship between the authorization request and response.

The vulnerability is caused by failing to bind an OAuth authorization response to the browser session that initiated the login request. Using a constant or predictable state value and omitting server-side comparison allows an attacker-controlled authorization response to be accepted in another user's browser.

This behavior maps primarily to CWE-352: Cross-Site Request Forgery, because a victim's authenticated session state can be changed through an unintended cross-site request. It also relates to CWE-287: Improper Authentication, because the callback does not adequately authenticate the relationship between the authorization request and response.

Potential impact

  • A victim's browser may establish a Nginx UI session for an attacker-controlled identity
  • Users may be misled about which account is active in the administrative interface
  • Actions performed by the victim could be attributed to or visible to the attacker's account
  • Downstream administrative or configuration changes could occur under the unintended session identity
  • A victim's browser may establish a Nginx UI session for an attacker-controlled identity
  • Users may be misled about which account is active in the administrative interface
  • Actions performed by the victim could be attributed to or visible to the attacker's account
  • Downstream administrative or configuration changes could occur under the unintended session identity

General mitigation guidance

Mitigation generally focuses on enforcing a strong, session-bound OAuth transaction.

Common defensive patterns include:

  • Generate cryptographically random state values for every authorization request
  • Store the expected state server-side or in a protected browser session
  • Compare the callback state with the value associated with the initiating session before accepting the authorization code
  • Invalidate state values after one use and enforce suitable expiration
  • Validate redirect targets and OAuth issuer, client, and redirect-URI relationships
  • Apply secure cookie attributes and least-privilege permissions to authenticated sessions
  • Prefer authentication libraries and framework integrations that provide state and nonce validation by default

Mitigation generally focuses on enforcing a strong, session-bound OAuth transaction.

Common defensive patterns include:

  • Generate cryptographically random state values for every authorization request
  • Store the expected state server-side or in a protected browser session
  • Compare the callback state with the value associated with the initiating session before accepting the authorization code
  • Invalidate state values after one use and enforce suitable expiration
  • Validate redirect targets and OAuth issuer, client, and redirect-URI relationships
  • Apply secure cookie attributes and least-privilege permissions to authenticated sessions
  • Prefer authentication libraries and framework integrations that provide state and nonce validation by default

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review checks for constant, user-controlled, or missing OAuth state validation
  • Review of authorization handlers to confirm state is generated per request and bound to a browser session
  • Tests that replay an authorization response in a different session and verify that it is rejected
  • Monitoring for unusual OAuth callback activity, repeated state values, and sessions created without a matching login initiation
  • Policy enforcement requiring OAuth libraries to validate state, nonce, issuer, and redirect URI values
  • Automated security review tools that identify missing CSRF protections or unsafe OAuth callback patterns

Organizations can look for this class of issue through:

  • Static analysis and code review checks for constant, user-controlled, or missing OAuth state validation
  • Review of authorization handlers to confirm state is generated per request and bound to a browser session
  • Tests that replay an authorization response in a different session and verify that it is rejected
  • Monitoring for unusual OAuth callback activity, repeated state values, and sessions created without a matching login initiation
  • Policy enforcement requiring OAuth libraries to validate state, nonce, issuer, and redirect URI values
  • Automated security review tools that identify missing CSRF protections or unsafe OAuth callback patterns

Sources

SourceLink
github.comgithub.com/0xJacky/nginx-ui/commit/23d1934099b05b2a01589b48129dc3d3159d91c2
github.comgithub.com/0xJacky/nginx-ui/releases/tag/v2.4.1
github.comgithub.com/0xJacky/nginx-ui/security/advisories/GHSA-44xr-mrhh-qm78

Frequently asked

questions

Yes, exploitation can be initiated remotely through the web-based OAuth flow, although it generally requires influencing a victim's browser to process an attacker-controlled authorization response.

No. The described condition does not require prior authentication to Nginx UI; the key requirement is the ability to initiate or deliver an OAuth flow to a victim.

Use a fresh, unpredictable OAuth state value for every login attempt, bind it to the initiating browser session, and reject callbacks whose state does not match.

Use OAuth integrations with state and nonce validation enabled by default, test cross-session callback handling, protect session cookies, and include authentication-flow checks in code review and security testing.

Yes, exploitation can be initiated remotely through the web-based OAuth flow, although it generally requires influencing a victim's browser to process an attacker-controlled authorization response.

No. The described condition does not require prior authentication to Nginx UI; the key requirement is the ability to initiate or deliver an OAuth flow to a victim.

Use a fresh, unpredictable OAuth state value for every login attempt, bind it to the initiating browser session, and reject callbacks whose state does not match.

Use OAuth integrations with state and nonce validation enabled by default, test cross-session callback handling, protect session cookies, and include authentication-flow checks in code review and security testing.

Find out what's already
exploitable in your codebase.