CVE-2021-45699
JSON

7.5high

Allocation of Resources Without Limits or Throttling in ckb

Severity
7.5high CVSS:3.1 by NVD
Exploit likelihood
1.52% (higher than 75% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-2969-8hh9-57jcGHSA-48vq-8jqv-gm6fRUSTSEC-2021-0108

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
ckb (crates.io)before 0.40.0, from 0.0.0-0 before 0.40.0GitHub Advisory Database, RustSec Advisory Database
nervos ckbbefore 0.40.0NVD

All scores

GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHubhigh rating
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD7.8high CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:C

Classification

What each source says

CVE List

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.

GitHub Advisory Database

In the ckb sync protocol, SyncState maintains a HashMap called 'misbehavior' that keeps a score of a peer's violations of the protocol. This HashMap is keyed to PeerIndex (an alias for SessionId), and entries are never removed from it. SessionId is an integer that increases monotonically with every new connection.

A remote attacker can manipulate this HashMap to grow forever, resulting in degraded performance and ultimately a panic on allocation failure or being killed by the OS, depending on the platform.

This is a critical severity security bug. It could be exploited to create a targeted or network-wide denial of service, to reduce the hash power of the network as part of a 51% attack, and perhaps in other creative ways.

An attack is trivial:

  1. connect to another node
  2. send an invalid sync protocol request, such as SendHeaders for non-consecutive blocks
  3. disconnect
  4. repeat
RustSec Advisory Database

In the ckb sync protocol, SyncState maintains a HashMap called 'misbehavior' that keeps a score of a peer's violations of the protocol. This HashMap is keyed to PeerIndex (an alias for SessionId), and entries are never removed from it. SessionId is an integer that increases monotonically with every new connection.

A remote attacker can manipulate this HashMap to grow forever, resulting in degraded performance and ultimately a panic on allocation failure or being killed by the OS, depending on the platform.

This is a critical severity security bug. It could be exploited to create a targeted or network-wide denial of service, to reduce the hash power of the network as part of a 51% attack, and perhaps in other creative ways.

NVD (es)

Se ha detectado un problema en la crate ckb versiones anteriores a 0.40.0 para Rust. Unos atacantes remotos pueden ser capaces de llevar a cabo un ataque del 51% contra la blockchain Nervos CKB al desencadenar una incapacidad para asignar memoria para el HashMap de comportamiento inapropiado

References

Sources

SourceRecordLicence
CVE ListCVE-2021-45699 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-2969-8hh9-57jc changed 2023-11-08CC-BY-4.0
GitHub Advisory DatabaseGHSA-48vq-8jqv-gm6f changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0108 changed 2026-10-12CC0-1.0
NVDCVE-2021-45699 changed 2026-06-17Public domain