Closed code423n4 closed 1 year ago
hansfriese marked the issue as satisfactory
hansfriese marked the issue as duplicate of #21
hansfriese marked the issue as duplicate of #31
wukong-particle marked the issue as sponsor confirmed
Correct finding, correct duplication. Suggestion good as well.
hansfriese changed the severity to 3 (High Risk)
Lines of code
https://github.com/code-423n4/2023-05-particle/blob/1caf678bc20c24c96fc8f6b0046383ff0e9d2a6f/contracts/protocol/ParticleExchange.sol#L688
Vulnerability details
Impact
borrower can block the bidding
Proof of Concept
auctionBuyNft()
When the bid is successful and there is an extra amount, it will be refunded toborrower
The code is as follows:Using
transfer()
, a malicious borrower who is a contract can increase the gas consumption ofreceive()
, causingtransfer()
to revert and thus prevent biddingNote: withdrawEthWithInterest() has a similar problem
Tools Used
Recommended Mitigation Steps
Add
claim
mechanism, iftransfer
fails, it will enter thecliams
queue, andborrower
will executeclaims()
to get back the money.Assessed type
Context