Does not revoke approval for some addresses after changing them on ReLPContract contract #328
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-1662
low quality report
This report is of especially low quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-08-dopex/blob/main/contracts/reLP/ReLPContract.sol#L150-L163
Vulnerability details
The contract
ReLPContract
allows an admin user changes a list of addresses of aaddresses
state via a functionsetAddresses
includespair
,dopexAMMRouter
,tokenA
andtokenB
,ammRouter
, and so on.After setting these addresses to a new list, the contract will approve the maximum allowance of the
pair
,tokenA
, andtokenB
addresses for theammRouter
address.Everything is okay if the admin calls the first time. But if after that, the admin calls to change to a new
ammRouter
address then the contract does not change the allowance of the old address to zero.This bug will able to increase risks. If any bad thing occurs such as hack accidents in this old
ammRouter
address will permit the drain of all funds in thepair
,tokenA
, andtokenB
addresses.The vulnerable code:
I recommended adding a line to change the allowance of the old
ammRouter
address to zero.Assessed type
Other
The text was updated successfully, but these errors were encountered: