The contract does not properly validate the collateral tokens provided by users. This could allow invalid or malicious tokens to enter the system, leading to unexpected behavior or even loss of funds.
In functions such as approveCollateralTokenForAave or batchApproveCollateralTokenForAave, there is no validation to ensure that the _collateralTokens provided are supported, legitimate, or non-malicious. Malicious tokens with unusual behavior could manipulate the system.
Example code snippet:
There is no check to ensure the tokens in _collateralTokens are supported or meet specific criteria.
High Impact due to the following reasons:
Fund Loss Risk: Malicious or unsupported tokens could lead to incorrect approvals or transfers.
Systemic Risk: The entire protocol could be affected if a token triggers cascading failures.
Proof of Concept
The vulnerability allows unsupported or malicious tokens to be approved as collateral, potentially leading to system exploitation.
Attacker: Provides unsupported or malicious tokens to the protocol.
Victim: The protocol, which blindly accepts tokens as valid collateral.
Protocol: Executes the batchApproveCollateralTokenForAave function without validating inputs.
Line 6: A malicious token is created and added to the maliciousTokens array.
Line 12: The attack function triggers the protocol to approve the malicious token.
Line 17: The protocol fails to validate tokens, approving the malicious one blindly.
The protocol accepts the malicious token, potentially leading to exploitation.
Funds or collateral held by users could be drained or manipulated.
Manual code review
Whitelist Tokens: Maintain a list of supported tokens and validate each token before approving it.
Sanitize Inputs: Ensure _collateralTokens contains no duplicates or invalid addresses.
Add Unit Tests: Include tests for unsupported or malicious token scenarios.
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.