approveUnderlying
isn't safe
#260
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Warden finding
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
duplicate
Another warden found this issue
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
0xsanson
Vulnerability details
Impact
In Basket.sol,
approveUnderlying
is used to approve tokens to be spent by the Auction.The current implementation uses a simple
approve
function, instead of the safersafeApprove
. Also it's recommended to have an approve to zero first, since the allowance could be already positive and some tokens (e.g. USDT) wouldn't work in this case.Proof of Concept
https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Basket.sol#L226
Tools Used
editor
Recommended Mitigation Steps
Consider writing
The text was updated successfully, but these errors were encountered: