GHSA-48vq-8jqv-gm6f: Ckb Remote Memory Exhaustion Vulnerability

HIGH
CWE-400
Published
Advisory Summary

GHSA-48vq-8jqv-gm6f is a HIGH remote memory exhaustion vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Ckb libraries in the crates.io ecosystem. The issue involves remote memory exhaustion in ckb. Remediation is available by upgrading affected packages to version 0.40.0.

GHSA-48vq-8jqv-gm6f at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-48vq-8jqv-gm6f
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Ckb
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-48vq-8jqv-gm6f

To remediate this vulnerability, upgrade all affected Ckb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ckb fixed: 0.40.0
Upgrade ckb to 0.40.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for ckb

How to Check if You Are Affected

To determine whether your application is affected by GHSA-48vq-8jqv-gm6f, inspect your project dependencies for Ckb:

inspect dependencies for ckb

Analyze the terminal output to locate any version of Ckb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.40.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Ckb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

GHSA-48vq-8jqv-gm6f Affected Ckb Versions

1 component(s)
Fixed Versions:
0.40.0
Product / Package Ecosystem Affected Versions Fixed Version
ckb
crates.io
< 0.40.0
0.40.0

References

Frequently Asked Questions

What is GHSA-48vq-8jqv-gm6f?
GHSA-48vq-8jqv-gm6f is a security vulnerability in Ckb involving Remote memory exhaustion in ckb under CWE-400: Uncontrolled Resource Consumption.
Which Ckb versions are affected?
Affected versions include releases prior to 0.40.0 across affected packages: ckb.
What version fixes GHSA-48vq-8jqv-gm6f?
Upgrading to 0.40.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ckb affected?
Yes, ckb is affected in releases prior to 0.40.0. Upgrade your dependency to 0.40.0 or later.
What CWE is associated with GHSA-48vq-8jqv-gm6f?
GHSA-48vq-8jqv-gm6f is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check crates.io dependencies for GHSA-48vq-8jqv-gm6f?
Run the dependency tree command: 'inspect dependencies for ckb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-48vq-8jqv-gm6f",
  "modified" : "2021-08-02T21:53:41Z",
  "published" : "2021-08-25T21:01:23Z",
  "aliases" : [ ],
  "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.\n\nA 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.\n\nThis 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.\n\nAn attack is trivial:\n\n1. connect to another node\n2. send an invalid sync protocol request, such as `SendHeaders` for non-consecutive blocks\n3. disconnect\n4. repeat",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "ckb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.40.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nervosnetwork/ckb/security/advisories/GHSA-48vq-8jqv-gm6f"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2021-0108.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-02T21:53:41Z",
    "nvd_published_at" : null
  }
}