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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| ckb (crates.io) | before 0.40.0, from 0.0.0-0 before 0.40.0 | GitHub Advisory Database, RustSec Advisory Database |
| nervos ckb | before 0.40.0 | NVD |
All scores
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | high rating | |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.8high CVSS:2.0 | AV: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:
- connect to another node
- send an invalid sync protocol request, such as
SendHeadersfor non-consecutive blocks - disconnect
- 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
| https://rustsec.org/advisories/RUSTSEC-2021-0108.html | advisory, third-party-advisory, web | |
| https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/ckb/RUSTSEC-2021-0108.md | third-party-advisory, web | |
| https://github.com/nervosnetwork/ckb/security/advisories/GHSA-48vq-8jqv-gm6f | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-45699 | advisory | |
| https://github.com/nervosnetwork/ckb | package | |
| https://crates.io/crates/ckb | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-45699 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2969-8hh9-57jc changed 2023-11-08 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-48vq-8jqv-gm6f changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0108 changed 2026-10-12 | CC0-1.0 |
| NVD | CVE-2021-45699 changed 2026-06-17 | Public domain |