AIDEFEND in Action AIA-0158 Incident

MCPwn: An nginx-ui MCP Endpoint Without Authentication Lets Callers Rewrite Nginx Configuration

nginx-ui, an open-source web interface for managing Nginx, includes an MCP (Model Context Protocol) interface that lets AI assistants edit configuration and reload the server through tool calls. Pluto Security found that the endpoint that opens an MCP session checked credentials, while /mcp_message, which receives every tool call, checked only an IP allowlist that is empty, and therefore open to everyone, by default (CVE-2026-33032). Reporting says attackers get a session with a credential taken through a second flaw, CVE-2026-27944, an unauthenticated backup download in versions before 2.3.3. Recorded Future lists CVE-2026-33032 as exploited in March 2026, without attack details.

Authentication BypassCredential ExposureIdentity & AccessAI Deployment SecurityMCP Security
7 applicable AIDEFEND defenses

Threat Analysis

  • Two endpoints, one login check. nginx-ui's MCP interface offered 12 tools, among them nginx_config_add, which writes a configuration file and reloads Nginx in the same call. Its transport used two HTTP endpoints: a client sends GET /mcp to open an event stream and receives a message URL with a session ID, then sends every tool call as a POST to /mcp_message. Through version 2.3.3, /mcp was registered with an IP allowlist and the product's login check, AuthRequired(), while /mcp_message had the allowlist only. That allowlist is empty by default, and an empty list lets every request through.
  • How a caller with no account gets a session. The POST needs a valid session ID, and /mcp does check credentials: in the affected releases, a shared node secret presented in a request parameter. The Hacker News reports that attackers can obtain it through CVE-2026-27944, and Rapid7 describes the same chain. Before version 2.3.3, /api/backup returned a full backup to anyone, with the AES key and IV in the X-Backup-Security response header. The maintainer's advisory lists the nginx-ui database, app.ini with its secrets, and SSL private keys among the contents; The Hacker News adds that the node secret is there too. The chain: decrypt the backup, open a session with the node secret, then call tools with no credential.
  • What the lab run showed. In a lab environment, Pluto's researchers sent POST requests from a separate container with a session ID and no credential, listed all 12 tools, read nginx.conf, wrote a new server block, and saw Nginx reload and serve the injected content. The advisory adds what such control could be used for: proxying traffic through an attacker's server, logging Authorization headers, or stopping the service with an invalid configuration. Those outcomes were described, not demonstrated.
  • What is known about real attacks. Recorded Future's Insikt Group lists CVE-2026-33032 among 31 vulnerabilities that its data shows were exploited in March 2026, and Rapid7 relays a PurpleOps report that ties the exploitation to CVE-2026-27944 as a chain. No source says who was attacked or which tools were called, so the steps above are the published attack path and the lab reproduction, not a reconstructed intrusion. Pluto counted 2,689 instances reachable from the Internet, most on port 9000; that figure counts reachable instances, not vulnerable ones.
  • Versions, and why the records disagree. Commit 413dc63 adds AuthRequired() to /mcp_message with a test that expects HTTP 403 from both endpoints; it shipped in 2.3.4 on 15 March 2026. The tagged source agrees with Pluto: 2.3.3 lacks the check, and 2.3.4 has it. The CVE record nevertheless says versions 2.3.5 and earlier are affected, and an alert from Singapore's Cyber Security Agency says versions before 2.3.6. Rapid7 advises installing the latest release to sidestep the discrepancy. The backup flaw affects versions before 2.3.3 and is fixed in 2.3.3. The current guide describes scoped service tokens (mcp:read, mcp:write).

Applicable AIDEFEND Defenses (7)

