Boost _ Folks Finance 33526 - [Smart Contract - Insight] Need to check returnAdapterId

Need to check returnAdapterId

Submitted on Mon Jul 22 2024 11:24:41 GMT-0400 (Atlantic Standard Time) by @cryptoticky for Boost | Folks Finance

Report ID: #33526

Report type: Smart Contract

Report severity: Insight

Target: https://testnet.snowtrace.io/address/0x89df7db4af48Ec7A84DE09F755ade9AF1940420b

Impacts:

  • Permanent freezing of funds

Description

Need to check returnAdapterId

Vulnerability Details

SpokeToken.deposit, SpokeToken.repay, SpokeToken.createloanAndDeposit

When this function is called, it attempts to call the hub.receiveMessage function on the hubChain, which can fail for various reasons.

If this happens, the transferred tokens remain in either the hubPool contract, SpokeGasToken, or SpokeErc20Token contract.

If the BridgeRouterHub.reverseMessage function is then called, the message request is reversed, and the tokens are returned to the user.

However, if the returnAdapterId is incorrect, reversing the message is not possible. As a result, the user's funds remain locked in these contracts.

Proof of Concept

The result is

Recommendation

Need to check returnAdapterId in SpokeToken.sol

Proof of concept

Proof of Concept

The result is

Last updated

Was this helpful?