Closed sherlock-admin closed 1 year ago
Dispute severity: based on the impact criteria, we believe this is a Medium
severity issue! While it is a user input error, and we do put some responsibility on them to get the quote details right if they're setting up the tx manually, it's still an unfortunately state
We appreciate the call out
Duplicate of #29. One of the many occurrences listed of this same issue
From #29: Periphery#combine may leave excess underlying in the contract due to _fromTarget unwrapping to underlying and the quote may not swap them all.
Bauer
high
User will lose the target token
Summary
Users can burn PT and YT to get target token. However, if the
quote.sellToken
is the same asquote.buyToken
, but not the same as underly token and target token ,then there is no swap on 0x exchange, the_fillQuote
return 0 amount ofquote.buyToken
. The protocol only transfer the buy token to the user, not the target token. User will lose the target token.Vulnerability Detail
The
combine()
is used to reconstitute Target by burning PT and YT. The protocol first transfer PTs and YTs tokens from msg.sender toPerphery
contract. Then, call theDivider.combine()
to reconstitute target by burning PT and YT. Next, try to swapquote.sellToken
toquote.buyToken
on 0x exchange.Thequote.sellToken
andquote.buyToken
parameter are specified by the user. However ,if thequote.sellToken
is the same asquote.buyToken
, but not the same as underly token and target token , then there is no swap on 0x exchange.User will lose the target token.Impact
User will lose the target token
Code Snippet
https://github.com/sherlock-audit/2023-03-sense/blob/main/sense-v1/pkg/core/src/Periphery.sol#L433-L449 https://github.com/sherlock-audit/2023-03-sense/blob/main/sense-v1/pkg/core/src/Periphery.sol#L903
Tool used
Manual Review
Recommendation
Inside the
combine()
function ,transfer target token to users.Duplicate of #29