RubiconMarket._buys
will not work for V1 offers due to the reversion in cancel
method.
#1324
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
H-01
primary issue
Highest quality submission among a set of duplicates
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2023-04-rubicon/blob/511636d889742296a54392875a35e4c0c4727bb7/contracts/RubiconMarket.sol#L1201-L1202
Vulnerability details
Impact
RubiconMarket._buys
tries to cancel dust remaining offers, but it fails for V1 offers. So it blocksRubiconMarket._buys
.Proof of Concept
In
RubiconMarket._buys
, it tries to cancel an offer with dust pay token amount after fulfilling. So it setsdustId
so it can pass theRubiconMarket.can_cancel
modifier.But when we move into
cancel
method, there is another validation.RubiconMarket.cancel
will callSimpleMarket.cancel
, andSimpleMarket.cancel
tries to return dust pay token amount to owner.In this case,
msg.sender
is different from_offer.recipient
soSimpleMarket.cancel
will treat this as a V2 offer, while it can be a valid V1 offer. So for a V1 offer, it tries to send pay token amount to_offer.owner
, and it isaddress(0)
for V1 offers. So it will revert andSimpleMarket.cancel
will not work although it passesRubiconMarket.can_cancel
modifier. This will block_buy
method.Tools Used
Manual Review
Recommended Mitigation Steps
In
SimpleMarket.cancel
, we should refund pay token amount to_offer.recipient
when_offer.owner
isaddress(0)
.The text was updated successfully, but these errors were encountered: