CVE-2026-110789: CVE-2026-110789: Pre-Authentication Denial of Service via ASN.1 DER Length Parsing in js-libp2p…
CVE-2026-110789: Pre-Authentication Denial of Service via ASN.1 DER Length Parsing in js-libp2p (@libp2p/crypto) Vulnerability ID: CVE-2026-110789 CVSS Score: 7.5 Published: 2026-11-17 CVE-2026-110789 (GHSA-rvfr-cqw
CVE-2026-110789: Pre-Authentication Denial of Service via ASN.1 DER Length Parsing in js-libp2p (@libp2p/crypto)
Vulnerability ID: CVE-2026-110789
CVSS Score: 7.5
Published: 2026-11-17
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.
TL;DR
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.
⚠️ Exploit Status: POC
Technical Details
- 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
Affected Systems
- @libp2p/crypto
- js-libp2p
-
@libp2p/crypto: < 5.1.22 (Fixed in:
5.1.22) -
js-libp2p: < 3.3.8 (Fixed in:
3.3.8)
Code Analysis
Commit: ef6e185
fix(crypto): validate ASN.1 DER element length against remaining buffer (#3587)
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
}
Exploit Details
- GitHub: Official patch commit containing proof-of-concept unit tests in packages/crypto/test/keys/der.spec.ts demonstrating 7-byte malformed DER payloads.
- GitHub: Official GitHub Security Advisory detailing the pre-authentication Identify exploitation flow and resource exhaustion metrics.
Mitigation Strategies
- Upgrade @libp2p/crypto to version 5.1.22 or higher across all production nodes and client builds.
- Upgrade top-level js-libp2p dependencies to version 3.3.8 or higher.
- Use package.json 'overrides' (npm) or 'resolutions' (Yarn/pnpm) to enforce @libp2p/crypto >= 5.1.22 when transitive dependencies lock older versions.
- Configure connection manager limits and inbound rate-limiting per IP address in js-libp2p to reduce the impact of rapid unauthenticated connection floods.
- Monitor Node.js event-loop delay and heap usage metrics via APM tools to detect anomalous 4-5 second stalls.
Remediation Steps:
- Audit project lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml) to identify any instances of @libp2p/crypto < 5.1.22.
- Run 'npm install @libp2p/crypto@^5.1.22 libp2p@^3.3.8' or configure package.json overrides if constrained by upstream packages.
- Verify the resolved dependency tree using 'npm ls @libp2p/crypto' to ensure no duplicate vulnerable sub-dependencies remain in node_modules.
- Rebuild and redeploy all affected Node.js services, P2P relays, and decentralized client instances.
- Monitor post-deployment logs for 'Error: invalid DER element length' exceptions to identify peers attempting to send malformed RSA keys.
References
- GitHub Security Advisory (GHSA-rvfr-cqwq-rc4j)
- GitHub Pull Request #3587
- GitHub Fix Commit (ef6e1851cb00511a4793a5e68948e0cdad385332)
- GitHub Release Tag (crypto-v5.1.22)
- CVE.org Record (CVE-2026-110789)
- NVD Vulnerability Detail (CVE-2026-110789)
- CVEListV5 Raw Record
Read the full report for CVE-2026-110789 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.