high NGINX · AI Security

Nginx UI's MCP tools skipped the config checks its web UI enforces, handing logged-in users nginx code execution

Data graphic: Nginx UI's REST API and MCP tool compared on writing nginx config CVSS 8.8 High, CVE-2026-84318 and CVE-2026-84317 . The REST path checks the directive denylist and requires the OTP step-up, so it rejects the config. The MCP tool nginx_config_add skips both checks, and the config is written and reloaded. An attacker needs a valid login with MCP enabled; the fix is in Nginx UI 2.4.1.
OP

AI security researcher · Published Oct 18, 2026, 11:25 AM EDT

Four CVEs show Nginx UI's MCP tool wrote nginx config without the validation and OTP step-up its REST API applies. Fixed in 2.4.1; upgrade to the current release.

Nginx UI, the open-source web admin panel for nginx, shipped an MCP (Model Context Protocol) interface that let authenticated callers, including AI agents, write nginx configuration without the validation the REST API applies. Four CVEs published on 17 July 2026 (CVE-2026-84317, CVE-2026-84318, CVE-2026-84319 and CVE-2026-84360, CVSS 8.1 to 8.8) describe the gap. Release 2.4.1, dated 3 July 2026, closes it. The flaw is in the agent interface, not in nginx itself.

What happened

Nginx UI keeps a denylist of dangerous directives. ValidateConfigFile rejects perl, perl_set, js_import, js_content, load_module of restricted modules, user root and others. The REST endpoint POST /api/configs calls it and refuses such content.

The MCP tool nginx_config_add did not. It wrote the caller's content to disk and reloaded nginx. The advisory for CVE-2026-84318 puts it plainly: the tool writes and reloads "without calling config.ValidateConfigFile". The sibling tool nginx_config_modify did call it, so only the add path was open.

The MCP endpoints, GET /mcp (SSE) and POST /mcp_message (JSON-RPC), accept the same JWT and node-secret tokens as the REST API. Any authenticated session therefore reached the unvalidated path.

Data graphic: The four Nginx UI MCP CVEs by CVSS 3.1 score. CVE-2026-84317 and CVE-2026-84318 both score 8.8 and are one missing directive check reported twice. CVE-2026-84319 8.3 is the same directive check on the NJS path, and CVE-2026-84360 8.1 is the second skipped check, the OTP step-up. All are fixed in 2.4.1.

CVE-2026-84317 and CVE-2026-84318 are one missing check, reported twice.

The four CVEs

CVECVSSWeaknessAffectedIssue
CVE-2026-843178.8CWE-20up to 2.3.11nginx_config_add skips directive validation
CVE-2026-843188.8CWE-6932.0.0-rc.6 onwardSame gap, reported separately (credit: thekogo)
CVE-2026-843198.3CWE-6932.xSecondary user writes restricted directives via MCP, runs NJS in the worker
CVE-2026-843608.1CWE-288up to 2.4.0MCP routes skip the OTP secure-session step-up

CVE-2026-84317 and CVE-2026-84318 describe the same missing call. Treat them as one defect with two records.

Why it happened

The CVE-2026-84317 advisory traces it to a hardening commit, "Harden config write paths", from 21 April 2026. It added validation to api/config/add.go, api/config/modify.go and mcp/config/config_modify.go. It did not touch mcp/config/config_add.go, which per the advisory had never called the validator. The control was added to three of four write paths, and the fourth was the one an agent could reach.

CVE-2026-84360 is the same pattern for authentication. The HTTP configuration routes sit behind RequireSecureSession, the OTP step-up for sensitive changes. The MCP routes had only AuthRequired. A user with OTP enabled but only an ordinary JWT could change config through MCP without the step-up.

Impact

The researcher's proof of concept on the official uozi/nginx-ui:2.3.11 image wrote a config with load_module for the njs module and user root, plus a script. After the reload, nginx workers ran with UID 0 and an njs handler answered requests. The same content sent through nginx_config_modify was rejected with "file content contains restricted nginx directive".

Limits matter. Exploitation needs a valid Nginx UI login, MCP enabled, and, for code execution, a Perl or njs module present on the nginx host, as in the official Docker image. The CVE-2026-84319 advisory says the result is NJS execution in the worker, "not OS command execution by itself". The CVE-2026-84317 advisory also names prompt injection of an MCP agent as a route to the same calls.

What changed in 2.4.1

We compared the source at the two tags. In v2.4.0, config_add.go goes straight to os.WriteFile. In v2.4.1 it calls config.ValidateConfigFile first, and mcp/router.go adds a requireSecureSessionForSensitiveMCPTools() handler to /mcp and /mcp_message. The change is in commit 23d1934099b0, "fix: harden security advisory paths". The release notes say only "Fixed known issues", and GitHub's advisories list no patched version, so the fix is easy to miss.

What defenders should do

  • Upgrade Nginx UI to 2.4.1 or later. Later releases exist, and the project has published further advisories since, so move to the current release rather than stopping at 2.4.1.
  • If you cannot upgrade, disable MCP or block /mcp and /mcp_message at the proxy, and restrict them to trusted addresses.
  • Audit nginx.conf and included files for load_module, js_import, perl_set and user root that you did not put there, and check file times against reload events.
  • Remove unneeded njs and Perl modules from nginx hosts, and do not run workers as root.
  • Treat every second write path as a security boundary. If you expose a management tool to agents, check that it goes through the same validation, authorization and step-up as the UI.

Related: our earlier coverage of NGINX Rift, CVE-2026-42945 in the rewrite module, a flaw in nginx itself.

Sources

Keep reading

All latest →
  1. elevatedAI SecurityvLLM 0.32 upgrade notes: three denial-of-service fixes, CORS closed by default, Python 3.10 dropped3 min
  2. elevatedAI SecurityMetasploit now ships a persistence module for Ollama's Windows auto-updater3 min
  3. highAI SecurityCERT-In warns AI agents read live Indian business systems through exposed credentials4 min
  4. elevatedAI SecurityTwo coding agents, one mistake: Junie CLI and ZCode both ran MCP servers from untrusted repos4 min
  5. highAI SecurityAoki infostealer now goes after Claude, Codex, Cursor and Copilot credentials4 min
  6. highAI SecurityClaude Agent SDK for Python flaw lets a crafted session ID run commands (CVE-2026-96620)6 min