What changed, and why it matters
This Monero update tightens how the network handles trimmed-down (pruned) transaction data shared between nodes. Before, a node could accept extra junk bytes tacked onto the end of a pruned transaction blob. Now it rejects such blobs. This closes a potential avenue for malformed data to be accepted or processed unexpectedly, which could lead to inconsistent node state or denial-of-service issues.
Apply the patch. Nodes and services running Monero should upgrade to a version containing this fix, especially those accepting pruned transaction data from peers. Monitor for any peer behavior changes or connection issues after deployment.
Security signals we found
New strictness check on pruned transaction blob parsing
Rejection of trailing data after serialized transaction base
Protocol-level input validation change
Potential denial-of-service or consensus inconsistency risk from malformed pruned blobs
Evidence from the diff
The patch adds a require_eof parameter to parse_and_validate_tx_base_from_blob(). When set to true, the parser calls serialization::check_stream_state(ba, !require_eof) to ensure no trailing bytes remain after the base transaction is parsed. The protocol handler now passes require_eof=true for pruned transaction blobs. This prevents pruned transaction blobs with trailing data from being accepted as valid.
Changed components
src/cryptonote_basic/cryptonote_format_utils.cppsrc/cryptonote_basic/cryptonote_format_utils.hsrc/cryptonote_protocol/cryptonote_protocol_handler.inlInspect captured patch +4 / −3
### src/cryptonote_basic/cryptonote_format_utils.cpp
@@ -214,12 +214,13 @@ namespace cryptonote
return true;
}
//---------------------------------------------------------------
- bool parse_and_validate_tx_base_from_blob(const blobdata_ref& tx_blob, transaction& tx, const bool max_size_check)
+ bool parse_and_validate_tx_base_from_blob(const blobdata_ref& tx_blob, transaction& tx, const bool max_size_check, const bool require_eof)
{
CHECK_AND_ASSERT_MES(passes_max_size_check(max_size_check, tx_blob), false, "Tx blob too big");
binary_archive<false> ba{epee::strspan<std::uint8_t>(tx_blob)};
bool r = tx.serialize_base(ba);
CHECK_AND_ASSERT_MES(r, false, "Failed to parse transaction from blob");
+ CHECK_AND_ASSERT_MES(::serialization::check_stream_state(ba, !require_eof), false, "Unexpected trailing data after transaction base");
CHECK_AND_ASSERT_MES(expand_transaction_1(tx, true), false, "Failed to expand transaction data");
tx.invalidate_hashes();
return true;
### src/cryptonote_basic/cryptonote_format_utils.h
@@ -57,7 +57,7 @@ namespace cryptonote
bool parse_and_validate_tx_from_blob(const blobdata_ref& tx_blob, transaction& tx, crypto::hash& tx_hash, crypto::hash& tx_prefix_hash, const bool max_size_check = false);
bool parse_and_validate_tx_from_blob(const blobdata_ref& tx_blob, transaction& tx, crypto::hash& tx_hash, const bool max_size_check = false);
bool parse_and_validate_tx_from_blob(const blobdata_ref& tx_blob, transaction& tx, const bool max_size_check = false);
- bool parse_and_validate_tx_base_from_blob(const blobdata_ref& tx_blob, transaction& tx, const bool max_size_check = false);
+ bool parse_and_validate_tx_base_from_blob(const blobdata_ref& tx_blob, transaction& tx, const bool max_size_check = false, const bool require_eof = false);
/**
* @brief extract transaction version from transaction blob
* @param tx_blob transction blob
### src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -113,7 +113,7 @@ namespace cryptonote
const bool max_size_check = true;
if (is_pruned)
{
- if ((parse_success = cryptonote::parse_and_validate_tx_base_from_blob(tx_entry.blob, tx, max_size_check)))
+ if ((parse_success = cryptonote::parse_and_validate_tx_base_from_blob(tx_entry.blob, tx, max_size_check, /*require_eof=*/true)))
parse_success = cryptonote::get_pruned_transaction_hash(tx, tx_entry.prunable_hash, tx_hash);
}
elseWhy this scored 63/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.