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

GHSA-QQ4P-5M6W-WW57

Node Secret Leaked in nginx Access Logs via Query String Authentication

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
9.6
Crítica
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición99 dDesde la divulgación, 11 ago 2026, 9:42 p. m.
Detección98 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
12 ago 26
18 nov 26
20 nov 26
12 ago 26
6 sept 26
1 oct 26
26 oct 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-QQ4P-5M6W-WW57 divulgada · CVSS 9.6 (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

`isTrustedNodeRequest()` in `internal/middleware/websocket_origin.go` accepts
the cluster node secret via the URL query string parameter `node_secret`.
Because nginx-ui is the application that manages nginx — and nginx logs all
requests including query strings to its access log by default — the secret
is written in plaintext to a log file that nginx-ui itself exposes via its
own log-reading API endpoints. Any authenticated user with log-read access
can retrieve the node secret and use it to bypass all WebSocket authentication.

Details

The vulnerable code in `isTrustedNodeRequest()`:

func isTrustedNodeRequest(r *http.Request) bool {
secret := strings.TrimSpace(r.Header.Get("X-Node-Secret"))
if secret == "" {
secret = strings.TrimSpace(r.URL.Query().Get("node_secret")) // ← written to nginx logs
}
return secret != "" && secret == settings.NodeSettings.Secret
}

When a child node connects to the master via WebSocket, it may authenticate
using a URL such as:

ws://master:9000/api/cluster/ws?node_secret=s3cr3t-cluster-key

nginx (acting as a reverse proxy in front of nginx-ui, per the official
deployment documentation) logs this request to its access log:

192.168.1.10 - - [02/May/2026:10:00:00 +0000] "GET
/api/cluster/ws?node_secret=s3cr3t-cluster-key HTTP/1.1" 101 0 ...

nginx-ui then exposes these logs through two endpoints registered in
`router/routers.go`:

// HTTP polling
nginxLog.InitRouter(g) // GET /api/nginx_log — AuthRequired only

// Real-time streaming
nginxLog.InitWebSocketRouter(w) // WS /api/nginx_log — AuthRequiredWS only

Both endpoints require only a valid user token — there is no additional
role-based access control restricting log access to administrators only.

Attack Scenario — Privilege Escalation

  1. Attacker authenticates as any valid nginx-ui user (e.g. a read-only user).
  2. Attacker calls GET /api/nginx_log or opens the WebSocket log stream.
  3. Attacker searches the nginx access log for requests containing `node_secret=`.
  4. Attacker extracts the plaintext secret.
  5. Attacker uses the secret in `X-Node-Secret` header or `?node_secret=` query

GET /api/analytic HTTP/1.1
Upgrade: websocket
X-Node-Secret: s3cr3t-cluster-key

  1. `isTrustedNodeRequest()` returns true.
  2. `CheckWebSocketOrigin()` returns true — Origin check is completely skipped.
  3. `AuthRequiredWS()` grants full access as the cluster init user.

The attacker has escalated from a low-privilege user to full cluster-level
access without knowing any admin credentials.

Secondary Exposure Vectors

Beyond nginx access logs, `node_secret` in the query string is also exposed via:

  • nginx-ui's own internal audit log (audit.LoggingMiddleware is applied
  • Any intermediate HTTP proxy or load balancer between nodes
  • Browser history if the WebSocket URL is ever constructed client-side
  • Referrer headers if the page performs any redirect before the upgrade

Root Cause

The fallback to query string authentication was added to support WebSocket
connections from child nodes in cluster mode, where setting custom headers
may be inconvenient. However, query string secrets are inherently unsafe
because HTTP infrastructure (proxies, loggers, CDNs) treats query parameters
as part of the URL and logs them by default.

Recommended Fix

Remove the query string fallback entirely. The `X-Node-Secret` header is
already supported and is not logged by default:

func isTrustedNodeRequest(r *http.Request) bool {
secret := strings.TrimSpace(r.Header.Get("X-Node-Secret"))
// Do NOT fall back to r.URL.Query().Get("node_secret")
return secret != "" && secret == settings.NodeSettings.Secret
}

If query string support is required for legacy clients, at minimum:
- Exclude requests containing `node_secret` from nginx access log using
log_format with a conditional, and document

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:C
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
github.com/0xJacky/Nginx-UI≥ 2.0.0 < 2.5.0
v1.9.9
2.0.0
2.5.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 no afectada
Versiones corregidas2.5.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-qq4p-5m6w-ww57

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