GHSA-48vq-8jqv-gm6f

Suggest an improvement
Source
https://github.com/advisories/GHSA-48vq-8jqv-gm6f
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-48vq-8jqv-gm6f/GHSA-48vq-8jqv-gm6f.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-48vq-8jqv-gm6f
Aliases
Published
2021-08-25T21:01:23Z
Modified
2023-11-08T04:07:22.625998Z
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.

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
Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-400"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2021-08-02T21:53:41Z"
}
References

Affected packages

crates.io / ckb

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.40.0