superform-xyz / superform-core

Other
98 stars 37 forks source link

fix: Guard against malicious processors [SUP-8873] #639

Closed TamaraRingas closed 3 weeks ago

TamaraRingas commented 1 month ago

Problem

A malicious processor can take advantage of the refund mechanism.

completeCrossChainRebalance() complete a cross chain rebalance initiated by the user with startCrossChainRebalance(). This function could be called only by an address with a ROUTER_PLUS_PROCESSOR_ROLE. As the processor can pass arbitrary data as function arguments to both functions he can take advantage of the refund mechanism, leading to two possible scenarios:

Processor can force unnecessary refunds in completeCrossChainRebalance(): by passing a specific expectedAmountInterimAsset, he can force unnecessary refunds on every payload to be processed. Processor can steal all SuperformRouterPlusAsync funds: by starting a cross chain rebalance himself and thus passing a fake expectedAmountInterimAsset, he can issue a refund to himself stealing funds from the SuperformRouterPlusAsync contract.

Solution

linear[bot] commented 1 month ago

SUP-8873 Guard Against Malicious Processors