All vulnerabilities

npm

CVE-2026-110789

libp2p: ASN.1 DER decoder drives an unbounded synchronous loop on attacker-controlled length fields, stalling the Node event loop pre-auth

Severity
High 7.5
Published
17 Nov 2026
Last changed
17 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
5.1.22
Exploit chance
0.6% in the next 30 daysHigher than 50% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
CWE-130Uncontrolled resource consumption (CWE-400)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-rvfr-cqwq-rc4j
Sources
OSV.dev and GitHub

Description

A remote peer can stall a js-libp2p node's entire event loop for ~4–5 seconds per connection (and transiently allocate ~2 GB) by sending a ~15-byte crafted publicKey inside an Identify message. The malformed key reaches the DER decoder before any peer-id/signature check, so the attack is pre-auth and repeatable indefinitely by reconnecting.

packages/crypto/src/keys/rsa/der.ts readLength() parses DER long-form lengths with no comparison to buf.byteLength, and readInteger() then loops over the attacker-claimed length:

The blob reaches the parser pre-auth: Identify runs on every connection:open and calls publicKeyFromProtobuf(publicKey) (packages/protocol-identify/src/identify.ts:85) before the connection.remotePeer.equals(id) check at identify.ts:88. The MAX_RSA_JWK_SIZE guard in pkixToRSAPublicKey only bounds the total blob size, not the inner length field, so a 15-byte payload defeats it; the ECDSA path (unmarshalECDSAPublicKey) has no cap at all.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
@libp2p/cryptonpm · osv:npm:@libp2p/crypto
  • Every version before 5.1.22

About @libp2p/crypto

Weekly downloads (npm)
227,174npm, 24 Nov 2026

This is the only vulnerability in @libp2p/crypto in our list.

References