Submitted by neko_nyaa, also found by 8olidity, Bnke0x0, brgltd, ctf_sec, djxploit, horsefacts, jayphbee, Matin, and TwelveSec.
When bidding, the contract pulls the quote token from the bidder to itself.
https://github.com/code-423n4/2022-11-size/blob/main/src/SizeSealed.sol#L163
However, since the contract uses Solmates SafeTransferLib
Therefore if the token address is empty, the transfer will succeed silently, but not crediting the contract with any tokens.
This error opens up room for a honeypot attack similar to the Qubit Finance hack in January 2022.
In particular, it has became popular for protocols to deploy their token across multiple networks using the same deploying address, so that they can control the address nonce and ensuring a consistent token address across different networks.
E.g. 1INCH has the same token address on Ethereum and BSC, and GEL token has the same address on Ethereum, Fantom and Polygon. There are other protocols have same contract addresses across different chains, and its not hard to imagine such thing for their protocol token too, if any.
Assuming that Alice is the attacker, Bob is the victim. Alice has two accounts, namely Alice1 and Alice2. Denote token Q as the quote token.
As a result, the contracts Q token balance is 1e18, Alice gets away with all her base tokens and 1000e18 Q tokens that are Bobs. Alice has stolen Bobs funds.
Consider using OpenZeppelins SafeERC20 instead, which has checks that an address does indeed have a contract.
Ragepit (SIZE) confirmed and commented on duplicate issue #318:
