Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. ckb
  4. ›
  5. GHSA-48vq-8jqv-gm6f

GHSA-48vq-8jqv-gm6f: Remote memory exhaustion in ckb

August 25, 2021

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

References

  • github.com/advisories/GHSA-48vq-8jqv-gm6f
  • github.com/nervosnetwork/ckb/security/advisories/GHSA-48vq-8jqv-gm6f
  • rustsec.org/advisories/RUSTSEC-2021-0108.html

Code Behaviors & Features

Detect and mitigate GHSA-48vq-8jqv-gm6f with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.40.0

Fixed versions

  • 0.40.0

Solution

Upgrade to version 0.40.0 or above.

Weakness

  • CWE-400: Uncontrolled Resource Consumption

Source file

cargo/ckb/GHSA-48vq-8jqv-gm6f.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:52 +0000.