raiden-network / raiden-contracts

Raiden Network Smart Contracts
MIT License
53 stars 45 forks source link

Front-running opportunity in OneToN.sol #757

Open pirapira opened 5 years ago

pirapira commented 5 years ago

When an honest service calls OneToN.claim(), another malicious service (maybe collaborating with the owner of the claimed fund) can try to call the same function with another IOU, and deplete the IOU issuer's balance.

As a result, the honest service loses its IOU but it does not get any transfers.

This scenario is just a part of the already accepted double spending problem, but this attack vector should be well-known before the contract is actually used.

pirapira commented 5 years ago

Maybe document this possibility in the spec?

pirapira commented 5 years ago

Maybe, create a limit so only 1/5 of a user's balance can be spent during one block?

pirapira commented 5 years ago

Is submarine send() useful?

karlb commented 4 years ago

Maybe document this possibility in the spec?

It's documented in https://raiden-network-specification.readthedocs.io/en/latest/service_contracts.html#double-spending