Closed github-actions[bot] closed 1 year ago
Disagree with severity since the PoC does not identify how a deposit cap could be viewed as an attack. The revert can be prevented by doing some off chain checks before trying to deposit.
Agree with Sponsor, Worst case a deposit reverts because of the deposit cap set by a GMX admin. Considering this a low.
ctf_sec
medium
Rage trade junior vault deposit is subject to deposit cap restriction
Summary
Rage trade junior vault deposit is subject to deposit cap
Vulnerability Detail
In the current implementation,
the code integrate with the deposit and redeem and withdraw function
However, the junior vault of the rage trade is subject to a deposit cap set by admin.
https://github.com/RageTrade/delta-neutral-gmx-vaults/blob/a2107d37b789494454bd4ede7d217d8723474de4/contracts/vaults/DnGmxJuniorVault.sol#L183
Such parameter is to limit to the deposit
Impact
When the admin on rage trade adjust the deposit cap or the deposit cap on rage trade exceeds the max deposit cap, deposit on the sentiment can revert.
Code Snippet
https://github.com/sherlock-audit/2023-01-sentiment/blob/main/controller-52/src/rage/DNGMXVaultController.sol#L51
Tool used
Manual Review
Recommendation
We recommend the protocol call preview function first to calculate how many shares can be minted before calling deposit and also check the deposit cap on rage trade side instead of just validating the deposit signature and return the can call as tru.