CVE-2026-84312
Nginx UI: Casdoor SSO callback uses a constant `state` parameter (login CSRF)
Nginx UI is a web user interface for the Nginx web server. Prior to 2.4.1, GetCasdoorUri uses the configured Casdoor application name as a constant OAuth state value and CasdoorCallback does not compare the submitted state with a value bound to the initiating browser session. An unauthenticated attacker can cause a victim's browser to complete an attacker-controlled Casdoor authorization flow, and the callback can mint a Nginx UI session for the identity returned by that authorization code. This issue is fixed in version 2.4.1.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
7.1
Nginx UI: Casdoor SSO callback uses a constant `state` parameter (login CSRF)
Nginx UI is a web user interface for the Nginx web server. Prior to 2.4.1, GetCasdoorUri uses the configured Casdoor application name as a constant OAuth state value and CasdoorCallback does not compare the submitted state with a value bound to the initiating browser session. An unauthenticated attacker can cause a victim's browser to complete an attacker-controlled Casdoor authorization flow, and the callback can mint a Nginx UI session for the identity returned by that authorization code. This issue is fixed in version 2.4.1.
- Record
CVE-2026-84312- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N - Weakness
- CWE-287, CWE-352
- Updated
- 2026-11-02
EUVDEUVD-2026-97963
7.1
Nginx UI is a web user interface for the Nginx web server. Prior to 2.4.1, GetCasdoorUri uses the configured Casdoor application name as a constant OAuth state value and CasdoorCallback does not compare the submitted state with a value bound to the initiating browser session. An unauthenticated attacker can cause a victim's browser to complete an attacker-controlled Casdoor authorization flow, and the callback can mint a Nginx UI session for the identity returned by that authorization code. This issue is fixed in version 2.4.1.
- Record
EUVD-2026-97963- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-44xr-mrhh-qm78
7.1
Nginx UI: Casdoor SSO callback uses a constant `state` parameter (login CSRF)
Summary
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
-
Attacker initiates a Casdoor authorisation flow on their own browser, obtaining an authorisation
codefor their Casdoor account. -
Attacker hosts a page that auto-submits the captured
codeto 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> -
Server exchanges the attacker's
code, looks up the username fromclaims.Namein the local user table, and mints a JWT for that row. The callback also sets the_nginx_ui_secure_sessioncookie viamiddleware.EnsureSecureSessionCookie(c)(casdoor.go:84) — meaning the victim is now silently authenticated as the attacker. -
Victim, believing they are using their own account, configures sites / TLS keys; the attacker reads them.
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.
Patches
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…
- Record
GHSA-44xr-mrhh-qm78- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N - Weakness
- CWE-287, CWE-352
- Updated
- 2026-11-02
NVD
7.1
Nginx UI is a web user interface for the Nginx web server. Prior to 2.4.1, GetCasdoorUri uses the configured Casdoor application name as a constant OAuth state value and CasdoorCallback does not compare the submitted state with a value bound to the initiating browser session. An unauthenticated attacker can cause a victim's browser to complete an attacker-controlled Casdoor authorization flow, and the callback can mint a Nginx UI session for the identity returned by that authorization code. This issue is fixed in version 2.4.1.
- Record
CVE-2026-84312- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N - Weakness
- CWE-287, CWE-352
- Updated
- 2026-11-02
OSV
7.1
Nginx UI: Casdoor SSO callback uses a constant `state` parameter (login CSRF)
Nginx UI is a web user interface for the Nginx web server. Prior to 2.4.1, GetCasdoorUri uses the configured Casdoor application name as a constant OAuth state value and CasdoorCallback does not compare the submitted state with a value bound to the initiating browser session. An unauthenticated attacker can cause a victim's browser to complete an attacker-controlled Casdoor authorization flow, and the callback can mint a Nginx UI session for the identity returned by that authorization code. This issue is fixed in version 2.4.1.
- Record
CVE-2026-84312- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N - Weakness
- CWE-287, CWE-352
- Updated
- 2026-11-02
OSVGHSA-44xr-mrhh-qm78
7.1
Nginx UI: Casdoor SSO callback uses a constant `state` parameter (login CSRF)
Summary
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
-
Attacker initiates a Casdoor authorisation flow on their own browser, obtaining an authorisation
codefor their Casdoor account. -
Attacker hosts a page that auto-submits the captured
codeto 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> -
Server exchanges the attacker's
code, looks up the username fromclaims.Namein the local user table, and mints a JWT for that row. The callback also sets the_nginx_ui_secure_sessioncookie viamiddleware.EnsureSecureSessionCookie(c)(casdoor.go:84) — meaning the victim is now silently authenticated as the attacker. -
Victim, believing they are using their own account, configures sites / TLS keys; the attacker reads them.
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.
Patches
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…
- Record
GHSA-44xr-mrhh-qm78- CVSS 3.1
- 7.1 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N - Weakness
- CWE-287, CWE-352
- Updated
- 2026-11-02
OSVGO-2026-6773 No score
Casdoor SSO callback uses a constant state parameter (login CSRF) in github.com/0xJacky/Nginx-UI
Casdoor SSO callback uses a constant state parameter (login CSRF) in github.com/0xJacky/Nginx-UI
- Record
GO-2026-6773- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/0xJacky/Nginx-UIGo |
before 1.9.10-0.20260703131214-23d1934099b0 | 1.9.10-0.20260703131214-23d1934099b0 |
github.com/0xJacky/Nginx-UIGo |
All versions | None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-84312 is a high vulnerability (CVSS 7.1) in 0xjacky Nginx-ui, published October 12, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.17%, the 6th percentile. Fixed in github.com/0xJacky/Nginx-UI 1.9.10-0.20260703131214-23d1934099b0.
References
github.com/0xJacky/nginx-ui/security/advisories/GHSA-44xr-mrhh-qm78
github.com/0xJacky/nginx-ui/commit/23d1934099b05b2a01589b48129dc3d3159d91c2
github.com/0xJacky/nginx-ui/releases/tag/v2.4.1
nvd.nist.gov/vuln/detail/CVE-2026-84312
github.com/advisories/GHSA-44xr-mrhh-qm78
github.com/CVEProject/cvelistV5/tree/main/cves/2026/84xxx/CVE-2026-84312.json
github.com/0xJacky/nginx-ui
Left out here: the rest of 2 source descriptions. The JSON record has them.