dex: swap claim should check diversified address integrity #3978
Labels
A-dex
Area: Relates to the dex
consensus-breaking
breaking change to execution of on-chain data
security
Issues or work related to security.
Milestone
Is your feature request related to a problem? Please describe.
You should only be able to claim swap outputs once. Instead, an attacker can construct a valid SwapClaim multiple times for the same swap.
Iin the swap claim, we are demonstrating the integrity of the revealed nullifier via
nullifier = hash3(nk, position, swap commitment)
. Elsewhere in the circuit we have the transmission keypk_d
, and the diversified baseB_d
in order to demonstrate swap commitment integrity. However,pk_d
andnk
are not checked to be associated with one another, so an attacker can witness multiple values fornk
in order to generate multiple nullifiers that will each be accepted as valid.PoC: f21d8b5
Describe the solution you'd like
ak
pk_d = [ivk] B_d
deriving the ivk from ak and nkThe text was updated successfully, but these errors were encountered: