Closed code423n4 closed 1 year ago
duplicate of #346
Picodes marked the issue as nullified
Picodes marked the issue as not nullified
Picodes marked the issue as primary issue
Picodes marked the issue as duplicate of #91
Picodes marked the issue as satisfactory
Picodes marked the issue as partial-50
Lines of code
https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L243
Vulnerability details
Impact
Anyone can call
AutoPxGmx::compound
. Hence a staker in the10000
(1% fee) uniswap pool can call compound with that pool and take a larger fee from AutoPxGmx users maximizing their gains and griefing users.Proof of Concept
fee
chooses which uniswap pool to use for trading rewardweth
forgmx
, which is then used for more staking:vaults/AutoPxGmx.sol
:Since
fee
is a parameter that the caller chooses a staker in the 1% feegmx-weth
uniswap pool can front run or just periodically callAutoPxGmx::compound
to maximize their gains and also grief AutoPxGmx users.Tools Used
vs code
Recommended Mitigation Steps
Use the fee
poolFee
which is used whencompound
is automatically called from other functions in the contract.