Skip to content

AAK-MCP-NGINXUI-CVE-2026-84317-001: Nginx UI image 2.0.1 to 2.4.0: MCP config tools write blocked nginx directives and skip the secure-session step-up (code execution where njs or Perl is loaded)

Severity
HIGH
Category
Supply Chain (supply-chain)
Scanner
agent_audit_kit/scanners/container_image_pins.py
Auto-fixable
No.
SARIF name
NginxUiMcpConfigDirectiveInjection

What it detects

Nginx UI is a web UI for nginx with a built-in MCP server (/mcp and /mcp_message), deployed from the Docker Hub image uozi/nginx-ui. Its MCP tools first ship in 2.0.0-rc.6. Through 2.4.0 the nginx_config_add tool writes the caller's content to disk and reloads nginx without ValidateConfigFile, the check the REST API and nginx_config_modify apply from 2.3.9, so an authenticated MCP caller, or an agent steered by prompt injection, can write js_*, perl*, load_module or user root directives. Where the njs or Perl module is loaded, as in the official image, that runs code in the nginx worker. CVE-2026-84317 and CVE-2026-84318 (both CVSS 8.8) report this defect twice, and CVE-2026-84319 (CVSS 8.3) a third time, for a secondary user. The MCP routes also skip the RequireSecureSession step-up the REST configuration routes require, so an OTP-enabled user without a secure session can still change the configuration (CVE-2026-84360, CVSS 8.1). 2.4.1 (23d1934) validates the content and requires the secure session for the sensitive MCP tools.

How to fix

Upgrade the uozi/nginx-ui image to 2.4.1 or later and pin the tag. Until then, give MCP access only to trusted principals, do not load the njs or Perl modules, and check configuration written through MCP for js_*, perl*, load_module and user root directives.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-MCP-NGINXUI-CVE-2026-84317-001

Limitations

Reads uozi/nginx-ui references from 2.0.1 below 2.4.1 in compose files, Kubernetes manifests, Helm values, Dockerfiles and MCP configs. The README's compose file and docker run use latest, which was the v2.8.4 digest on 2026-10-15, so they are not reported, and the docker.io/ form is not read. 2.0.0 and its betas and release candidates all read as 2.0.0, and the MCP tools arrived in 2.0.0-rc.6, so the reader cannot tell an affected 2.0.0 tag from an older one: none of them is reported, although 2.0.0-rc.6 to 2.0.0 are affected. The release binaries and the install script state no image tag and are not read.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-MCP-NGINXUI-CVE-2026-84317-001.md: the page then shows that text, with the registry reference appended under it.