The contract approves type(uint256).max
for router
.
If the router
address is changed, the previous approval will remain active, potentially leading to security risks.
In the provided implementation, the contract sets the maximum approval for the router without a mechanism to revoke or reduce the approval when the router is no longer in use. This results in perpetual approvals for previously assigned routers, which could pose security risks.
Unlimited token approvals can be exploited if the router
address is compromised. An attacker could misuse the unrevoked approval to transfer tokens without restrictions.
Manual Review
Add a mechanism to revoke existing approvals before assigning a new router address. This ensures that unused approvals are properly invalidated.
Consider implementing a function to explicitly manage token approvals, such as setting them to zero before re-approving with a new limit.
For example:
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.