In ThunderLoan.sol:134
, the current implementation uses a low-level functionCall
to interact with a flash loan receiver. However, a dedicated interface for the flash loan receiver exists which is not being utilized. Using the interface would lead to safer and more predictable code by ensuring only intended functions can be called and parameters are passed correctly.
Vulnerable code:
The lack of interface usage for the flash loan receiver increases the risk of unexpected behavior and vulnerabilities such as reentrancy attacks. Low-level calls should be avoided when high-level abstractions are available, as they do not perform argument count or value checks, increasing the risk of errors.
Manual Review
Vs Code
It is recommended to modify the smart contract to use the existing flash loan receiver interface instead of the low-level functionCall
method. The interface enforces the contract to adhere to specific method signatures and parameter types, which mitigates potential security risks associated with arbitrary function calls. The code segment handling the interaction with the flash loan receiver should be replaced with an interface call like this:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.