Closed code423n4 closed 1 year ago
Seller can theoretically suffer from abuse if they finalize an auction where malicious buyers bid with nonexisting tokens. However, only seller can be impacted negatively, and it requires serious negligence on their part. Dup of #318 .
0xean marked the issue as duplicate
0xean marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2022-11-size/blob/main/src/SizeSealed.sol#L163
Vulnerability details
Impact
In
bid
function, thesafetransferfrom
function doesn't check the existence of code at the token address. This is a known issue while using solmate's libraries. Hence this may lead to miscalculation of funds and may lead to loss of funds , because ifsafetransferfrom()
is called on a token address that doesn't have contract in it, it will always return success, bypassing the return value check. Due to this protocol will think that funds has been transferred and successful , and records will be accordingly calculated, but in reality funds were never transferred. So this will lead to miscalculation and possibly loss of fundsProof of Concept
https://github.com/code-423n4/2022-11-size/blob/main/src/SizeSealed.sol#L163
Tools Used
Manual review
Recommended Mitigation Steps
As implemented for
baseToken
increateAuction
function, same implementation will also resolve the above issue. Also instead of that, you could use Openzeppelin's library.