github.com/0xJacky/Nginx-UI
Affected
- introduced
0, last affected1.99(ecosystem)
Fixed versions
None listed
Fix
No fixed version is listed.
Advisory
Also known as: CVE-2026-33027, GO-2026-4907
Nginx Configuration Directory Vulnerable to Recursive Deletion via Improper Path Validation
Summary
The nginx-ui configuration improperly handles URL-encoded traversal sequences. When specially crafted paths are supplied, the backend resolves them to the base Nginx configuration directory and executes the operation on the base directory (/etc/nginx). In particular, this allows an authenticated user to remove the entire /etc/nginx directory, resulting in a partial Denial of Service.
Details
The file deletion logic fails to correctly validate and normalize paths containing URL-encoded traversal sequences such as ..%252F.
When such input is processed, the internal path resolution logic attempts to clamp the path into the allowed configuration directory. Instead of rejecting the traversal attempt, the clamping mechanism resolves the path to the base Nginx configuration directory itself.
Because the deletion handler invokes os.RemoveAll, which recursively removes directories, this results in the deletion of the entire /etc/nginx directory.
This behavior creates a dangerous interaction between path normalization and deletion logic:
..%252F) is used to bypass initial shallow filters.As a result, an attacker can trigger deletion of the entire Nginx configuration directory instead of being blocked by path validation logic.
Root Cause
The vulnerability results from a combination of design flaws:
GetConfPath clamping mechanism returns the base configuration directory when traversal is detected instead of rejecting the request.os.RemoveAll, which recursively deletes directories without additional safeguards. (delete.go) // Delete the file or directory
err = os.RemoveAll(fullPath)
if err != nil {
cosy.ErrHandler(c, err)
return
}
This interaction causes the deletion operation to target the most sensitive directory when a traversal attempt occurs.
Environment
Proof of Concept
Steps to Reproduce
<img width="1608" height="559" alt="image" src="https://github.com/user-attachments/assets/738d7d65-7e13-48fa-affc-d5509c43900f" />
<img width="1578" height="696" alt="image" src="https://github.com/user-attachments/assets/51a36310-0676-4fe5-b80c-e0199498efbf" />
<img width="1313" height="722" alt="image" src="https://github.com/user-attachments/assets/0a9ddd1b-786b-4cf2-8abd-1dc6f3a77807" />
Impact
An authenticated user capable of invoking the configuration deletion endpoint can trigger the recursive deletion of the entire Nginx configuration directory (/etc/nginx).
This results in:
As the deletion operation uses a recursive filesystem call, the entire configuration directory is removed, leaving the system unable to restart Nginx until the configuration is manually restored.
A patched version is available at https://github.com/0xJacky/nginx-ui/releases/tag/v2.3.4.
Medium Basis: The source's own band: MODERATE
0, last affected 1.99 (ecosystem)None listed
No fixed version is listed.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0