What changed, and why it matters
This change tightens when a Monero wallet tries to decrypt a short encrypted payment ID. Previously, the wallet would attempt decryption even when the transaction outputs were received via an additional (non-main) transaction public key. Now it only decrypts the payment ID when at least one output was received using the main transaction public key. This prevents a wallet from incorrectly associating a payment ID with a transaction that was not actually intended for the main address, which could lead to misattribution of payments or privacy issues.
Review whether this change fully addresses the underlying issue across all wallet code paths that decrypt payment IDs, and consider whether a security advisory or release note is warranted given the privacy implications.
Security signals we found
Incorrect payment ID association could lead to payment misattribution
Privacy-relevant wallet behavior change
Gating decryption on actual main-key output receipt
No explicit CVE or security advisory referenced in commit
Evidence from the diff
In wallet2::process_new_transaction(), the patch adds a boolean received_with_main_tx_pub_key that is set when an output is received using the main derivation (tx_scan_info[i].received->derivation == derivation). The subsequent encrypted payment ID decryption is now gated by !miner_tx && received_with_main_tx_pub_key. This ensures short payment IDs are only decrypted and attached to transactions where the wallet actually received an output via the primary tx_pub_key, avoiding incorrect payment ID binding when outputs are received via additional tx pub keys (e.g., subaddresses or multisig scenarios).
Changed components
src/wallet/wallet2.cppwallet2::process_new_transaction()encrypted payment ID handlingInspect captured patch +6 / −1
### src/wallet/wallet2.cpp
@@ -2480,6 +2480,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
}
int num_vouts_received = 0;
+ bool received_with_main_tx_pub_key = false;
tx_pub_key = pub_key_field.pub_key;
const cryptonote::account_keys& keys = m_account.get_keys();
crypto::key_derivation derivation;
@@ -2561,10 +2562,12 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
THROW_WALLET_EXCEPTION_IF(tx_scan_info[i].error, error::acc_outs_lookup_error, tx, tx_pub_key, m_account.get_keys());
if (tx_scan_info[i].received)
{
+ const bool received_with_main_derivation = tx_scan_info[i].received->derivation == derivation;
hwdev.conceal_derivation(tx_scan_info[i].received->derivation, tx_pub_key, additional_tx_pub_keys.data, derivation, additional_derivations);
scan_output(tx, miner_tx, tx_pub_key, i, tx_scan_info[i], num_vouts_received, tx_money_got_in_outs, outs, pool);
if (!tx_scan_info[i].error)
{
+ received_with_main_tx_pub_key |= received_with_main_derivation;
tx_amounts_individual_outs[tx_scan_info[i].received->index].push_back(tx_scan_info[i].money_transfered);
}
}
@@ -2582,10 +2585,12 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
hw::device &hwdev = m_account.get_device();
boost::unique_lock<hw::device> hwdev_lock (hwdev);
hwdev.set_mode(hw::device::NONE);
+ const bool received_with_main_derivation = tx_scan_info[i].received->derivation == derivation;
hwdev.conceal_derivation(tx_scan_info[i].received->derivation, tx_pub_key, additional_tx_pub_keys.data, derivation, additional_derivations);
scan_output(tx, miner_tx, tx_pub_key, i, tx_scan_info[i], num_vouts_received, tx_money_got_in_outs, outs, pool);
if (!tx_scan_info[i].error)
{
+ received_with_main_tx_pub_key |= received_with_main_derivation;
tx_amounts_individual_outs[tx_scan_info[i].received->index].push_back(tx_scan_info[i].money_transfered);
}
}
@@ -2623,7 +2628,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
if (find_tx_extra_field_by_type(tx_extra_fields, extra_nonce))
{
crypto::hash8 payment_id8 = null_hash8;
- if(get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8))
+ if(!miner_tx && received_with_main_tx_pub_key && get_encrypted_payment_id_from_tx_extra_nonce(extra_nonce.nonce, payment_id8))
{
// We got a payment ID to go with this tx
LOG_PRINT_L2("Found encrypted payment ID: " << payment_id8);Why 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.