osmosis-labs / osmosis

The AMM Laboratory
https://app.osmosis.zone
Apache License 2.0
890 stars 585 forks source link

Full token factory Before Send Hook impact on IBC #2633

Open dalmirel opened 2 years ago

dalmirel commented 2 years ago

The main task during the Informal Audit of Before Send hook design and implementation was to detect the possible area of impact and to see if there are places that could lead to panicking in modules affected the most.

Artifacts:

Expectations:

Analysis Summary:

The IBC applications that directly or indirectly call Send functions in the bank module, which implement the Before Send hook, are Transfer (ics-20), and on the other hand, Interchain Accounts (ics-27) only manipulates with accounts using the Auth module.

Potential problematic places:

were analyzed in relay.go IBCTransferApp

Concerns:

Conclusion: Impact on IBC is not an issue from the point of:

However, If it is possible to blacklist the escrow account as blockedFROM address in the smart contract, that would mean that: sending through IBC will work (escrow accounts are ok to receive coins) but, The entire mechanism of refunds will be blocked, for certain denomination(s). So, if sending fails for whatever reason (timeout let's say), refunds will not be possible to the sender.

This behavior should be considered, and:

dalmirel commented 2 years ago

Tagging audit collaboration team, to review issues as agreed. @ValarDragon @sunnya97

ljah8 commented 2 years ago

After analyzing the ForceTransfer/BurnFrom features, we concluded that the impact on IBC is the same as the impact of Before Send hook.