wallet2: validate key image domain in reserve proofs

Reported by zkao, a tool by zkSecurity

(cherry picked from commit 1bb17925fdff1494ec8f7a127c9c6cd814c36e69)
This commit is contained in:
selsta
2026-10-04 18:50:22 -04:00
committed by such-gitea
parent 281652a673
commit 81d781a965
+2
View File
@@ -13446,6 +13446,8 @@ bool wallet2::check_reserve_proof(const cryptonote::account_public_address &addr
{
THROW_WALLET_EXCEPTION_IF(!seen_key_images.insert(proof.key_image).second, error::wallet_internal_error, "Duplicate key image in reserve proof");
THROW_WALLET_EXCEPTION_IF(!seen_outputs.emplace(proof.txid, proof.index_in_tx).second, error::wallet_internal_error, "Duplicate output in reserve proof");
THROW_WALLET_EXCEPTION_IF(rct::ki2rct(proof.key_image) == rct::identity() || !rct::isInMainSubgroup(rct::ki2rct(proof.key_image)),
error::wallet_internal_error, "Invalid key image in reserve proof");
}
THROW_WALLET_EXCEPTION_IF(subaddr_spendkeys.count(address.m_spend_public_key) == 0, error::wallet_internal_error,