In Contract AutoPxGlp, any account can exploit incentive rewards by calling compound(1, 1, false).
Proof of Concept
AutoPxGlp.compound() is a public function without any guard. Any account may get incentive rewards if calling autoPxGlp.compound(1, 1, false) (i.e. opt in incentive option). Especially with front-running by monitoring transactions (in mempool) that will trigger compound() (i.e. depositFsGlp(), depositGlpETH(), depositGlp(), redeem(), withdraw(), and compound()), an attacker can get a stream of incentive rewards.
Tools Used
Manual audit.
Recommended Mitigation Steps
Changing the function visibility from global to internal, or setting some guards on the function call, e.g. only the owner of the contract, or only the owners of GMX/GLP/pxGmx... can call the function, depending on the strategies of system design.
Lines of code
https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGlp.sol#L210-L296
Vulnerability details
Impact
In Contract
AutoPxGlp
, any account can exploit incentive rewards by callingcompound(1, 1, false)
.Proof of Concept
AutoPxGlp.compound()
is a public function without any guard. Any account may get incentive rewards if callingautoPxGlp.compound(1, 1, false)
(i.e. opt in incentive option). Especially with front-running by monitoring transactions (in mempool) that will triggercompound()
(i.e.depositFsGlp(), depositGlpETH(), depositGlp(), redeem(), withdraw(), and compound()
), an attacker can get a stream of incentive rewards.Tools Used
Manual audit.
Recommended Mitigation Steps
Changing the function visibility from
global
tointernal
, or setting some guards on the function call, e.g. only theowner
of the contract, or only theowners
ofGMX/GLP/pxGmx...
can call the function, depending on the strategies of system design.