GHSA-QQ4P-5M6W-WW57
Node Secret Leaked in nginx Access Logs via Query String Authentication
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| 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 |
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
- Attacker authenticates as any valid nginx-ui user (e.g. a read-only user).
- Attacker calls GET /api/nginx_log or opens the WebSocket log stream.
- Attacker searches the nginx access log for requests containing `node_secret=`.
- Attacker extracts the plaintext secret.
- 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
- `isTrustedNodeRequest()` returns true.
- `CheckWebSocketOrigin()` returns true — Origin check is completely skipped.
- `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
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/0xJacky/Nginx-UI |
Sin parche | — | — | v1.9.9 no afectada |
2.5.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-qq4p-5m6w-ww57Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