AID-H-003.010
Deployed AI Software Vulnerability Remediation Lifecycle
Very High
Replacing every running nginx-ui with a fixed release closes both unauthenticated entry points: 2.3.3 puts the login check on the backup download, and 2.3.4 adds it to /mcp_message (commit 413dc63). Public records disagree on the fixed version, so move to the current release and confirm with an unauthenticated request. Upgrading does not invalidate a node secret or private key copied earlier. Where the upgrade has to wait, apply a dated temporary control: a non-empty IP allowlist in nginx-ui, or a block on /mcp and /mcp_message in front of it. Allowlisted hosts can still call the tools without credentials.
AID-I-002.001
Internal AI Network Segmentation
High
Every request in this chain has to reach the nginx-ui listener (port 9000 by default). If firewall or security-group rules allow inbound traffic only from the administrator and agent hosts that need it, other hosts can reach neither the backup download nor the MCP endpoints, and a copied node secret is useless to them. Permitted hosts can still exploit the flaw, so this narrows who can attack without repairing the missing check.
AID-H-034.001
MCP Server Deployment Profile, Transport & Exposure Baseline
High
An MCP server that can rewrite and reload Nginx should not be reachable beyond the local host unless every MCP endpoint demands authentication. Before exposing the interface, and after each upgrade, send unauthenticated requests from another host to /mcp and /mcp_message and stop the rollout unless both answer with an authorization failure. Release 2.3.3 fails that test. The guidance is written for Streamable HTTP; the older two-endpoint transport needs its message endpoint tested too.
AID-H-034.003
Server-Side Tool Invocation Validation & Object-Level Authorization
High
The tool handler should decide on every call, from an authenticated identity and its scope, whether the caller may read or change configuration. In the vulnerable releases it ran nginx_config_get and nginx_config_add for requests that carried no identity. Teams that build MCP servers own this check. On current nginx-ui releases, operators can issue mcp:read service tokens, which the guide limits to read-only tools, and reserve mcp:write for clients that must change configuration.
AID-E-001.001
Root & Long-Lived Credential Object Eviction
High
If an instance below 2.3.3 was reachable from other hosts, assume the backup was taken: replace the node secret, the other app.ini secrets, user passwords and SSL private keys, and revoke the old certificates. The node secret matters most: the 2.3.3 login check accepts it, and the fix applies that same check to /mcp_message, so a copied secret will likely still pass after the upgrade until it is replaced. Sessions issued earlier need separate invalidation.
AID-E-003.003
Confirmed Malicious Code & Persistence Eviction
High
A server block written through the MCP tools keeps working after the endpoint is patched. Once an unfamiliar file under conf.d or sites-enabled is confirmed as unauthorized, keep a copy as evidence, remove it from the directory and from any backup that would restore it, reload Nginx, and confirm with nginx -T that it is gone. This needs a trusted baseline and does not recover traffic or credentials that already passed through the block.
AID-M-001.005
Public AI Endpoint & Agent-Service Exposure Discovery
Medium
Pluto found 2,689 Internet-facing nginx-ui instances with a favicon fingerprint, most on port 9000, which a scan limited to 80 and 443 never touches. An organization can run the same authorized, read-only probe against its own address ranges and reconcile the hits with its asset inventory. An authentication error from /mcp says nothing about /mcp_message, so check each path separately. Discovery finds exposed or forgotten instances; the upgrade and the network restriction close them.

What Defenders Should Do Now

  • Find every nginx-ui instance and upgrade. Include containers started from the uozi/nginx-ui image and forgotten instances on port 9000. If the running version is 2.3.3 or earlier, move to the current release. If that cannot happen today, set a non-empty IP allowlist or block /mcp and /mcp_message in front of nginx-ui, with an end date for the exception.
  • Verify by behavior, not by version string. From another host, send requests with no credentials: a POST to /mcp and to /mcp_message, and a GET to /api/backup. All three must return an authorization failure (HTTP 403 on fixed releases). Any other answer means the request got past the login check.
  • Take the management port off networks that do not need it. Allow inbound connections only from the administrator and agent hosts that use it, then test from an unlisted host and confirm that the connection fails.
  • If an instance was reachable while it ran a version before 2.3.3, treat its backup as copied. Replace the node secret and the other secrets in app.ini, reset passwords, reissue the SSL keys and certificates, and revoke the old certificates. Confirm that the old node secret is refused. Upgrading does not change a secret that someone already holds.
  • Look for configuration you did not write. Compare conf.d, sites-enabled and nginx.conf with your approved configuration. If a server block or log format has no change record, keep a copy as evidence, remove it, reload Nginx, and confirm with nginx -T that it is gone.
  • On current releases, issue the smallest token scope. Give assistants that only inspect configuration an mcp:read token, and confirm that it is refused when it calls nginx_config_add.

2 additional considerations

File-integrity monitoring for the Nginx configuration directory

The team that runs Nginx can watch conf.d, sites-enabled and nginx.conf for files that no approved change produced. nginx-ui's MCP tools write directly into these directories, so a new or modified file with no matching change record is an early sign of unauthorized use, whichever endpoint was abused.
Recommendation: Keep the approved configuration in version control or a deployment source, run file-integrity monitoring on the directory, and compare every change with an approved change record. Notify the operator on duty when a file appears without one. This detects a write after it happens and does not block it, and it needs a baseline taken before any exposure.

Request logging in front of the management listener

A reverse proxy or load balancer placed in front of nginx-ui can record every request to /api/backup, /mcp and /mcp_message, with the source address and whether an Authorization header was present.
Recommendation: Log the method, path, source address and response status for these paths, store the logs away from the nginx-ui host, and review them for requests to /mcp_message from unexpected sources and for backup downloads outside maintenance windows. The log shows where a call came from and helps decide whether a backup was downloaded. It does not show which tool was invoked unless request bodies are recorded too, and those may contain configuration content.

Conclusion

MCPwn came down to one route registered without the login check the rest of the product already had, and that route executes every tool. AIDEFEND  maps this path to four defensive positions: replace the vulnerable release and prove that both MCP endpoints refuse an unauthenticated request; keep the management port reachable only from the hosts that need it; decide each tool call from an authenticated identity and its scope; and, where an instance was exposed, replace the copied node secret and remove injected configuration. For teams adding MCP to an existing product, the lesson is to test authentication on every endpoint of the transport, the message endpoint included.

Last updated: