From ef8532be92c02d2842e2aaf54ebcaed0926d7cc1 Mon Sep 17 00:00:00 2001 From: Jon Moroney Date: Fri, 10 Sep 2021 08:50:49 -0700 Subject: [PATCH] Add rustsec advisory for GHSA-48vq-8jqv-gm6f (#1024) * Add rustsec advisory for GHSA-48vq-8jqv-gm6f * Update RUSTSEC-0000-0000.md Co-authored-by: Sergey "Shnatsel" Davidoff --- crates/ckb/RUSTSEC-0000-0000.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 crates/ckb/RUSTSEC-0000-0000.md diff --git a/crates/ckb/RUSTSEC-0000-0000.md b/crates/ckb/RUSTSEC-0000-0000.md new file mode 100644 index 0000000..94c3ae1 --- /dev/null +++ b/crates/ckb/RUSTSEC-0000-0000.md @@ -0,0 +1,18 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "ckb" +date = "2021-07-25" +url = "https://github.com/nervosnetwork/ckb/security/advisories/GHSA-48vq-8jqv-gm6f" +aliases = ["GHSA-48vq-8jqv-gm6f"] +[versions] +patched = [">= 0.40.0"] +``` + +# Remote memory exhaustion in ckb + +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.