Platform: Code4rena
Start Date: 26/01/2024
Pot Size: $25,000 USDC
Total HM: 7
Participants: 5
Period: 7 days
Judge: hansfriese
Total Solo HM: 1
Id: 325
League: ETH
Rank: 4/5
Findings: 4
Award: $0.00
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: sashik_eth
Also found by: rvierdiiev, said
Data not available
When order is updated then caller provides _posId
and _orderId
. Then position of caller is fetched using _posId
. The condition here is that position has more collateral than user wants to update.
Note, that there is no check that _orderId
is somehow related to the position. Because of that anyone can update position of other person and change values. This can be used by attacker to change _limitPrice_e36
to smaller value and earn position's profit or to change trigger price, so position's stop loss will not work for example.
Attacker can change position of other users.
VsCode
Check that order is about position of caller.
Error
#0 - JeffCX
2024-02-02T20:26:17Z
duplicate of #34
#1 - c4-judge
2024-02-03T14:22:40Z
hansfriese marked the issue as duplicate of #34
#2 - c4-judge
2024-02-06T15:07:33Z
hansfriese marked the issue as satisfactory
🌟 Selected for report: said
Also found by: ladboy233, rvierdiiev
Data not available
Order can be updated at any time. This allows to change collateral for order or to change limitPrice_e36
- price that is used to calculate profit of order creator.
Because of that it's possible that after fillOrder
will be executed, then filler will pay and receive not what he expected:
limitPrice_e36
change and set the price that filler will now don't receive any rewards, but will pay even more out token(for example really small price like 1 wei).Filler can lose funds.
VsCode
Provide filler with ability to provide slippage, so he doesn't pay more than he expected.
Error
#0 - JeffCX
2024-02-02T20:34:50Z
duplicate of #22
#1 - c4-judge
2024-02-03T14:33:24Z
hansfriese marked the issue as duplicate of #22
#2 - c4-judge
2024-02-06T15:09:28Z
hansfriese marked the issue as satisfactory
🌟 Selected for report: ladboy233
Also found by: rvierdiiev, said
Data not available
When CloseExactOut
swap is done, it means that hook needs to receive exact amount of borrow token to be able to repay it and withdraw collateral.
if (swapInfo.swapType == SwapType.CloseExactOut) { // slippage control to make sure that swap helper swap correctly _require(IERC20(swapInfo.tokenOut).balanceOf(address(this)) == swapInfo.amtOut, Errors.SLIPPAGE_CONTROL); amtSwapped -= IERC20(swapInfo.tokenIn).balanceOf(address(this)); }
After the swap is executed by swap helper, then for CloseExactOut
swap there is a check, that balance is exactly what is needed to repay.
Such check makes it possible to revert reducePos
call, when CloseExactOut
is used by simply transferring small amount of tokens before. Once it is done, then the check will usually fail for all other same swaps. However, contract will not be broken and it will be possible to make balance 0 again.
CloseExactOut swap can be rejected, when it is needed for attacker. In such case attacker can grief user or can use such approach to prevent user from decreasing position.
VsCode
Check that balance is not less than what is needed to repay.
Error
#0 - JeffCX
2024-02-02T20:19:52Z
duplicate of #16
#1 - c4-judge
2024-02-03T14:41:52Z
hansfriese marked the issue as duplicate of #16
#2 - c4-judge
2024-02-06T15:18:23Z
hansfriese marked the issue as satisfactory
🌟 Selected for report: ladboy233
Also found by: rvierdiiev
Data not available
Users can wrap their merchant moe lp tokens to the WLpMoeMasterChef contract to use it as collateral in init protocol.
Merchant moe MasterChef
contract has emergencyWithdraw
function(i don't know how to copy the line from explorer.mantle.xyz) that allows to withdraw lp tokens from contract in case of emergency in some rewarder contract or other cases. In this case there will be no claiming of rewards, just transferring of lp tokens.
But WLpMoeMasterChef
doesn't have integration with that function which takes user's lp token under a risk.
In case of emergency users will not be able to unwrap.
VsCode
Add integration with function.
Error
#0 - JeffCX
2024-02-02T20:13:56Z
duplicate of #2
recommendation is the same
#1 - c4-judge
2024-02-04T04:40:10Z
hansfriese marked the issue as duplicate of #2
#2 - c4-judge
2024-02-06T16:01:50Z
hansfriese marked the issue as satisfactory
🌟 Selected for report: ladboy233
Also found by: 0x73696d616f, rvierdiiev, sashik_eth
Data not available
When user locks LP tokens in the WLpMoeMasterChef
, then erc721 token is created for him. Later user can do whatever he wants with this erc721 token. So it's possible that such tokens will be traded on markets.
WLpMoeMasterChef.unwrap
function decreases __lpBalances
for the token. Currently there is no guarantee for the purchaser, that he will receive nft with LP amount that he wanted to buy as nft owner can decrease/close whole position right before order will be filled in the nft marketplace.
Nft purchaser can get less amount of LP.
VsCode
Add special function like lockNftForTrade
that can be called by owner to signal trading. It will lock ability to unwrap position for some period of time. During this time the trade should happen.
Error
#0 - c4-judge
2024-02-04T04:33:36Z
hansfriese marked the issue as primary issue
#1 - c4-sponsor
2024-02-06T11:16:48Z
fez-init (sponsor) disputed
#2 - hansfriese
2024-02-07T16:18:27Z
Here is the sponsor's feedback.
#3 - hansfriese
2024-02-07T16:19:05Z
I agree with the sponsor and QA is more appropriate.
#4 - c4-judge
2024-02-07T16:19:17Z
hansfriese changed the severity to QA (Quality Assurance)
#5 - c4-judge
2024-02-08T12:38:50Z
hansfriese marked the issue as grade-b