GHSA-JX78-55P5-RWV5
The 2026-07-21 whole-instance DoS fix re-validated the service lifecycle under one lock but reused the stale reporter pointer and never re-validated the server, so a concurrent delete of the member's own server reintroduces the same nil dereference in the same un-recovered worker (incomplete fix of GHSA-qjpp-gffx-2wm9)
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-JX78-55P5-RWV5 divulgada · CVSS 5.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
This is an incomplete fix of GHSA-qjpp-gffx-2wm9. The 2026-07-21 fix for a whole-instance denial of service re-validated the service lifecycle under one lock, but it reused the already-captured (now stale) reporter pointer and never re-validated the server. So a concurrent delete of the member's own server slips into the window and reintroduces the same nil dereference in the same un-recovered worker, a few dozen lines below the block that was just patched. Still present in released v2.3.0 and in v2.2.11, the release the advisory names as fixed. The attacker is an authenticated member, not anonymous.
Finding 1: the cross-lock TOCTOU residual
service/singleton/servicesentinel.go, the guard at line 684 with sinks at lines 785, 790, 806, 823 and 826.
The fix commit c893aa57 (2026-07-21) re-validated the service lifecycle under serviceResponseDataStoreLock. Two things it did not do: it reused the already-captured, now stale, reporter pointer, and it never re-validated the server. Later in the same worker a fresh snapshot is taken, m := ServerShared.GetList(), and the code performs m[r.Reporter].Name with no guard.
The lock does not help, because serviceResponseDataStoreLock does not guard ServerShared. So a concurrent POST /api/v1/batch-delete/server against the member's own server slips into the window. It is the same TOCTOU class, in the same worker, a few dozen lines below the block that was just patched.
Verified by driving the real worker through the real Dispatch entry point, using the maintainers' own serviceReportValidatedHook, which was added by the fix commit and sits exactly at the gap. Both sinks produce SIGSEGV, at servicesentinel.go lines 785 and 806, and the control run without the concurrent delete passes cleanly.
Attacker model: a logged-in RoleMember who owns one agent. Not unauthenticated.
Why it is fatal rather than a handled error: there is zero recover() in non-test code. The gRPC server has no recovery interceptor (cmd/dashboard/rpc/rpc.go lines 33 to 36), and neither do the sentinel workers, the cron scheduler, or the notification goroutines. Only the HTTP surface is covered, by gin.
Finding 2 (Low): ServiceSentinel.Delete nil-dereferences unknown service ids
servicesentinel.go line 397. batchDeleteService forwards caller-supplied ids verbatim, and CheckPermission is vacuously true for an id that does not exist, which is pinned by the repository's own test. This is not a denial of service: the only call site is a gin handler and gin.Default() recovers, so the result is a 500. The real consequence is partial-cleanup corruption. With a bogus id ordered first, the legitimate services are committed as deleted in the database but survive in memory as zombies that keep dispatching cron probes to agents.
Suggested fixes
1. Re-validate the server under the same critical section that validates the service, or take a single consistent snapshot of both before the worker acts, rather than re-reading ServerShared after the service check. Independently, add a recovery interceptor to the gRPC server and to the sentinel workers, cron scheduler and notification goroutines, so a future nil dereference in a background goroutine is an error rather than an instance-wide outage. That second change is the one that ends this class.
2. Validate that every submitted service id exists and belongs to the caller before any deletion is committed, and make the batch atomic so a bogus id cannot leave zombies.
## Also checked and sound
Agent gRPC authentication and UUID binding; RequestTask result gating; terminal and file-manager stream ownership plus the agent-side binding; websocket re-authentication and Origin checking; the public and guest projection; the SSRF client (IP-pinned, no redirects); the personal-access-token scope model; the MCP tools and pre-signed transfer tokens; OAuth2 state binding and the admin bootstrap; CSRF; and NAT reserved-host normalisation.
Tooling
I used AI assistance while investigating. The crash was reproduced by driving Nezha's real worker through its real Dispatch entry point using the maintainers' own validation hook, with a passing control run, and the absence of any recover() outside the HTTP layer was confirmed by enumerating the non-test tree.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/nezhahq/nezha |
Sin parche | — | — | v1.14.14 no afectada |
2.3.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/nezhahq/nezha/security/advisories/GHSA-jx78-55p5-rwv5Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
