sygmaprotocol / sygma-relayer

GNU Lesser General Public License v3.0
21 stars 20 forks source link

Bad EVM address format on Bitcoin chain deposits, are parsed incorrectly and used on EVM execute proposal #323

Closed LyonSsS closed 2 months ago

LyonSsS commented 3 months ago

Context: Using a bad format for EVM destination address as 0x7FA0A2824EA855EC6aD3eAb3Aa2516EC6626d , when depositing on Bitcoin Chain, it is not disregarded by the Relayer. Instead, the address is converted to 0x0007FA0a2824Ea855eC6aD3eAB3aA2516EC6626d and the proposal is executed, thus living to the lost of user's fund.

We need to prevent this behavior and not execute on destination is the EVM address format is not valid.

Deposit on btc: https://blockstream.info/testnet/address/tb1p2q8kwe4efdg7v6glzk97uuzh09fuec4ql2sl68d0c2nyg6kdl2wswannk0 Output data is here -> image Deposit picked up by the relayer here

Execute proposal here

https://sepolia.etherscan.io/tx/0x04167b4ab567784afd05c37ae4026cc0d357fdd9affc668592ba4933107505a2

LyonSsS commented 2 months ago

This should be migrated to the SDK logic @MakMuftic It seems the older implementation of the relayer works the same. There is already an existing issue for this on the SDK https://github.com/sygmaprotocol/sygma-sdk/issues/367 CC: @mpetrun5

mpetrun5 commented 2 months ago

Closing as this won't be implemented on relayer.