highCVSS 8.8Vulnerability

CVE-2026-84318

### Summary The MCP tool `nginx_config_add` writes nginx configuration files to disk and triggers an nginx reload without calling `config.ValidateConfigFile`. The identical flow in the REST API (`POST /api/configs`) does call that function and correctly rejects dangerous directives. An authenticated attacker can exploit this gap to write config files containing any blocked directive (`perl`, `js_import`, `load_module`, `user root`, etc.), bypassing nginx-ui's entire security layer. On a server with the nginx Perl, njs, or Lua module loaded, this is post-authentication Remote Code Execution. ### Details `api/config/add.go` (line 46) calls `config.ValidateConfigFile` before writing: ```go err = config.ValidateConfigFile(path, content) // validates directives, checks blocklist if err != nil { cosy.ErrHandler(c, err) return } ``` `mcp/config/config_add.go` (line 79) omits that call entirely and writes directly: ```go err = os.WriteFile(path, []byte(content), 0644) // no ValidateConfigFile, no blocklist check ... res := nginx.Control(nginx.Reload) // reload triggered immediately ``` `config.ValidateConfigFile` runs two checks: - **`ValidateConfigContent`** — rejects control characters, enforces encoding. - **`ValidateConfigDirectives`** — rejects a blocklist of dangerous directives: `perl`, `perl_modules`, `perl_require`, `perl_set`, `js_import`, `js_set`, `js_content`, `load_module` (restricted modules), `user root`, and others. Neither check runs on the MCP path. Note that `mcp/config/config_modify.go` does call `ValidateConfigFile` correctly — only `config_add.go` is affected. The MCP endpoint (`GET /mcp` SSE + `POST /mcp_message` JSON-RPC) accepts the same JWT and node-secret tokens as the REST API, so the attack surface is any authenticated session. ### PoC **1 — Control: confirm REST API blocks the payload** ``` POST /api/configs Authorization: <token> { "name": "rce.conf", "base_dir": "conf.d", "content": "<perl config below>",

Properties

severity
high
summary
Nginx UI: MCP `nginx_config_add` Bypasses Directive Validation — Authenticated RCE
cvss_score
8.8
retrieved_at
2026-10-15T22:56:51+00:00
ghsa_published
2026-10-15T20:11:18Z
source_url
https://github.com/advisories/GHSA-9jww-cxg5-rj9m
ghsa_updated
2026-10-15T20:11:19Z
ghsa_id
GHSA-9jww-cxg5-rj9m
last_source
GitHub Advisory Database
cve_id
CVE-2026-84318
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
signal_observed_at
2026-10-15T22:56:51+00:00
is_ghsa_only
false

Related Entities (4)

VULNERABLE_TO (1)

←[Software]go/github.com/0xJacky/Nginx-UI

AFFECTS (1)

→[Software]go/github.com/0xJacky/Nginx-UI

HAS_WEAKNESS (1)

→[Weakness]Protection Mechanism Failure

REPORTED_BY (1)

→[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-84318 (CVSS 8.8) — Ninja Signal Threat Intelligence | Ninja Signal