llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · @libp2p/floodsub

GHSA-PXV8-J7H7-M2PJ

floodsub StrictSign verifies the signature against the untrusted message.key with no binding to message.from, allowing peer impersonation

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
8.2
Alta
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/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ón34 dDesde la divulgación, 16 oct 2026, 6:33 p. m.
Detección33 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
16 oct 26
19 nov 26
20 nov 26
16 oct 26
25 oct 26
3 nov 26
11 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-PXV8-J7H7-M2PJ divulgada · CVSS 8.2 (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
A floodsub peer can publish messages impersonating any Ed25519 PeerId (including peers it is not connected to) even when StrictSign is enabled, because the signature is validated against the untrusted `message.key` rather than the key bound to `message.from`.

### Details
`packages/floodsub/src/sign.ts` `messagePublicKey()` (line 73) returns the peer-supplied `message.key` (lines 83–84) with no binding to `message.from`:

export function messagePublicKey (message) {
  ...
  if (message.key != null) {
    return message.key            // untrusted; never compared to message.from
  }
  if (message.from.publicKey != null) {
    return message.from.publicKey
  }
}

and `verifySignature()` validates the signature with that key (`pubKey.verify(bytes, message.signature)`). `utils.ts` `isSigned()` returns `true` for any inline-key (Ed25519) PeerId without checking `message.key` agreement, and the signed bytes deliberately exclude `key`/`signature`. gossipsub closes this exact hole at `buildRawMessage.ts:143` (`if (fromPeerId.publicKey !== undefined && !publicKey.equals(fromPeerId.publicKey)) return invalid`); floodsub lacks the equivalent, yet `index.ts` advertises StrictSign as spoof-prevention. The attacker picks any victim PeerId X (it need not be online), signs the message bytes with its own private key, and attaches its own public key as `message.key`; the victim verifies against the attacker's key (passes), accepts the message, dispatches it with `msg.from = X`, then re-broadcasts it to its other subscribers. Verified on js-libp2p commit `a04f5e0`, where `@libp2p/floodsub` reads `11.0.25`.

### PoC
Full PoC attached (`floodsub-strictsign-impersonation-poc.tar.gz`). Build the js-libp2p monorepo at the affected version (`npm install --ignore-scripts && npm run build`), extract the package inside the monorepo root (sibling of `packages/`), then `cd floodsub-strictsign-impersonation-poc && node attack.mjs`. It sends three messages that isolate the defect — NEG (wrong sig, rejected), BYPASS (from=X, key=A, signed with A), POS (self-signed). Expected:

[*] victim dispatched messages: 2
[*]   from=12D3KooW...(X) topic=pwn data="FORGED-BY-A-as-X"
[*]   from=12D3KooW...(A) topic=pwn data="POS-self-signed"
[!] Vulnerability reproduced: StrictSign accepted a message whose declared 'from' is X — a peer the victim is NOT connected to — while the signature was made with the ATTACKER's key A
[!] evidence: NEG(wrong sig)=rejected (0 messages), BYPASS(from=X,key=A)=ACCEPTED as from=X, POS(self-signed)=accepted

`A` is the attacker's connection identity; `X` is a PeerId the victim is not connected to. The wrongly-signed NEG message is correctly rejected, proving the verify path works and the defect is specifically the missing `key`-to-`from` binding.

### Impact
CWE-347/CWE-345. A floodsub peer can forge messages as any Ed25519 PeerId and have them propagated across hops (every relay re-runs the same broken verify). `@libp2p/floodsub` is documented "not for production / deprecated", which bounds real-world exposure, but the bypass is a concrete spec violation that `index.ts` still advertises as protection. Suggested fix: mirror gossipsub — in `messagePublicKey`/`toMessage`, when `from` has an inline public key and `message.key` is supplied, require `publicKeyFromProtobuf(message.key).equals(from.publicKey)` and reject on mismatch; or require `message.key` to be absent for hashed PeerIds.

floodsub-strictsign-impersonation-poc.tar.gz https://github.com/user-attachments/files/30452504/floodsub-strictsign-impersonation-poc.tar.gz

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:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:L
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida
@libp2p/floodsub≤ 11.0.25
11.0.25
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npm@libp2p/floodsub
Sin parche — — —
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/libp2p/js-libp2p/security/advisories/GHSA-pxv8-j7h7-m2pj

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