Improper Handling of Length Parameter Inconsistency Affecting @libp2p/crypto package, versions <5.1.22


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.63% (45th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-LIBP2PCRYPTO-22744136
  • published23 Nov 2026
  • disclosed17 Nov 2026
  • creditX1AOxiang

Introduced: 17 Nov 2026

NewCVE-2026-110789  (opens in a new tab)
CWE-130  (opens in a new tab)

How to fix?

Upgrade @libp2p/crypto to version 5.1.22 or higher.

Overview

@libp2p/crypto is a Crypto primitives for libp2p

Affected versions of this package are vulnerable to Improper Handling of Length Parameter Inconsistency via readLength() in packages/crypto/src/keys/rsa/der.ts, which parses ASN.1 DER long-form length fields without validating them against the remaining buffer size. readInteger() then iterates from the current offset to the attacker-claimed end position, which can be up to 2^64, driving an unbounded synchronous loop that stalls the Node.js event loop for several seconds and transiently allocates approximately 2 GB of memory per connection. A remote peer triggers this by sending a malformed publicKey inside an Identify message, which is decoded before any peer-id or signature check, making the attack pre-auth and repeatable on every new connection.

CVSS Base Scores

version 4.0
version 3.1