The vulnerability in the GMXDeposit
contract arises from the incorrect use of Profit and Loss (PNL) factors, which leads to inaccurate token value calculations. Specifically, the contract incorrectly sets the isDeposit
parameter to false, causing it to utilize the PNL factor intended for withdrawals. As a result, users receive token values that do not conform to the intended risk parameters, which can mislead and impact their decisions regarding token holdings.
The vulnerability originates from a misalignment in the GMXDeposit
contract's use of PNL factors for token value calculation. Within the getLpTokenValue()
function, the isDeposit
parameter is erroneously set to false, which triggers the usage of the PNL factor designated for withdrawals. The code snippet below illustrates the incorrect utilization:
The use of an incorrect PNL factor results in token values that do not conform to the intended risk parameters.
Manual analysis
Review and update the code to ensure that the correct PNL factor, whether for deposits or withdrawals, is consistently applied in token value calculations.
Impact: Medium Likelihood: High The impact of using a wrong price (conservative vs optimistic) is limited, especially given the users specify the slippage.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.