From 5e3d9f21df21a822dc210d73a000faba084e6067 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Sat, 27 Jul 2024 19:16:11 +0200 Subject: [PATCH] doc: validation: add a reference to historical header spam vulnerability --- src/validation.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/validation.cpp b/src/validation.cpp index 0384018bc36..3d2fe2364bf 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4202,6 +4202,10 @@ arith_uint256 CalculateClaimedHeadersWork(std::span headers) * enforced in this function (eg by adding a new consensus rule). See comment * in ConnectBlock(). * Note that -reindex-chainstate skips the validation that happens here! + * + * NOTE: failing to check the header's height against the last checkpoint's opened a DoS vector between + * v0.12 and v0.15 (when no additional protection was in place) whereby an attacker could unboundedly + * grow our in-memory block index. See https://bitcoincore.org/en/2024/07/03/disclose-header-spam. */ static bool ContextualCheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, BlockManager& blockman, const ChainstateManager& chainman, const CBlockIndex* pindexPrev) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {