6.9medium
Nginx UI: Improper Path Validation Allows Recursive Deletion of the Nginx Configuration Directory
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.46% (higher than 41% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-m8p8-53vf-8357GO-2026-4907
Description
Nginx UI is a web user interface for the Nginx web server. Prior to version 2.3.4, 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. This issue has been patched in version 2.3.4.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| 0xJacky nginx-ui | < 2.3.4 | CVE List |
| github.com/0xJacky/Nginx-UI (Go) | up to 1.99, all versions | GitHub Advisory Database, Go Vulnerability Database |
| nginxui nginx_ui | before 2.3.4 | NVD |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
Nginx UI is a web user interface for the Nginx web server. Prior to version 2.3.4, 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. This issue has been patched in version 2.3.4.
GitHub Advisory Database
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:
- Traversal sequences are not rejected.
- Double-encoding (
..%252F) is used to bypass initial shallow filters. - The clamping mechanism resolves malicious paths to the base configuration directory.
- The deletion handler recursively deletes the resolved path.
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:
- Improper Path Canonicalization: URL-encoded traversal sequences are not properly rejected.
- Unsafe Fallback Logic: The
GetConfPathclamping mechanism returns the base configuration directory when traversal is detected instead of rejecting the request. - Unsafe Deletion Primitive: The deletion handler invokes
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
- Server OS: Kali Linux 6.17.10-1kali1 (6.17.10+kali-amd64)
- Nginx UI Version: nginx-ui v2.3.3
- Deployment: Docker / Default installation
Proof of Concept
Steps to Reproduce
-
Log into nginx-ui.
-
Go to Manage Configs and create a Folder named ..%252F..%252F..%252F..%252Ftest
image -
Observe that the backend resolves the path to /etc/nginx..
-
Now lets create a file called testing.
-
Save it and rename it to ..%252F..%252F..%252F..%252Ftest (It is not possible to create it directly with the payload name so we have to rename it)
-
Go back to manage configs and Click Delete to remove the file we just created.
-
Check that there is an error:
image -
Reload the website and check that the /etc/nginx folder has been completely removed:
image
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:
- Immediate failure of the Nginx service due to missing configuration files.
- Loss of all Nginx configuration managed by nginx-ui.
- Denial of Service for all web services relying on the affected Nginx instance.
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.
Go Vulnerability Database
Nginx Configuration Directory Vulnerable to Recursive Deletion via Improper Path Validation in github.com/0xJacky/Nginx-UI
NVD (es)
Nginx UI es una interfaz de usuario web para el servidor web Nginx. Antes de la versión 2.3.4, la configuración de nginx-ui maneja incorrectamente las secuencias de recorrido codificadas en URL. Cuando se proporcionan rutas especialmente diseñadas, el backend las resuelve al directorio base de configuración de Nginx y ejecuta la operación en el directorio base (/etc/nginx). En particular, esto permite a un usuario autenticado eliminar todo el directorio /etc/nginx, lo que resulta en una Denegación de Servicio parcial. Este problema ha sido parcheado en la versión 2.3.4.
References
| https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-m8p8-53vf-8357 | advisory, exploit, vendor-advisory, web | |
| https://github.com/0xJacky/nginx-ui/releases/tag/v2.3.4 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-33027 | advisory | |
| https://github.com/0xJacky/nginx-ui | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-33027 changed 2026-03-30 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-m8p8-53vf-8357 changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-4907 changed 2026-04-02 | CC-BY-4.0 |
| NVD | CVE-2026-33027 changed 2026-06-17 | Public domain |