Skip to content

Commit 9bf5768

Browse files
committed
Merge #16885: doc: Update tx-size-small comment with relevant CVE disclosure
c4b0c08 Update tx-size-small comment with relevant CVE disclosure (Gregory Sanders) Pull request description: Code first introduced under bitcoin/bitcoin#11423 with essentially no description and no discussion. ACKs for top commit: MarcoFalke: ACK c4b0c08 fanquake: ACK c4b0c08 Tree-SHA512: 95d5c92998b8b1e944c477dbaee265b62612b6e815099ab31d9ff580b4dff777abaf7f326a284644709f918aa1510412d62310689b1250ef6e64de7b19ca9f71
2 parents 59c138d + c4b0c08 commit 9bf5768

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/validation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
574574

575575
// Do not work on transactions that are too small.
576576
// A transaction with 1 segwit input and 1 P2WPHK output has non-witness size of 82 bytes.
577-
// Transactions smaller than this are not relayed to reduce unnecessary malloc overhead.
577+
// Transactions smaller than this are not relayed to mitigate CVE-2017-12842 by not relaying
578+
// 64-byte transactions.
578579
if (::GetSerializeSize(tx, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) < MIN_STANDARD_TX_NONWITNESS_SIZE)
579580
return state.Invalid(ValidationInvalidReason::TX_NOT_STANDARD, false, REJECT_NONSTANDARD, "tx-size-small");
580581

test/functional/data/invalid_txs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ def get_tx(self):
9999
return tx
100100

101101

102+
# The following check prevents exploit of lack of merkle
103+
# tree depth commitment (CVE-2017-12842)
102104
class SizeTooSmall(BadTxTemplate):
103105
reject_reason = "tx-size-small"
104106
expect_disconnect = False

0 commit comments

Comments
 (0)