llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/0xJacky/Nginx-UI

GHSA-VXXJ-X4X4-Q624

Config Directive Validation Bypass via Data File Extensions Allows Injection of Blocked Directives

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
8.8
Alta
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición29 dDesde la divulgación, 22 oct 2026, 1:59 a. m.
Detección27 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
22 oct 26
18 nov 26
21 nov 26
22 oct 26
29 oct 26
6 nov 26
13 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-VXXJ-X4X4-Q624 divulgada · CVSS 8.8 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

Files with data extensions (.pem, .key, .crt, .cer, .csr, .crl, .ca-bundle, .htpasswd) skip the config directive validation entirely, allowing any blocked directive to be written and then loaded via nginx `include`. This renders the entire blocklist security control useless — all 8 extensions bypass all blocked directives.

Details

nginx-ui implements a directive blocklist in `internal/config/validation.go` that prevents users from writing dangerous nginx directives (such as `js_content`, `perl_set`, `lua_package_path`) through the config editor API. The existence of this blocklist proves the maintainer considers authenticated users a threat to configuration integrity — otherwise there would be no reason to restrict what they can write.

However, files with data extensions (`.pem`, `.key`, `.crt`, `.cer`, `.csr`, `.crl`, `.ca-bundle`, `.htpasswd`) skip the directive validation entirely. At `validation.go` line 198:

if IsDataFile(path) {
    return ValidateDataContent([]byte(content))
}

`ValidateDataContent` only checks for binary/null bytes — it does not check for dangerous nginx directives.

Since the `include` directive is not blocked (and cannot be, as it is essential for nginx operation), an attacker can:

  1. Write any blocked directive into a file with a data extension (e.g., `malicious.pem`)
  2. Write a normal `.conf` file that includes the data file: `include malicious.pem;`
  3. nginx parses the included file as configuration regardless of its extension

This completely renders the entire directive blocklist useless. Even if individual entries are added to fix gaps, this architectural bypass remains functional. Every current and future blocklist entry can be circumvented through any of the 8 data file extensions.

Root Cause

| File | Line | Issue |
|------|------|-------|
| `internal/config/validation.go` | 198 | `IsDataFile()` causes early return, skipping directive validation |
| `internal/config/validation.go` | 199 | `ValidateDataContent()` only checks for binary bytes, not directives |
| `internal/config/validation.go` | 131-167 | Blocklist exists but is architecturally bypassable |

Extensions that bypass (8/8 tested)

`.pem`, `.crt`, `.cer`, `.key`, `.csr`, `.crl`, `.ca-bundle`, `.htpasswd`

Proof of concept

Step 1: Authenticate as any user (nginx-ui has no RBAC — all users are admin).

Step 2: Write a blocked directive (`js_content`) to a `.pem` file — blocklist bypassed:

POST /api/configs
Content-Type: application/json

{"name": "evil.pem", "base_dir": "", "content": "js_content exploit_handler;\n", "overwrite": true}

Result: HTTP 200 — blocklist bypassed!

Step 3: Verify the same directive IS blocked in a `.conf` file:

POST /api/configs

{"name": "evil.conf", "base_dir": "", "content": "server { location / { js_content exploit_handler; } }", "overwrite": true}

Result: HTTP 500 — blocked by directive validation.

Step 4: Write a `.conf` that includes the `.pem`:

POST /api/configs

{"name": "site.conf", "base_dir": "sites-available", "content": "server {\n    listen 8888;\n    include evil.pem;\n}", "overwrite": true}

Result: HTTP 200 — include is not blocked.

Step 5: Enable the site and run `nginx -t` — the blocked directive is now active in nginx's configuration.

All 8 data extensions tested and confirmed to bypass: `.pem`, `.crt`, `.cer`, `.key`, `.csr`, `.crl`, `.ca-bundle`, `.htpasswd`. Full automated PoC tested on Docker (nginx-ui latest).

Impact
  • Complete blocklist bypass: ALL blocked directives (js_*, perl_*, lua_package_path, etc.) can be injected through any of the 8 data file extensions
  • On systems with scripting modules (njs, Perl, Lua/OpenResty): Remote Code Execution
  • The blocklist provides zero actual protection against a deliberate attacker — it is security theater
  • Defense in depth failure: Even if every individual directive gap is patched, this bypass makes ALL future blocklist additions useless
  • The blocklist's existence proves the threat model: if authenticated users were fully trusted with configuration, there would be no blocklist. Its presence demonstrates the maintainer considers directive injection a threat worth blocking — this bypass defeats that control entirely.

Suggested Fix

Option A (recommended): Apply directive validation to all files regardless of extension:

// Always check for blocked directives, even in data files
if err := ValidateConfigDirectives(content); err != nil {
    return err
}
if IsDataFile(path) {
    return ValidateDataContent([]byte(content))
}

Option B: Validate included file content transitively — when a config references `include <path>`, validate the included file's content against the blocklist.

Option C: Restrict `include` to only allow `.conf` files that have passed validation.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
github.com/0xJacky/Nginx-UI< 2.9.0
v1.9.9
2.9.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gogithub.com/0xJacky/Nginx-UI
Sin parche — — v1.9.9 afectada
Versiones corregidas2.9.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/0xJacky/nginx-ui/security/advisories/GHSA-vxxj-x4x4-q624

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.