there are two instances where infinite token approval (type(uint256).max) is granted - to the Swan contract and to the Swan coordinator
Given the allowance is infinite , If there is ever a need to revoke or reduce the allowance (e.g., due to security concerns or changes in operational requirements), there is no built-in function in the BuyerAgent contract to do so.
Code in question: In BuyerAgent.sol :
Security Risk: If either the Swan contract or its coordinator is compromised or behaves maliciously, they could transfer an unlimited number of tokens from the buyer agent’s balance, leading to a complete loss of funds.
Manual review
Use specific approvals whenever necessary instead of infinte approvals.
Implement a Revoke Approval Functionality: Add a function that allows the owner of the buyer agent to revoke or reduce approvals when they are no longer needed.
Use safeIncreaseAllowance() and safeDecreaseAllowance() from safeERC20 lib.
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.