GHSA-P8R9-QF8W-P73R
Cross-session QoS2 dedup residue silently swallows the first colliding message after clean-session reconnect
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-P8R9-QF8W-P73R divulgada · CVSS 6.5 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Affects: aedes 1.1.1, and current main (verified identical code paths in v1.1.2), with aedes-persistence 10.3.1.
Reproduction: a client publishes a QoS2 message (e.g., msgId=7) and disconnects without completing the PUBREL exchange; the same clientId reconnects with cleanSession=1 and publishes QoS2 msgId=7 again. The broker returns a normal PUBREC but never delivers the message to subscribers. A fresh clientId with the same msgId is delivered normally.
Mechanism: `lib/handlers/publish.js:52-55` (dedup hit returns PUBREC without publishing), `lib/handlers/connect.js:175` (clean-session path only clears subscriptions), `aedes-persistence/asyncPersistence.js:277-306` (`#incoming` has no per-client cleanup entry point; its only deletion point is the PUBREL handler).
Specification: MQTT 3.1.1 [MQTT-3.1.2-6] requires the server to discard all session state when cleanSession=1; the dedup table escapes this cleanup while subscriptions are cleared, producing silent message loss with byte-identical PUBREC.
Suggested direction: clear `#incoming[clientId]` on the clean=1 connect path; this needs a per-client incoming-cleanup API in aedes-persistence.
---
Fix
Fixed in aedes 1.2.0 (commit `c7acaa1`). `aedes-persistence` gains `cleanIncoming(client)`, and aedes calls
it on the clean-session CONNECT path after `registerClient`, and again when a clean session's connection closes.
The fix is feature-detected, so it is only effective if your persistence implements `cleanIncoming`. aedes
skips the call when the method is absent rather than crashing, which means an un-upgraded persistence leaves you
exposed on aedes 1.2.0. As of this advisory:
| persistence | implements `cleanIncoming` |
|---|---|
| `aedes-persistence` (default, in-memory) 11.0.0 | yes |
| `aedes-persistence-mongodb` 9.5.0 | yes |
| `aedes-persistence-redis` 12.0.0 | yes — breaking, see its `UPGRADE.md` |
| `aedes-persistence-level` 9.1.3 | not yet |
| `aedes-persistence-sqlite` 2.0.0 | not yet |
| `aedes-cached-persistence` 10.1.1 | no — deprecated, superseded by `aedes-persistence` >= 10.2 |
Upgrade aedes to `^1.2.0` and `aedes-persistence` to `^11.0.0`; if you use one of the stores above that does
not yet implement it, you remain affected until it ships.
The `2.0.0-beta` line is still affected — `2.0.0-beta.0` and `2.0.0-beta.1` are published under the `beta`
dist-tag and carry neither fix. There is no patched 2.x release yet.
Impact in practice
Silent message loss, not a crash: the broker answers a byte-identical PUBREC and drops the message. Nothing is
logged, so it surfaces as an application-level "message never arrived" rather than as a broker fault.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmaedes |
Sin parche | — | — | 1.2.0 no afectada |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/moscajs/aedes/security/advisories/GHSA-p8r9-qf8w-p73rLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
