aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Sanders <[email protected]>2019-09-16 12:11:05 -0400
committerGregory Sanders <[email protected]>2019-09-18 16:21:44 -0400
commitc4b0c08f7c91bcef48dd023982ff132795575247 (patch)
tree3739225d8183fb9881056aaeece338d34cccbaaf
parentMerge #16737: test: Establish only one connection between nodes in rpc_invali... (diff)
downloaddiscoin-c4b0c08f7c91bcef48dd023982ff132795575247.tar.xz
discoin-c4b0c08f7c91bcef48dd023982ff132795575247.zip
Update tx-size-small comment with relevant CVE disclosure
-rw-r--r--src/validation.cpp3
-rw-r--r--test/functional/data/invalid_txs.py2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 6a9b0c95f..5b195bf7d 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -461,7 +461,8 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
// Do not work on transactions that are too small.
// A transaction with 1 segwit input and 1 P2WPHK output has non-witness size of 82 bytes.
- // Transactions smaller than this are not relayed to reduce unnecessary malloc overhead.
+ // Transactions smaller than this are not relayed to mitigate CVE-2017-12842 by not relaying
+ // 64-byte transactions.
if (::GetSerializeSize(tx, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) < MIN_STANDARD_TX_NONWITNESS_SIZE)
return state.Invalid(ValidationInvalidReason::TX_NOT_STANDARD, false, REJECT_NONSTANDARD, "tx-size-small");
diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py
index 454eb583f..a21a61398 100644
--- a/test/functional/data/invalid_txs.py
+++ b/test/functional/data/invalid_txs.py
@@ -82,6 +82,8 @@ class InputMissing(BadTxTemplate):
return tx
+# The following check prevents exploit of lack of merkle
+# tree depth commitment (CVE-2017-12842)
class SizeTooSmall(BadTxTemplate):
reject_reason = "tx-size-small"
expect_disconnect = False