VYPR
High severityNVD Advisory· Published Dec 26, 2021· Updated Aug 4, 2024

CVE-2021-45699

CVE-2021-45699

Description

An issue was discovered in the ckb crate before 0.40.0 for Rust. Remote attackers may be able to conduct a 51% attack against the Nervos CKB blockchain by triggering an inability to allocate memory for the misbehavior HashMap.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

In ckb <0.40.0, the misbehavior HashMap keyed by monotonically increasing SessionId never evicts entries, allowing a remote attacker to exhaust memory via repeated peer connections.

Vulnerability

The vulnerability resides in the sync protocol of the ckb crate before version 0.40.0, used by the Nervos CKB blockchain [1]. The SyncState structure maintains a HashMap named misbehavior that tracks a peer's protocol violation score [3]. This map is keyed by PeerIndex (an alias for SessionId), an integer that increases monotonically with every new connection [3]. Entries are never removed from the map [3]. An attacker can cause the map to grow unboundedly, leading to memory exhaustion [3].

Exploitation

A remote attacker needs only network access to the target node; no authentication or prior trust is required [3]. The attacker repeatedly connects and disconnects, each time generating a new SessionId and thus a new entry in the misbehavior HashMap [3]. Over time the map grows until the host's memory is depleted, causing degraded performance and eventually a panic on allocation failure or process termination by the OS [3].

Impact

Successful exploitation results in a denial-of-service condition against the targeted node [3]. If enough nodes are affected, the attacker can reduce the overall hash power of the Nervos CKB network, potentially enabling a 51% attack to undermine blockchain consensus [3]. The impact is critical severity due to the remote and unauthenticated nature of the attack and its potential to compromise the integrity of the blockchain [1].

Mitigation

The vulnerability is fixed in ckb version 0.40.0 and later [3][4]. Users must upgrade the ckb crate to >=0.40.0 [4]. No workaround is publicly documented for older versions; upgrading is the recommended mitigation [3].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
ckbcrates.io
< 0.40.00.40.0

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

5

News mentions

0

No linked articles in our index yet.