Closed code423n4 closed 2 years ago
Warden spotted a weak spot in the contract, but did not specify a way to exploit it or provide a POC for it. Therefore, I believe it is unsatisfactory.
0xean marked the issue as duplicate
0xean marked the issue as partial-50
Lines of code
https://github.com/code-423n4/2022-11-size/blob/main/src/SizeSealed.sol#L217-L330
Vulnerability details
Impact
Draining baseToken from SizeSealed contract by calling finalize function multiple times
Proof of Concept
The
finalize()
function can be called multiple times by providing clearingQuote totype(uint128).max
.Currently inside
finalize()
function there is no check condition if an auction already callfinalize()
. The only close check condition to this is theatState
modifier which will prevent calling thisfinalize()
again because it will move fromRevealPeriod
toFinalized
state (if the clearingQuote is for some number (not type(uint128).max value)if this call being executed multiple times it can drained the contract's
baseToken
Tools Used
Manual analysis
Recommended Mitigation Steps
check condition if an auction is already called
finalize()
function, (perhaps by storing to the auction storage if it's being finalized), if so then revert