CVE-2026-84318: Nginx UI: MCP `nginx_config_add` Bypasses Directive Validation — Authenticated RCE
Nginx UI is a web user interface for the Nginx web server. From 2.0.0-rc.6 until 2.4.1, the MCP tool nginxconfigadd 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, jsimport, loadmodule, 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. This issue is fixed in version 2.4.1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Nginx UIto a version that resolves this vulnerability.Fixed in 2.4.1
Event History
Frequently Asked Questions
Who is exposed to remote code execution?
Authenticated Nginx UI users can exploit the issue on affected versions if the server has the nginx Perl, njs, or Lua module loaded. Those modules allow dangerous directives written through the MCP tool to result in post-authentication remote code execution.
Is the REST API endpoint affected by the same validation bypass?
No. The REST API flow for POST /api/configs calls config.ValidateConfigFile and rejects dangerous directives; the bypass is in the MCP nginx_config_add flow.
What should be done to remediate the issue?
Upgrade Nginx UI to version 2.4.1, which fixes the issue. The affected range is from 2.0.0-rc.6 until 2.4.1.
How can I determine whether a system may already have been abused?
Review Nginx configuration files written through Nginx UI for blocked or dangerous directives, including perl, js_import, load_module, and user root. Also check whether the nginx Perl, njs, or Lua module is loaded, as their presence makes code execution possible.