/

CVE-2026-84317

Severity:

HIGH RISK

(8.8)

Improper Input Validation (CWE-20) in Nginx UI MCP Tool

CVE-2026-84317

Deferred

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20, CWE-693

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Nginx UI fails to apply its directive-validation security control on one MCP configuration-write path, allowing supplied content to be written to disk and loaded by Nginx. An authenticated MCP caller, or an MCP agent influenced through prompt injection, may inject restricted directives and achieve code execution when the relevant Nginx modules are available.

Nginx UI fails to apply its directive-validation security control on one MCP configuration-write path, allowing supplied content to be written to disk and loaded by Nginx. An authenticated MCP caller, or an MCP agent influenced through prompt injection, may inject restricted directives and achieve code execution when the relevant Nginx modules are available.

Affected context

The issue occurs in deployments using Nginx UI's MCP configuration tools when the nginx_config_add path accepts caller-controlled configuration content without invoking the validation control used by other configuration-write paths. Exploitation is more likely where Nginx has the njs or Perl module available and the MCP interface is accessible to an authenticated user or an agent operating with configuration privileges.

The issue occurs in deployments using Nginx UI's MCP configuration tools when the nginx_config_add path accepts caller-controlled configuration content without invoking the validation control used by other configuration-write paths. Exploitation is more likely where Nginx has the njs or Perl module available and the MCP interface is accessible to an authenticated user or an agent operating with configuration privileges.

Exploit preconditions

  • Attack surface: Nginx UI's MCP configuration-add tool
  • Required access: Authenticated access to the MCP interface, or the ability to influence an MCP agent that has such access
  • Trigger point: Writing supplied Nginx configuration content followed by an Nginx reload
  • Required environment: The target must permit the relevant restricted directives and have the associated Nginx module available
  • Why exploitation is possible: One configuration-write path bypasses the directive validation applied to other paths
  • Attack surface: Nginx UI's MCP configuration-add tool
  • Required access: Authenticated access to the MCP interface, or the ability to influence an MCP agent that has such access
  • Trigger point: Writing supplied Nginx configuration content followed by an Nginx reload
  • Required environment: The target must permit the relevant restricted directives and have the associated Nginx module available
  • Why exploitation is possible: One configuration-write path bypasses the directive validation applied to other paths

Why this happens

The underlying defect is inconsistent enforcement of an input-validation security control across equivalent configuration-write paths. Although ValidateConfigFile blocks dangerous directives in several handlers, the MCP configuration-add handler writes caller-controlled content without applying the same check. This maps primarily to CWE-20: Improper Input Validation and is also related to CWE-693: Protection Mechanism Failure, because a security mechanism exists but is not enforced at every relevant entry point.

The underlying defect is inconsistent enforcement of an input-validation security control across equivalent configuration-write paths. Although ValidateConfigFile blocks dangerous directives in several handlers, the MCP configuration-add handler writes caller-controlled content without applying the same check. This maps primarily to CWE-20: Improper Input Validation and is also related to CWE-693: Protection Mechanism Failure, because a security mechanism exists but is not enforced at every relevant entry point.

Potential impact

  • An attacker may cause Nginx to load restricted directives
  • Nginx worker processes could execute attacker-controlled code when compatible modules are enabled
  • The attacker could compromise the Nginx UI host or container
  • Sensitive configuration data or credentials could be exposed
  • The compromised service could be used for further access within the deployment
  • An attacker may cause Nginx to load restricted directives
  • Nginx worker processes could execute attacker-controlled code when compatible modules are enabled
  • The attacker could compromise the Nginx UI host or container
  • Sensitive configuration data or credentials could be exposed
  • The compromised service could be used for further access within the deployment

General mitigation guidance

Mitigation generally focuses on applying the same validation and policy enforcement to every configuration mutation path, including MCP tools and future integration points.

Common defensive patterns include:

  • Enforcing centralized, fail-closed configuration validation before writing or reloading files
  • Using an allowlist of permitted directives rather than relying only on blocked patterns
  • Reducing trust in agent-generated or user-supplied configuration content
  • Restricting access to MCP tools and separating read-only and configuration-changing capabilities
  • Running Nginx and the management interface with least privilege and limiting available modules where practical
  • Requiring review or approval for configuration changes that can trigger service reloads

Mitigation generally focuses on applying the same validation and policy enforcement to every configuration mutation path, including MCP tools and future integration points.

Common defensive patterns include:

  • Enforcing centralized, fail-closed configuration validation before writing or reloading files
  • Using an allowlist of permitted directives rather than relying only on blocked patterns
  • Reducing trust in agent-generated or user-supplied configuration content
  • Restricting access to MCP tools and separating read-only and configuration-changing capabilities
  • Running Nginx and the management interface with least privilege and limiting available modules where practical
  • Requiring review or approval for configuration changes that can trigger service reloads

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis checks confirming that every configuration-write handler invokes the same validation policy
  • Code review searches for direct file writes followed by reload operations
  • Tests that submit restricted directives through each API, MCP, and automation path
  • Policy checks preventing configuration changes unless validation succeeds
  • Runtime monitoring for unexpected Nginx configuration changes, reloads, module directives, or process behavior
  • Automated security review tools that identify inconsistent protection checks across equivalent entry points

Organizations can look for this class of issue through:

  • Static analysis checks confirming that every configuration-write handler invokes the same validation policy
  • Code review searches for direct file writes followed by reload operations
  • Tests that submit restricted directives through each API, MCP, and automation path
  • Policy checks preventing configuration changes unless validation succeeds
  • Runtime monitoring for unexpected Nginx configuration changes, reloads, module directives, or process behavior
  • Automated security review tools that identify inconsistent protection checks across equivalent entry points

Sources

SourceLink
github.comgithub.com/0xJacky/nginx-ui/commit/23d1934099b05b2a01589b48129dc3d3159d91c2
github.comgithub.com/0xJacky/nginx-ui/releases/tag/v2.4.1
github.comgithub.com/0xJacky/nginx-ui/security/advisories/GHSA-76pm-mq2q-9gcr

Frequently asked

questions

It can be exploitable remotely through the MCP interface when that interface is reachable and the attacker has suitable authenticated access or can induce an MCP agent to perform the change.

It requires whatever permissions allow the caller or agent to invoke the affected configuration tool. The exact scope depends on how MCP authentication and authorization are deployed.

Apply centralized, fail-closed validation to every configuration-write path before content is persisted or reloaded, preferably using an allowlist of accepted directives.

Treat all user- and agent-supplied configuration as untrusted, test security controls across every interface, limit reload privileges, and monitor configuration changes and module usage.

It can be exploitable remotely through the MCP interface when that interface is reachable and the attacker has suitable authenticated access or can induce an MCP agent to perform the change.

It requires whatever permissions allow the caller or agent to invoke the affected configuration tool. The exact scope depends on how MCP authentication and authorization are deployed.

Apply centralized, fail-closed validation to every configuration-write path before content is persisted or reloaded, preferably using an allowlist of accepted directives.

Treat all user- and agent-supplied configuration as untrusted, test security controls across every interface, limit reload privileges, and monitor configuration changes and module usage.

Find out what's already
exploitable in your codebase.