{"vuln_id":"CVE-2026-110789","aliases":["GHSA-rvfr-cqwq-rc4j"],"description":"libp2p: ASN.1 DER decoder drives an unbounded synchronous loop on attacker-controlled length fields, stalling the Node event loop pre-auth","published_at":"2026-11-17T20:17:35.790000Z","modified_at":"2026-11-19T04:17:24.060000Z","first_seen_at":"2026-11-21T19:15:20.172198Z","severity":"high","severity_source":"nvd","cvss_score":7.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","cwe":["CWE-130","CWE-400"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00623,"epss_percentile":0.50813,"nvd_status":"Received","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-110789"},"matched_alias":null,"items":[{"id":2454,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-rvfr-cqwq-rc4j / 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","summary":"libp2p: ASN.1 DER decoder drives an unbounded synchronous loop on attacker-controlled length fields, stalling the Node event loop pre-auth\n\n### Summary\nA 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.\n\n### Details\n`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:\n\n```ts\nfunction readInteger (buf, context) {\nconst length = readLength(buf, context) // attacker-controlled, claims up to 2^64\nconst end = context.offset + length\nfor (let i = context.offset; i < end; i++) // runs far past buf.byteLength\nvals.push(buf[i]) // pushes `undefined` past the end\n}\n```\n\nThe 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. The decode runs in a single synchronous tick, so no `AbortSignal` — including Identify's 5 s timeout — can interrupt it. Verified on js-libp2p commit `a04f5e0`, where `@libp2p/crypto` reads `5.1.21`.\n\n### PoC\nFull PoC attached (`libp2p-crypto-der-eventloop-dos-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 libp2p-crypto-der-eventloop-dos-poc && node attack.mjs`. Expected:\n\n```\n[*] round 1: payload sent=true, victim event-loop stall = 4s, peak RSS ~1980 MB\n[*] round 2: payload sent=true, victim event-loop stall = 4-5s, peak RSS ~1980 MB\n[*] round 3: payload sent=true, victim event-loop stall = 4s, peak RSS ~1980 MB\n[!] Vulnerability reproduced: 3/3 connections each stalled the victim's event loop for ~4-5s — one crafted ~15-byte Identify publicKey per connection, pre-auth\n```\n\nThe stall is measured from the victim's own 1 s heartbeat clock (frozen while the loop is blocked); the ~2 GB transient RSS peak is read from `/proc/\n/status`. The DER `RangeError` is swallowed by Identify's `.catch(() => {})`, so the node survives and every new connection re-stalls it; under a container memory limit the ~2 GB spike OOM-kills the process. A `node attack.mjs control` run (legitimate Identify) shows 0 s stalls.\n\n### Impact\nCWE-130/CWE-400. Any node running the default Identify service is affected. A single peer can keep the node unresponsive to all of its peers (every new connection adds another multi-second stall — all timers, heartbeats, and protocol timeouts stop) and, in memory-const\n\nAffected packages: npm:@libp2p/crypto\nPatched: @libp2p/crypto 5.1.22","url":"https://github.com/advisories/GHSA-rvfr-cqwq-rc4j","published_at":"2026-11-17T21:05:08Z","updated_at":"2026-11-17T21:05:09Z","fetched_at":"2026-11-21T19:15:18.416849Z","severity":"high","cvss_score":7.5,"epss":0.00623,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"@libp2p/crypto","vuln_id":"CVE-2026-110789","vuln_ids":["CVE-2026-110789","GHSA-RVFR-CQWQ-RC4J"],"tags":["ghsa","npm","CWE-130","CWE-400"],"cluster_id":2350,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2454","html":"https://vulnwatch.ve1ve2.com/item/2454"}},{"id":6618,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-110789: libp2p is a JavaScript implementation of the libp2p networking stack. Prior to 5.1.22, the @libp2p/crypto code reached by the default Identify service accepts…","summary":"libp2p is a JavaScript implementation of the libp2p networking stack. Prior to 5.1.22, the @libp2p/crypto code reached by the default Identify service accepts a remote peer’s crafted publicKey before peer-id or signature verification and passes it through publicKeyFromProtobuf to the ASN.1 DER decoder. readLength in packages/crypto/src/keys/rsa/der.ts accepts long-form element lengths larger than the remaining buffer, causing readInteger and related readers to loop synchronously over an attacker-claimed length from a very small key blob. Because decoding occurs in one event-loop tick before the remotePeer equality check in packages/protocol-identify/src/identify.ts, the Identify timeout cannot interrupt it, allowing repeated unauthenticated connections to stall all timers and peers and transiently exhaust memory. This issue is fixed in version 5.1.22.\n\nReferences:\nhttps://github.com/libp2p/js-libp2p/commit/ef6e1851cb00511a4793a5e68948e0cdad385332\nhttps://github.com/libp2p/js-libp2p/pull/3587\nhttps://github.com/libp2p/js-libp2p/releases/tag/crypto-v5.1.22\nhttps://github.com/libp2p/js-libp2p/security/advisories/GHSA-rvfr-cqwq-rc4j\nhttps://github.com/libp2p/js-libp2p/security/advisories/GHSA-rvfr-cqwq-rc4j","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-110789","published_at":"2026-11-17T20:17:35.790000Z","updated_at":"2026-11-19T04:17:24.060000Z","fetched_at":"2026-11-21T19:15:31.482418Z","severity":"high","cvss_score":7.5,"epss":0.00623,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-110789","vuln_ids":["CVE-2026-110789","GHSA-RVFR-CQWQ-RC4J"],"tags":["CWE-130","CWE-400"],"cluster_id":2351,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/6618","html":"https://vulnwatch.ve1ve2.com/item/6618"}}]}