Skip to main content
Vulnerability Database/CVE-2026-84319

CVE-2026-84319: Nginx UI Remote Code Execution Vulnerability

CVE-2026-84319 is a remote code execution flaw in Nginx UI that allows authenticated users to bypass security controls and execute arbitrary JavaScript code. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-84319 Overview

CVE-2026-84319 is a security control bypass in Nginx UI, a web user interface for managing the Nginx web server. The standard HTTP configuration API blocks restricted Nginx directives such as load_module, js_import, and js_content. However, the Model Context Protocol (MCP) configuration interface fails to enforce the same restrictions. A secondary authenticated user can write and apply equivalent restricted configuration through MCP, load ngx_http_js_module.so, import attacker-controlled JavaScript, reload Nginx, and execute NJS code in the Nginx worker process context. The flaw is tracked under [CWE-693: Protection Mechanism Failure] and is fixed in version 2.4.1.

Critical Impact

An authenticated attacker can bypass directive restrictions through the MCP interface and achieve code execution within the Nginx worker process.

Affected Products

  • Nginx UI versions prior to 2.4.1
  • Deployments exposing the MCP configuration interface to authenticated users
  • Nginx instances managed by vulnerable Nginx UI builds

Discovery Timeline

  • 2026-10-12 - CVE-2026-84319 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2026-84319

Vulnerability Analysis

Nginx UI maintains a denylist of restricted Nginx directives that could enable module loading or dynamic code execution. The regular HTTP configuration API enforces this denylist and rejects attempts to use directives such as load_module, js_import, or js_content. The MCP configuration interface, intended for programmatic configuration management by authenticated users, does not share the same validation path. This inconsistency between two configuration surfaces creates a protection mechanism failure, allowing attackers to apply configuration content that the primary API would reject.

Root Cause

The root cause is inconsistent enforcement of security controls across parallel configuration interfaces. The denylist logic that rejects restricted directives lives in the HTTP API handler path but is absent from the MCP code path. Any authenticated user with access to MCP can therefore submit configuration fragments that reach the Nginx reload process unchecked.

Attack Vector

An authenticated user with MCP access writes a configuration that includes a load_module directive to load ngx_http_js_module.so. The attacker then adds js_import to pull in attacker-controlled JavaScript and binds it to a request handler using js_content. Triggering a reload activates the module and script. Subsequent HTTP requests execute the NJS payload inside the Nginx worker context, giving the attacker code execution with the worker process privileges.

go
// Security hardening added in the v2.4.1 patch
// Source: https://github.com/0xJacky/nginx-ui/commit/23d1934099b05b2a01589b48129dc3d3159d91c2

func InitRouter(r *gin.RouterGroup) {
-	r.GET("/backup", middleware.AuthRequired(), CreateBackup)
+	r.GET("/backup", middleware.AuthRequired(), middleware.RequireSecureSession(), CreateBackup)
 	r.POST("/restore", middleware.AuthRequired(), middleware.RequireSecureSession(), middleware.EncryptedForm(), RestoreBackup)
}

The commit extends RequireSecureSession middleware to additional sensitive routes, tightening the authorization boundary around configuration-impacting endpoints.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-84319

Indicators of Compromise

  • Unexpected load_module directives referencing ngx_http_js_module.so in Nginx configuration files
  • Presence of js_import or js_content directives in configuration applied through Nginx UI
  • New or modified JavaScript files in locations served to the Nginx worker process
  • MCP interface activity from accounts that normally do not perform configuration changes

Detection Strategies

  • Compare the active Nginx configuration against a known-good baseline and alert on new module-loading directives.
  • Audit Nginx UI logs for configuration write operations routed through the MCP endpoint path.
  • Monitor the Nginx worker process for unexpected child processes, outbound network connections, or file writes consistent with NJS execution.

Monitoring Recommendations

  • Forward Nginx UI application logs and Nginx error logs to a centralized log platform for correlation.
  • Track process ancestry of the Nginx worker to identify abnormal spawned processes after reloads.
  • Alert on any reload event that follows an MCP configuration change by a non-administrative account.

How to Mitigate CVE-2026-84319

Immediate Actions Required

  • Upgrade Nginx UI to version 2.4.1 or later, which enforces directive restrictions on the MCP configuration path.
  • Review all accounts with MCP access and revoke privileges that are not required for operational tasks.
  • Inspect current Nginx configurations for unauthorized load_module, js_import, and js_content directives.

Patch Information

The fix is published in GitHub Release v2.4.1 and detailed in the GitHub Security Advisory GHSA-5r62-gj48-897x. The remediation commit is available at GitHub Commit 23d1934 and introduces RequireSecureSession middleware across sensitive routes.

Workarounds

  • Disable the MCP configuration interface in deployments where it is not required.
  • Restrict network access to the Nginx UI management interface using firewall rules or a reverse proxy with strict allowlists.
  • Enforce least-privilege account policies so that secondary users cannot write configuration changes.
bash
# Verify installed Nginx UI version and upgrade if below 2.4.1
nginx-ui --version

# Example firewall restriction limiting access to the management interface
iptables -A INPUT -p tcp --dport 9000 -s 10.0.0.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 9000 -j DROP

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.