Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
nginx-ui-CVE-2026-42221-CVE-2026-42238- — Docker-based lab environment to verify and exploit two unauthenticated API vulnerabilities (CVE-2026-42221, CVE-2026-42238) in nginx-ui, with patched version comparison and educational write-up. | Kitploit
Tools/GitHubGitHub/fuchiuebusi-lab/nginx-ui-cve-2026-42221-cve-2026-42238-
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationLabs & Practice
GitHubfuchiuebusi-lab/nginx-ui-cve-2026-42221-cve-2026-42238-

nginx-ui-CVE-2026-42221-CVE-2026-42238-

Docker-based lab environment to verify and exploit two unauthenticated API vulnerabilities (CVE-2026-42221, CVE-2026-42238) in nginx-ui, with patched version comparison and educational write-up.

View Repository
112 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

nginx-ui CVE Verification Environment

This repository is for actually verifying two CVEs reported for nginx-ui (Nginx's Web GUI management tool) in a Docker environment.

  • CVE-2026-42221: Unauthenticated administrator account takeover
  • CVE-2026-42238: Command execution via unauthenticated backup restoration

Disclaimer
The verification content of this repository is intended only for isolated local environments that I manage.
Using similar methods on third-party systems without permission violates the Unauthorized Computer Access Law.


Detailed Article

The verification process, considerations, and lessons learned are summarized in a Qiita article.

Actually trying out the nginx-ui CVEs: "Vulnerability" turned out to be a design story


Vulnerability Overview

CVESummaryAffected VersionsFixed Versions
CVE-2026-42221/api/install before setup is accessible without authentication. An attacker can register an admin account firstv2.3.7 and earlierv2.3.8
CVE-2026-42238/api/restore before setup is accessible without authentication. Arbitrary commands can be executed as root by injecting a malicious app.iniv2.3.7 and earlierv2.3.8

The two CVEs share the same root cause (the API window before setup is unprotected). In v2.3.8, both were fixed by introducing an installation secret method and adding a single middleware.


Directory Structure

root@kitploit:~
.
├── nginx_lab/              # Vulnerable version (v2.3.7) verification environment → port 8080
│   ├── Dockerfile          # Image definition with initial settings to avoid startup loop
│   ├── docker-compose.yml
│   ├── nginx.conf          # Configuration with corrected sites-enabled / stream blocks
│   ├── init-app.ini        # Initial template for app.ini
│   └── entrypoint.sh       # Initialization script at container startup
├── nginx_lab_patched/      # Patched version (v2.3.8) verification environment → port 8081
│   ├── Dockerfile
│   ├── docker-compose.yml
│   ├── nginx.conf
│   ├── init-app.ini
│   └── entrypoint.sh
├── scripts/
│   ├── exploit_42221.py    # Attack script for CVE-2026-42221
│   ├── encrypt_password.py # RSA encryption utility
│   └── test_patched.py     # Script to verify patch application on v2.3.8 (port 8081)
├── Qiita.md                # Qiita draft manuscript
└── LearningPlan.md

Prerequisites

  • Docker / Docker Compose
  • Python 3.x
  • pycryptodome library
root@kitploit:~
pip install pycryptodome

Usage

1. Start the Vulnerable Version (v2.3.7)

root@kitploit:~
cd nginx_lab
docker compose build
docker compose up -d

Check startup:

root@kitploit:~
curl http://localhost:8080/api/install
# → OK if {"lock":false,"timeout":false} is returned

Gotcha: The base uozi/nginx-ui:v2.3.7 image will enter a startup loop as-is because directories like sites-enabled do not exist. The Dockerfile in this repository prepares these in advance.

2. Reproduce CVE-2026-42221

root@kitploit:~
cd scripts
python exploit_42221.py

If successful, you can log in to http://localhost:8080 with the attacker account.

3. Start the Patched Version (v2.3.8)

root@kitploit:~
cd nginx_lab_patched
docker compose build
docker compose up -d

In v2.3.8, the first-time setup requires an installation secret. After starting the container, check the secret.

root@kitploit:~
docker exec nginx-ui-patched cat /etc/nginx-ui/.install_secret

Use this value in the setup screen at http://localhost:8081 to register an administrator.

4. Verify That the Attack Fails on the Patched Version

root@kitploit:~
cd scripts
python test_patched.py

If [OK] Attack failed (patched) is output, the patch is working correctly.

5. Clean Up the Environment

root@kitploit:~
# Vulnerable version
cd nginx_lab
docker compose down -v

# Patched version
cd nginx_lab_patched
docker compose down -v
Download Tool