Home › CVE › JavaScript
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
Research article
libp2p ASN.1 DER Decoder Vulnerability in js-libp2p
| CVE | CVE-2026-110789 |
|---|---|
| Vendor and product | npm:@libp2p/crypto; libp2p js-libp2p; @libp2p crypto |
| Published | November 19, 2026 10:05 UTC |
| Research cut-off | November 19, 2026 09:51 UTC |
| Sources reviewed | 4: NVD record (last modified 2026-11-19); CISA KEV catalog; GitHub advisory (2026-11-17); FIRST EPSS (2026-11-18) |
Executive summary
CVE-2026-110789 affects the libp2p js-libp2p and @libp2p/crypto libraries, allowing an unauthenticated attacker to stall the Node event loop by sending a crafted Identify message. The CVSS 3.1 score is 7.5 HIGH, scored by GitHub [3]. The vulnerability impacts versions less than 3.3.8 and 5.1.22, respectively [1]. The reviewed sources do not report exploitation [2]. The main action is to upgrade @libp2p/crypto to 5.1.22 [3]; the pack does not list a fixed version for js-libp2p.
Key points
- CVE-2026-110789 affects the libp2p js-libp2p and @libp2p/crypto libraries [1].
- A maliciously crafted Identify message can cause the Node event loop to stall for 4 to 5 seconds per connection [3].
- The vulnerability is rated CVSS 3.1 7.5 HIGH, scored by GitHub [3].
- The reviewed sources do not report exploitation [2].
- The fixed version for @libp2p/crypto is 5.1.22 [3].
Vulnerability identification
| CVE ID | Vendor | Product | CWE | CVSS 3.1 | Published | Last Modified | Record Status |
|---|---|---|---|---|---|---|---|
| CVE-2026-110789 | libp2p | js-libp2p | CWE-130, CWE-400 | 7.5 HIGH, scored by security-advisories@github.com (Secondary) | 2026-11-17T20:17:35 | 2026-11-19T04:17:24 | Received |
| CVE-2026-110789 | libp2p | @libp2p/crypto | CWE-130, CWE-400 | 7.5 HIGH, scored by GitHub | 2026-11-17T21:05:08 | 2026-11-17T21:05:09 | Advisory updated (GHSA-rvfr-cqwq-rc4j) |
Vulnerability description
A maliciously crafted Identify message containing a specially formatted publicKey field can cause the Node event loop to stall for approximately 4 to 5 seconds per connection [3]. The issue arises when the library parses DER long-form lengths without verifying the buffer size, leading to unbounded synchronous iteration and excessive memory allocation [3].
Attack surface and exploitation prerequisites
The CVSS vector indicates the attack requires network access (AV:N), no privileges (PR:N), and no user interaction (UI:N) [1]. The vulnerability can be exploited before authentication is completed, allowing repeated attacks via reconnections [3].
Impact analysis
The CVSS vector indicates no impact on confidentiality (C:N) and integrity (I:N), but a high impact on availability (A:H) [1]. The attack causes the event loop to stall, freezing timers, heartbeats, and protocol timeouts [3]. In memory-constrained environments, the attack can lead to an out-of-memory (OOM) error [3].
Affected products and versions
| Affected Product | Affected Version | Fixed Version |
|---|---|---|
| libp2p js-libp2p | < 3.3.8 | Not listed |
| @libp2p/crypto | < 5.1.22 | 5.1.22 [3] |
Exploitation and threat intelligence status
CVE-2026-110789 is not listed in the CISA KEV catalog as of 2026-11-19 [2]. The EPSS score for this vulnerability is 0.63%, indicating a low probability of exploitation in the next 30 days [4].
Detection and exposure assessment
Readers can determine exposure by checking if their installed version of libp2p js-libp2p is less than 3.3.8 or @libp2p/crypto is less than 5.1.22 [1]. A proof of concept demonstrates the stall and memory usage, which can be used for detection [3].
Remediation
The fixed version for @libp2p/crypto is 5.1.22 [3]. The advisory recommends clamping or asserting the end or finalOffset against the buffer length before iteration in readInteger() and related functions [3]. A DER-element-length sanity cap should also be added at the decodeDer entry point [3].
Remediation checklist
- The pack does not list a fixed version for libp2p js-libp2p; the affected versions are listed as less than 3.3.8 [1].
- Upgrade @libp2p/crypto to version 5.1.22, the fixed version listed [3].
- Implement a DER-element-length sanity cap at the `decodeDer` entry point [3].
- Clamp or assert the `end` or `finalOffset` against the buffer length before iteration in `readInteger()` and related functions [3].
Evidence gaps
- The sources do not describe the affected component's internals.
- The sources do not mention a workaround.
- The sources do not provide a complete version range for all affected products.
- The sources do not describe the attack lifecycle in detail.
- The sources do not provide indicators of compromise.
References
- CVE-2026-110789 record. NIST National Vulnerability Database (NVD), 2026-11-19. https://nvd.nist.gov/vuln/detail/CVE-2026-110789. Accessed 2026-11-19.
- Known Exploited Vulnerabilities Catalog. Cybersecurity and Infrastructure Security Agency (CISA), 2026-11-19. https://www.cisa.gov/known-exploited-vulnerabilities-catalog. Accessed 2026-11-19.
- 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. GitHub Security Advisory Database, 2026-11-17. https://github.com/advisories/GHSA-rvfr-cqwq-rc4j. Accessed 2026-11-19.
- EPSS score for CVE-2026-110789. FIRST, 2026-11-18. https://api.first.org/data/v1/epss?cve=CVE-2026-110789. Accessed 2026-11-19.
Severity breakdown
High · 7.5
An attacker without an account can exploit this over the network, without any user action.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Login needed
- no
- User action needed
- no
- Scope
- stays within the vulnerable component
- Impact
- high on availability, none on confidentiality and integrity
Weakness
- CWE-130: Improper Handling of Length Parameter Inconsistency
- CWE-400: Uncontrolled Resource Consumption
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| @libp2p/crypto (npm) | ≤ 5.1.21 | 5.1.22 |
| libp2p js-libp2p | < 3.3.8 | — |
| @libp2p crypto | < 5.1.22 | — |
References by type
Vendor advisories
Patches and fixed releases
- github.com/libp2p/js-libp2p/commit/ef6e1851cb00511a4793a5e68948e0cdad38…
- github.com/libp2p/js-libp2p/pull/3587
- github.com/libp2p/js-libp2p/releases/tag/crypto-v5.1.22
Other references
Details
Summary
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.
Details
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:
function readInteger (buf, context) {
const length = readLength(buf, context) // attacker-controlled, claims up to 2^64
const end = context.offset + length
for (let i = context.offset; i < end; i++) // runs far past buf.byteLength
vals.push(buf[i]) // pushes `undefined` past the end
}
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. 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.
PoC
Full 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:
[*] round 1: payload sent=true, victim event-loop stall = 4s, peak RSS ~1980 MB
[*] round 2: payload sent=true, victim event-loop stall = 4-5s, peak RSS ~1980 MB
[*] round 3: payload sent=true, victim event-loop stall = 4s, peak RSS ~1980 MB
[!] 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
The 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/<pid>/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.
Impact
CWE-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-constrained deployments, force an OOM kill. Suggested fix: in readLength, reject any long-form length whose value exceeds buf.byteLength - context.offset; in readInteger/readObjectIdentifier/readBitString/readOctetString, clamp or assert end/finalOffset against buf.byteLength before looping; add an overall DER-element-length sanity cap at decodeDer entry and a byte-length cap in unmarshalECDSAPublicKey.
Affected
- npm:@libp2p/crypto
- libp2p js-libp2p
- @libp2p crypto
Frequently asked questions
What is CVE-2026-110789?
CVE-2026-110789 affects the libp2p js-libp2p and @libp2p/crypto libraries, allowing an unauthenticated attacker to stall the Node event loop by sending a crafted Identify message. The CVSS 3.1 score is 7.5 HIGH, scored by GitHub. The vulnerability impacts versions less than 3.3.8 and 5.1.22, respectively. The reviewed sources do not report exploitation. Weakness type: Improper Handling of Length Parameter Inconsistency (CWE-130).
How severe is CVE-2026-110789?
CVE-2026-110789 has a CVSS 3.1 base score of 7.5 (high), from the CNA (github.com). An attacker without an account can exploit this over the network, without any user action.
Is CVE-2026-110789 being exploited?
Not as far as is known: CVE-2026-110789 is not in CISA's Known Exploited Vulnerabilities catalog as of November 28, 2026. EPSS estimates a 0.6% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2026-110789?
@libp2p/crypto (npm) ≤ 5.1.21 (fixed in 5.1.22); libp2p js-libp2p < 3.3.8; @libp2p crypto < 5.1.22.
How do I fix CVE-2026-110789?
The pack does not list a fixed version for libp2p js-libp2p; the affected versions are listed as less than 3.3.8. Upgrade @libp2p/crypto to version 5.1.22, the fixed version listed. Implement a DER-element-length sanity cap at the decodeDer entry point.
Timeline & sources
References
Related vulnerabilities & news
- GHSA-c4hm-4h84-2cf3 / CVE-2026-59726 — ruflo MCP bridge allows unauthenticated remote code execution in default Docker Compose deployments
- Adobe Experience Manager XSS Vulnerability Enables Stored Script Injection
- Adobe Experience Manager XSS Vulnerability CVE-2026-119579
- Unblu Spark Cross-site Scripting Vulnerability in File Sharing Feature
- Optimizely Web Experimentation Allows Attacker-Controlled Code Injection