Skip to content

Commit 5e3d9f2

Browse files
committed
doc: validation: add a reference to historical header spam vulnerability
1 parent ede388d commit 5e3d9f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/validation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4202,6 +4202,10 @@ arith_uint256 CalculateClaimedHeadersWork(std::span<const CBlockHeader> headers)
42024202
* enforced in this function (eg by adding a new consensus rule). See comment
42034203
* in ConnectBlock().
42044204
* Note that -reindex-chainstate skips the validation that happens here!
4205+
*
4206+
* NOTE: failing to check the header's height against the last checkpoint's opened a DoS vector between
4207+
* v0.12 and v0.15 (when no additional protection was in place) whereby an attacker could unboundedly
4208+
* grow our in-memory block index. See https://bitcoincore.org/en/2024/07/03/disclose-header-spam.
42054209
*/
42064210
static bool ContextualCheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, BlockManager& blockman, const ChainstateManager& chainman, const CBlockIndex* pindexPrev) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
42074211
{

0 commit comments

Comments
 (0)