Decent Smoke Owl
High
createOrder()
function in StopLimit
and OracleLess
contracts incorrectly transfer funds from user provided recipient
. Since the protocol relies on previous approvals from users, it is possible to create orders against the will of the recipient
who has approved funds to create an order.
Instead of transferring the funds from msg.sender
, funds are incorrectly transferred from msg.sender
.
tokenIn.safeTransferFrom(recipient, address(this), amountIn)
procureTokens(tokenIn, amountIn, recipient, permit, permitPayload)
N/A
N/A
Consider the following scenario:
User A approve StopLimit
to spend his funds in order to create an order.
There will be a short period between the approval and the creation of order.
During this period, attacker can call createOrder()
with recepient
parameter equal to user A address.
Since user A has previously approved the funds, everyone can create an order from his name.
New order can be completely different - other tokenOut
, worse slippage parameters.
And since everyone can trigger performUpkeep()
before user try to modify the malicious order, user will get completely different outcome than his initial desire.
Overall, the impact is unexpected behavior for users. Loss of funds can occur, if there is a high slippage parameter provided by the attacker.
No response
Consider taking the funds from msg.sender
.