Advisory

RUSTSEC-2021-0108

Also known as: CVE-2021-45699, GHSA-2969-8hh9-57jc, GHSA-48vq-8jqv-gm6f

Summary

Remote memory exhaustion in ckb

Details

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.

Severity

Not rated by the source.

Dates

Published
2021-07-25 12:00 UTC
Modified
2026-10-12 18:00 UTC

Affected packages and fixes

ckb

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.40.0 (semver)

Fixed versions

0.40.0

Fix

  • Fixed version 0.40.0
    cargo update -p ckb --precise 0.40.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences