CVE-2026-84312

CVE-2026-84312 is a high-severity improper authentication vulnerability in github.com/0xJacky/Nginx-UI (go), affecting versions < 1.9.10-0.20260703131214-23d1934099b0. It is fixed in 1.9.10-0.20260703131214-23d1934099b0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Nginx UI: Casdoor SSO callback uses a constant state parameter (login CSRF)

In the Casdoor SSO flow, the OAuth state parameter is hard-coded to settings.CasdoorSettings.Application, a value identical for every user and every login. The callback handler accepts whatever state the client sends without comparing it to anything stored in the user agent, enabling a login-CSRF: an attacker can force the victim's browser to authenticate as the attacker.

Details

api/user/casdoor.go:92-117 (GetCasdoorUri):

func GetCasdoorUri(c *gin.Context) {
    clientId := settings.CasdoorSettings.ClientId
    redirectUri := settings.CasdoorSettings.RedirectUri
    state := settings.CasdoorSettings.Application      // ← constant
    ...
    c.JSON(http.StatusOK, gin.H{
        "uri": fmt.Sprintf(
            "%s/login/oauth/authorize?client_id=%s&response_type=code&redirect_uri=%s&state=%s&scope=read",
            endpoint, clientId, encodedRedirectUri, state),
    })
}

api/user/casdoor.go:24-90 (CasdoorCallback):

type CasdoorLoginUser struct {
    Code  string `json:"code" binding:"required,max=255"`
    State string `json:"state" binding:"required,max=255"`
}

func CasdoorCallback(c *gin.Context) {
    var loginUser CasdoorLoginUser
    if !cosy.BindAndValid(c, &loginUser) { return }
    ...
    // state is NEVER compared to a per-session value
    token, err := casdoorsdk.GetOAuthToken(loginUser.Code, loginUser.State)
    ...
    u, err := user.GetUser(claims.Name)        // username from Casdoor's JWT
    ...
    userToken, err := user.GenerateJWT(u)       // JWT minted for whatever user came back
}

Compare with the OIDC implementation in api/user/oidc.go:35-48, which generates a random state, stores it in an oidc_state cookie, and validates it on the callback. Casdoor has no such check.

Proof of Concept

  1. Attacker initiates a Casdoor authorisation flow on their own browser, obtaining an authorisation code for their Casdoor account.

  2. Attacker hosts a page that auto-submits the captured code to the victim's nginx-ui:

    <html><body><form action="https://victim.example/api/casdoor_callback" method="POST"
                      enctype="text/plain" id="x">
      <input name='{"code":"<attacker_code>","state":"<App>","junk":"' value='"}'>
    </form>
    <script>document.getElementById('x').submit()</script>
    </body></html>
    
  3. Server exchanges the attacker's code, looks up the username from claims.Name in the local user table, and mints a JWT for that row. The callback also sets the _nginx_ui_secure_session cookie via middleware.EnsureSecureSessionCookie(c) (casdoor.go:84), meaning the victim is now silently authenticated as the attacker.

  4. Victim, believing they are using their own account, configures sites / TLS keys; the attacker reads them.

Workarounds

Disable Casdoor SSO until patched. The OIDC integration in api/user/oidc.go is correctly implemented and can be used as a substitute.

References

Credits

Vishal Shukla (@shukla304) and Sechub.dev AI Agent.

Impact

Login CSRF, the victim is forced to authenticate as the attacker, leading to data exfiltration of anything the victim subsequently uploads or configures. Particularly dangerous when nginx-ui is used by an organisation where Casdoor maps internal identities, the attacker can attribute their changes to the victim.

The application does not adequately verify the identity of a user, device, or process before granting access. Typical impact: unauthorized access to functions or data reserved for authenticated parties.

CVE-2026-84312 has a CVSS score of 7.1 (High). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.9.10-0.20260703131214-23d1934099b0); upgrading removes the vulnerable code path.

Affected versions

github.com/0xJacky/Nginx-UI (< 1.9.10-0.20260703131214-23d1934099b0)

Security releases

github.com/0xJacky/Nginx-UI → 1.9.10-0.20260703131214-23d1934099b0 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Mirror the OIDC implementation:

+ import (
+    "crypto/rand"
+    "crypto/subtle"
+    "encoding/hex"
+    ...
+ )

 func GetCasdoorUri(c *gin.Context) {
     ...
-    state := settings.CasdoorSettings.Application
+    b := make([]byte, 16)
+    if _, err := rand.Read(b); err != nil {
+        cosy.ErrHandler(c, err); return
+    }
+    state := hex.EncodeToString(b)
+    c.SetSameSite(http.SameSiteLaxMode)
+    c.SetCookie("casdoor_state", state, 600, "/", "",
+                cSettings.ServerSettings.EnableHTTPS, true)
     ...
 }

 func CasdoorCallback(c *gin.Context) {
+    expected, err := c.Cookie("casdoor_state")
+    if err != nil {
+        c.AbortWithStatusJSON(http.StatusBadRequest,
+            gin.H{"message":"missing state cookie"}); return
+    }
     var loginUser CasdoorLoginUser
     if !cosy.BindAndValid(c, &loginUser) { return }
+    if subtle.ConstantTimeCompare([]byte(expected), []byte(loginUser.State)) != 1 {
+        c.AbortWithStatusJSON(http.StatusBadRequest,
+            gin.H{"message":"invalid state"}); return
+    }
     ...
 }

Frequently Asked Questions

  1. What is CVE-2026-84312? CVE-2026-84312 is a high-severity improper authentication vulnerability in github.com/0xJacky/Nginx-UI (go), affecting versions < 1.9.10-0.20260703131214-23d1934099b0. It is fixed in 1.9.10-0.20260703131214-23d1934099b0. The application does not adequately verify the identity of a user, device, or process before granting access.
  2. How severe is CVE-2026-84312? CVE-2026-84312 has a CVSS score of 7.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of github.com/0xJacky/Nginx-UI are affected by CVE-2026-84312? github.com/0xJacky/Nginx-UI (go) versions < 1.9.10-0.20260703131214-23d1934099b0 is affected.
  4. Is there a fix for CVE-2026-84312? Yes. CVE-2026-84312 is fixed in 1.9.10-0.20260703131214-23d1934099b0. Upgrade to this version or later.
  5. Is CVE-2026-84312 exploitable, and should I be worried? Whether CVE-2026-84312 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-84312 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-84312? Upgrade github.com/0xJacky/Nginx-UI to 1.9.10-0.20260703131214-23d1934099b0 or later.

Other vulnerabilities in github.com/0xJacky/Nginx-UI

Stop the waste.
Protect your environment with Kodem.