qbs
medium
Anyone can give unlimited approval to the Uniswap router for any token in the context of USSD contract.
The approveToRouter
function use a maximum uint256 value as the approval amount, effectively granting unlimited spending allowance to the Uniswap router. This function is marked as public and do not have any modifiers, which means anyone can invoke it.
An attacker can approve any token to the Uniswap router within the context of the USSD contract.
function approveToRouter(address _token) public {
IERC20Upgradeable(_token).approve(
address(uniRouter),
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
);
Manual Review
Ensure that approveToRouter
function is only accessible by authorized entities