Nov 17, 2026·11 min read·2 visits
An unauthenticated remote peer can stall a js-libp2p node's event loop for 4-5 seconds and force ~2 GB of transient memory allocation per connection by sending a ~7 to 15-byte malformed RSA public key in an Identify message, exploiting missing bounds checks in the @libp2p/crypto ASN.1 DER length parser.
CVE-2026-110789 (GHSA-rvfr-cqwq-rc4j) is a high-severity pre-authentication Denial of Service (DoS) vulnerability in the @libp2p/crypto package of the js-libp2p networking stack prior to version 5.1.22. An improper length validation flaw in the ASN.1 DER decoder allows an unauthenticated remote peer to send a crafted RSA public key during the Identify protocol exchange, forcing the parser into a synchronous loop over attacker-claimed length values. Because this loop executes within a single Node.js event-loop tick prior to identity or cryptographic signature verification, it bypasses application timeouts, stalls the event loop for 4 to 5 seconds per connection, and transiently allocates up to 2 GB of memory.
The JavaScript implementation of the libp2p networking stack (js-libp2p) provides modular peer-to-peer networking primitives used across decentralized applications, IPFS nodes, and Ethereum consensus clients. A core component of this stack is the @libp2p/crypto package, which handles cryptographic operations, key generation, and key serialization/deserialization. When peers establish connections on the network, they exchange metadata and negotiate capabilities using the default Identify protocol service (packages/protocol-identify/src/identify.ts).
During an Identify exchange, a connecting peer transmits a protobuf message containing its protocol versions, listen addresses, and public key (publicKey). Before verifying whether the remote peer's cryptographic identity matches its claimed PeerId or validating message signatures, the Identify service passes the raw publicKey field to publicKeyFromProtobuf(). If the protobuf specifies an RSA key type, execution flows directly into the internal ASN.1 Distinguished Encoding Rules (DER) parser located in packages/crypto/src/keys/rsa/der.ts.
Prior to @libp2p/crypto version 5.1.22, the ASN.1 DER decoder contained an improper length parameter validation flaw classified under CWE-130 (Improper Handling of Length Parameter Inconsistency) and CWE-400 (Uncontrolled Resource Consumption). Specifically, the readLength function accepted long-form ASN.1 length headers declaring payload sizes far exceeding the actual bytes remaining in the input Uint8Array buffer.
Because the DER decoding routine executes synchronously within a single tick of the Node.js event loop, an unauthenticated remote attacker can supply a malformed public key payload as small as 7 to 15 bytes that claims a length of several megabytes. Downstream parsing routines subsequently iterate synchronously over the attacker-declared length, reading out-of-bounds buffer indices. This blocks the single-threaded Node.js event loop for 4 to 5 seconds per connection, prevents asynchronous protocol timeouts from firing, and forces transient memory allocations of approximately 2 GB.
In ASN.1 DER encoding, every data element is structured as a Tag-Length-Value (TLV) triplet. The length field can be encoded in two forms: short form (a single octet where bit 8 is 0, representing lengths from 0 to 127) and long form (where bit 8 of the initial octet is 1, and bits 7 through 1 specify the number of subsequent octets that encode the actual length value in big-endian base-256 format). When parsing untrusted ASN.1 streams, a compliant decoder must verify both that the length octets themselves reside within the buffer bounds and that the resulting decoded length does not exceed the remaining payload bytes.
In @libp2p/crypto versions prior to 5.1.22, the readLength function in packages/crypto/src/keys/rsa/der.ts failed to perform either boundary check. When encountering a long-form length byte (length & 0x80), the parser masked the lower 7 bits (const count = length & 0x7f) to determine how many length octets followed. It then entered a for loop to read count bytes from buf[context.offset], converting each byte to a two-character hexadecimal string and concatenating them into an accumulator string str, which was finally parsed via parseInt(str, 16).
This implementation introduced three distinct failure modes:
0x84 0x00 0x0f 0x42 0x40 (declaring a length of 1,000,000 bytes) followed by only 1 byte of actual data, readLength returned 1000000 without verifying if buf.byteLength - context.offset contained 1,000,000 bytes.0x88 claiming 8 length octets when only 1 byte remained), buf[context.offset] evaluated to undefined inside the loop, throwing an unhandled runtime TypeError when .toString(16) was invoked.0x80): If an attacker supplied 0x80, count evaluated to 0. The loop did not execute, str remained an empty string '', and parseInt('', 16) returned NaN, which was returned to callers expecting a valid integer.When readLength returned an artificially large integer (such as 1,000,000) to downstream consumers like readInteger or readObjectId, those functions executed synchronous for loops iterating length times over buf. In JavaScript, indexing past the end of a Uint8Array does not throw an exception; instead, it returns undefined. Inside the tight parsing loops, these undefined values underwent repeated type coercions and string concatenations across millions of iterations. Because JavaScript execution in Node.js is single-threaded and non-preemptive, the event loop cannot process I/O callbacks, network heartbeats, or setTimeout timers until the synchronous loop terminates.
The vulnerability resides in packages/crypto/src/keys/rsa/der.ts and was remediated in commit ef6e1851cb00511a4793a5e68948e0cdad385332 (Pull Request #3587). Examining the pre-patch implementation of readLength illustrates how attacker-controlled bytes directly dictated loop bounds without validation:
// Vulnerable implementation prior to @libp2p/crypto 5.1.22
function readLength (buf: Uint8Array, context: Context): number {
let length = buf[context.offset++]
if (length & 0x80) {
const count = length & 0x7f
let str = ''
length = 0
context.offset++
for (let i = 0; i < count; i++, context.offset++) {
// FLAW 1: No check ensuring context.offset < buf.byteLength
str += buf[context.offset].toString(16).padStart(2, '0')
}
length = parseInt(str, 16)
context.offset++
}
// FLAW 2: No validation that 'length' is a valid non-negative integer
// FLAW 3: No validation that 'length' <= remaining bytes in 'buf'
return length
}The patch introduces two explicit boundary and type validation checks inside readLength before returning the decoded length value to any downstream ASN.1 tag reader:
diff --git a/packages/crypto/src/keys/rsa/der.ts b/packages/crypto/src/keys/rsa/der.ts
index 0efe3bcd20..e978c19e9b 100644
--- a/packages/crypto/src/keys/rsa/der.ts
+++ b/packages/crypto/src/keys/rsa/der.ts
@@ -46,6 +46,10 @@ function readLength (buf: Uint8Array, context: Context): number {
context.offset++
for (let i = 0; i < count; i++, context.offset++) {
+ if (context.offset >= buf.byteLength) {
+ throw new Error('invalid DER element length')
+ }
+
str += buf[context.offset].toString(16).padStart(2, '0')
}
@@ -55,6 +59,12 @@ function readLength (buf: Uint8Array, context: Context): number {
context.offset++
}
+ // length can be NaN (indefinite-form 0x80), negative, or larger than the
+ // bytes that remain; reject all three
+ if (!Number.isInteger(length) || length < 0 || length > buf.byteLength - context.offset) {
+ throw new Error('invalid DER element length')
+ }
+
return length
}The patch in commit ef6e1851cb00511a4793a5e68948e0cdad385332 is complete and addresses all vectors within readLength:
if (context.offset >= buf.byteLength) inside the long-form octet collection loop prevents out-of-bounds reads when count exceeds the physical buffer size, throwing a controlled 'invalid DER element length' error rather than attempting to call .toString(16) on undefined.!Number.isInteger(length) || length < 0 rejects NaN values produced by BER indefinite-form length octets (0x80), Infinity if an excessive count were supplied, and any negative values.length > buf.byteLength - context.offset guarantees that the declared ASN.1 element payload is physically present in the buffer. Consequently, downstream readers (readInteger, readObjectId, readBitString, readSequence) can never iterate more times than the actual byte length of the incoming message, bounding CPU and memory consumption to the maximum allowed protobuf message size.Exploiting CVE-2026-110789 requires no authentication, cryptographic material, or prior trust relationship with the target node. Any js-libp2p node exposing a reachable network transport listener (such as TCP, WebSockets, or WebTransport) with the default Identify service enabled is vulnerable.
/ip4/198.51.100.1/tcp/4001) and completes the standard transport and multiplexer negotiation (/multistream/1.0.0)./ipfs/id/1.0.0 (Identify) protocol stream is opened. In packages/protocol-identify/src/identify.ts, the node processes the remote peer's Identify protobuf message.Identify protobuf containing a publicKey field with KeyType.RSA and a Data payload consisting of a crafted ASN.1 DER structure (~7 to 15 bytes). Because publicKeyFromProtobuf is invoked prior to checking whether the derived public key matches connection.remotePeer, the payload reaches decodeDer even though the key is completely invalid.readLength, parses the inflated length field, and stalls inside the subsequent reader loop for 4 to 5 seconds while allocating ~2 GB of heap memory. By maintaining a small number of concurrent connections or repeatedly delivering the payload, the attacker causes continuous event-loop starvation.The unit test suite introduced in packages/crypto/test/keys/der.spec.ts within commit ef6e1851cb00511a4793a5e68948e0cdad385332 documents four specific byte sequences that trigger the parser flaws:
// Vector 1: INTEGER (0x02) with 4-byte long-form length (0x84)
// Claims 1,000,000 bytes (0x000f4240), provides only 1 byte of content (0x01)
const malformedInteger = Uint8Array.from([0x02, 0x84, 0x00, 0x0f, 0x42, 0x40, 0x01]);
decodeDer(malformedInteger);
// Vector 2: OBJECT IDENTIFIER (0x06) with 4-byte long-form length (0x84)
// Claims 1,000,000 bytes (0x000f4240), provides only 1 byte of content (0x01)
const malformedOID = Uint8Array.from([0x06, 0x84, 0x00, 0x0f, 0x42, 0x40, 0x01]);
decodeDer(malformedOID);
// Vector 3: BER Indefinite-form length (0x80) -> count = 0 -> parseInt('', 16) = NaN
const malformedIndefinite = Uint8Array.from([0x02, 0x80]);
decodeDer(malformedIndefinite);
// Vector 4: Truncated length header (0x88 claims 8 length bytes follow, only 1 provided)
const truncatedHeader = Uint8Array.from([0x02, 0x88, 0x00]);
decodeDer(truncatedHeader);> [!NOTE] > In Vector 1 and Vector 2, an amplification factor of over 140,000x is achieved: a 7-byte input array forces 1,000,000 loop iterations and multi-gigabyte transient allocations in the V8 JavaScript engine.
CVE-2026-110789 carries a CVSS v3.1 Base Score of 7.5 (High) (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). While the vulnerability does not allow unauthorized disclosure of memory contents (C:N) or arbitrary code execution/data modification (I:N), its impact on service availability (A:H) is total for affected Node.js processes.
In a js-libp2p node, all networking I/O, stream multiplexing, peer gossip (such as Gossipsub), DHT routing queries, and application-level timers share a single Node.js main thread event loop. When a single unauthenticated connection stalls the event loop for 4 to 5 seconds, the node cannot process incoming packets, send heartbeat pings, or respond to peer queries. Furthermore, because Node.js setTimeout and AbortSignal mechanisms rely on the event loop advancing to the timers phase, the built-in Identify protocol timeout cannot interrupt the synchronous decodeDer execution.
In addition to CPU and event-loop starvation, each malformed packet causes transient heap allocations of approximately 2 GB due to repeated string allocations inside the out-of-bounds loop. If an attacker opens multiple concurrent streams or connections simultaneously, the cumulative memory allocation will exceed the default V8 heap limit (typically ~2 GB to 4 GB on 64-bit systems), terminating the entire Node.js process with an unhandled Out-Of-Memory (OOM) fatal crash.
Downstream applications impacted by this flaw include any JavaScript or TypeScript service integrating js-libp2p prior to 3.3.8 or @libp2p/crypto prior to 5.1.22. This encompasses IPFS implementations (such as Helia), Ethereum consensus layer clients written in TypeScript (such as Lodestar), and custom peer-to-peer relay or bootstrap nodes exposed to public traffic.
To remediate CVE-2026-110789, operators and developers must upgrade @libp2p/crypto to version 5.1.22 or later, and js-libp2p to version 3.3.8 or later. These releases incorporate commit ef6e1851cb00511a4793a5e68948e0cdad385332, which strictly bounds ASN.1 DER length fields to the remaining bytes in the input buffer.
For projects depending directly on libp2p or @libp2p/crypto, update your dependencies using your package manager:
npm install libp2p@^3.3.8 @libp2p/crypto@^5.1.22If @libp2p/crypto is pulled in as a transitive dependency by a higher-level framework (such as Helia or an SDK) that has not yet updated its lockfile, force the patched version using overrides in package.json (for npm) or resolutions (for Yarn):
{
"overrides": {
"@libp2p/crypto": "^5.1.22"
},
"resolutions": {
"@libp2p/crypto": "^5.1.22"
}
}After applying the override, regenerate the lockfile and verify the installed version:
npm list @libp2p/crypto> [!NOTE]
> Because libp2p traffic is encrypted over transport security channels (such as Noise or TLS 1.3) prior to the Identify exchange, traditional network-layer IDS/WAF signatures cannot inspect the cleartext protobuf payload on the wire unless TLS/Noise termination occurs at a trusted boundary.
Security teams should rely on host-based Application Performance Monitoring (APM) and application logging to detect exploitation attempts:
perf_hooks.monitorEventLoopDelay). Recurring event-loop stalls lasting 4,000 to 5,000 ms accompanied by sudden V8 heap spikes of ~1.5 GB to 2 GB during inbound peer connection bursts indicate active exploitation.@libp2p/crypto@5.1.22, malformed payloads are rejected immediately in O(1) time. Monitor application debug logs within the libp2p:identify namespace for connection resets throwing Error: invalid DER element length.CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
@libp2p/crypto libp2p | < 5.1.22 | 5.1.22 |
js-libp2p libp2p | < 3.3.8 | 3.3.8 |
| Attribute | Detail |
|---|---|
| CVE / GHSA ID | CVE-2026-110789 / GHSA-rvfr-cqwq-rc4j |
| Vulnerability Class | CWE-130 (Improper Length Handling) / CWE-400 (Resource Exhaustion) |
| CVSS v3.1 Score | 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) |
| Attack Vector | Network (Pre-authentication via libp2p Identify protocol) |
| Affected Component | @libp2p/crypto (< 5.1.22) / js-libp2p (< 3.3.8) |
| Primary Impact | 4-5s Node.js event-loop stall and ~2 GB transient RAM allocation per connection |
| Exploit Status | Public PoC (Unit test payloads in official repository) |
| CISA KEV Status | Not Listed |
The software parses a message or data structure where a length field is provided, but fails to verify that the declared length matches or does not exceed the remaining buffer data, leading to uncontrolled resource consumption (CWE-400).
CVE-2026-119793 (GHSA-x2vm-cf3p-m2w8) is a resource consumption vulnerability in the @libp2p/gossipsub module of the js-libp2p ecosystem. Prior to @libp2p/gossipsub version 17.0.0 and js-libp2p version 3.3.9, the GossipSub implementation processed incoming subscription RPC messages without enforcing per-peer or global limits on the number or cumulative byte size of subscribed topics in its default configuration. An unauthenticated remote peer can exploit this flaw by streaming continuous batches of unique topic subscription strings over an established connection, causing unbounded growth of the internal topics Map. This leads to V8 heap exhaustion (Out-Of-Memory crash) and severe CPU starvation on the main event loop during peer disconnection teardown.
Filament Curator, a media picker plugin for Filament panels in Laravel applications, contains a Stored Cross-Site Scripting (XSS) vulnerability in versions prior to 3.7.9, 4.1.2, and 5.1.2. The application accepts image/svg+xml uploads by default and stores them on disk without stripping executable XML markup. When a panel user opens an uploaded SVG via the View action, the file renders as a top-level document in the browser, executing embedded JavaScript within the origin of the Filament application.
CVE-2026-63182 is a high-severity XML Signature Wrapping (XSW) vulnerability in LightSAML (litesaml/lightsaml), a PHP library implementing SAML 2.0 data models and cryptographic verification. An architectural discrepancy between how LightSAML deserializes direct child assertions and how the underlying robrichards/xmlseclibs library resolves XML document fragment identifiers allows an attacker with a valid signed assertion to forge arbitrary SAML identity claims and bypass authentication.
A race condition and improper synchronization vulnerability (CWE-362) exists in Next.js versions 16.2.0 prior to 16.4.5 when Cache Components ('use cache' directive) are enabled. When an outer cached function calls a nested cached function that reads dynamic root parameters via 'next/root-params' and returns an object containing pending promises, React Flight can resolve and deliver the ready portion of the payload before the inner cache finishes publishing its root parameter dependencies. Consequently, the outer cache entry finalizes and persists under a cache key that omits the root parameter dependencies, causing the first written cache entry to be served across requests with different root parameter values and bypassing nested cache invalidation rules.
A remote OS command injection vulnerability (CWE-78) exists in code-review-mcp-server prior to version 1.5.3. The application passes caller-controlled tool parameters directly into Node.js child_process.execSync() calls without proper neutralization. An attacker or compromised LLM agent invoking tools such as getLocalGitDiff, codeReview, createPR, or getPRTemplate can inject arbitrary shell commands that execute with the privileges of the MCP server host process.
A path traversal vulnerability (CWE-22) in termux-sync prior to version 1.2.4 allows an attacker to overwrite arbitrary files within the Termux environment during the backup restoration process. The flaw stems from the application trusting attacker-controlled extraction paths defined in the backup's manifest.json file, failing to validate archive members against directory traversal sequences during tar extraction, and using unsanitized backup names when constructing temporary directories. If a user restores a malicious backup archive from local storage, shared folders, GitHub, or Google Drive, an attacker can overwrite sensitive configuration files such as shell startup scripts or local binaries, resulting in arbitrary code execution under the privileges of the Termux user.