nimiq-blockchain: Validity store off by one error
High severity
GitHub Reviewed
Published
Aug 11, 2026
in
nimiq/core-rs-albatross
•
Updated Aug 12, 2026
Description
Published to the GitHub Advisory Database
Aug 12, 2026
Reviewed
Aug 12, 2026
Last updated
Aug 12, 2026
Impact
The validity store treats a transaction with stored
block_number = Xas "in window" only whenX > last_bn - transaction_validity_window_blocks(strict inequality). However the protocol'sTransaction::is_valid_ataccepts a transaction for inclusion in any block in[validity_start_height - blocks_per_batch, validity_start_height + window - 1]. By choosingvalidity_start_height = X + blocks_per_batch(the largest value still compatible with first inclusion at block X), an attacker can replay the same signed transaction in any block B such thatX + window < B < validity_start_height + window, i.e., a contiguous window ofblocks_per_batch - 1blocks (59 on MainNet, ~10 minutes) during which the replay-protection check fails to flag it. The same transaction is then executed twice: the sender is debited twice, the recipient credited twice.Patches
nimiq/core-rs-albatross#3772
Workarounds
No known workarounds
References