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

GHSA-CP4H-7PXC-XX3M

Self-check fix endpoint rewrites live nginx.conf without interactive secure-session step-up

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
5.4
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L 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
20 nov 26
22 oct 26
29 oct 26
6 nov 26
13 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-CP4H-7PXC-XX3M divulgada · CVSS 5.4 (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
`POST /api/self_check/:name/fix` triggers a self-check remediation that rewrites the live nginx.conf entry file on disk. The route carries no interactive secure-session (OTP/passkey) step-up, even though every other configuration-to-disk writer in Nginx-UI (settings, config, sites, streams) is gated by `RequireSecureSession`. A 2FA-enabled administrator session (or a leaked/stolen JWT) can therefore mutate the running nginx configuration without the re-authentication the project enforces on equivalent actions.

## Root Cause
The self-check router group is mounted without the step-up middleware:
- `g := r.Group("self_check")` at `api/system/router.go:37` is reached only through `AuthRequired()` + `Proxy()`; it has no `RequireSecureSession`.
- Config-writing siblings (`POST /settings`, `POST /config`, `POST /sites/:name`, stream writers) all carry `RequireSecureSession`.

`SelfCheckFix` → `self_check.AttemptFix(name)` → the task's `FixFunc` → `os.WriteFile(nginx.GetConfEntryPath(), ...)` in `internal/self_check/nginx_conf.go` (e.g. `FixNginxConfIncludeConfD`, `FixNginxConfIncludeSites`, `FixNginxConfIncludeStreams`). The write re-serializes the whole nginx.conf via a gonginx parse→dump round-trip and persists it unconditionally when the expected include directive is absent.

## Impact
Integrity drift of the live nginx configuration surface without the step-up that guards all other config writes (I:L — content constrained to standard `include ...;` directives plus a timestamped `.bak`). A lossy parse/dump round-trip can mangle the existing config so the next reload fails, and `.bak.<ts>` files accrue (A:L). Via `Proxy()` + `X-Node-ID` the same action reaches child cluster nodes.

Proof of Concept

POST /api/self_check/NginxConf-ConfD-Include/fix HTTP/1.1
Host: <controller>
Authorization: Bearer <valid JWT, no fresh X-Secure-Session-ID>

The live nginx.conf entry file is re-dumped and an `include .../conf.d/*;` directive injected (or a whole `http{}`/`stream{}` block appended if absent) with no re-authentication prompt.

## Attack Chain
1. Entry: `POST /api/self_check/NginxConf-ConfD-Include/fix` with a valid JWT of a 2FA-enabled admin WITHOUT a fresh `X-Secure-Session-ID`.
- Guard: `AuthRequired()` + `IPWhiteList()` (`api/system/router.go` bare `g` group; `routers.go:123`). Bypass proof: `AuthRequired` only proves JWT possession (no role gate); `IPWhiteList` is a no-op when `AuthSettings.IPWhiteList` is empty (default).
2. Routing: request reaches `SelfCheckFix` → `AttemptFix("NginxConf-ConfD-Include")`.
- Guard: should be `RequireSecureSession` as on config-writer siblings. Bypass proof: the `self_check` group at `api/system/router.go:37` has no middleware; `routers.go:123` mounts `InitPrivateRouter` on bare `g` (`AuthRequired()`+`Proxy()` only).
3. Sink: `FixNginxConfIncludeConfD()` re-serializes and `os.WriteFile`s the live nginx.conf entry file (`internal/self_check/nginx_conf.go`), injecting `include .../conf.d/*;`.
- Guard: none on this path. Bypass proof: write is unconditional once the task runs; no `X-Secure-Session-ID` is demanded, unlike the gated siblings.
4. Impact: live nginx.conf rewritten / conf directories created without the OTP step-up that guards all other config writes.

## Bypass Evidence
`grep` across `api/` shows `RequireSecureSession` present on settings/config/sites/streams writers but absent from both self_check groups. Task registry (`internal/self_check/tasks.go`) confirms the write sinks are reachable through the fixable task keys. Code verified present on release tag v2.8.4: `git show v2.8.4:api/system/router.go` shows `g := r.Group("self_check")` with no step-up.

## Affected Versions
`<= 2.8.4` (verified byte-identical v2.8.4 → HEAD; no post-release fix).

## Suggested Fix
Mount the `self_check` fix routes under `RequireSecureSession` (and `RejectInDemo`) as the other configuration-to-disk writers are, so remediation that rewrites nginx.conf requires a fresh interactive secure session.

---
Reported by zx (Jace) — GitHub: @manus-use

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:N
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:L
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-cp4h-7pxc-xx3m

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