Submitted by Ruhum
https://github.com/code-423n4/2023-01-astaria/blob/main/src/CollateralToken.sol#L307-L310
Existing flashloans pass the initiator to the recipient in the functions params, e.g. AAVE or Uniswap. Its done to allow the recipient to verify the legitimacy of the call.
The CollateralTokens flashAction() function doesnt pass the initiator. That makes it more difficult to integrate the flashAction functionality. To protect yourself against other people executing the callback you have to:
Considering that most people wont bother with that theres a significant risk of this being abused. While this doesnt affect the Astaria protocol directly, it potentially affects its users and their funds. Because of that, I decided to rate it as MEDIUM.
onFlashAction() is executed with the ERC721 token data (contract addr, ID, and return address) as well as the arbitrary data bytes.
Add the initiator to the callback to allow easy authentication.
androolloyd (Astaria) acknowledged
Picodes (judge) commented:
