The getPositionInfo function does not fully validate the position data returned by GMX, such as checking for negative values or ensuring the data is not stale.
Proof of Concept (PoC):
GMX returns incorrect position data due to a bug or manipulation.
The getPositionInfo function uses the incorrect data to calculate position values, leading to incorrect valuations.
Example:
uint256 netValue =
positionInfo.position.numbers.collateralAmount * prices.shortTokenPrice.min +
positionInfo.fees.funding.claimableLongTokenAmount * prices.longTokenPrice.min +
positionInfo.fees.funding.claimableShortTokenAmount * prices.shortTokenPrice.min -
positionInfo.fees.borrowing.borrowingFeeUsd -
positionInfo.fees.funding.fundingFeeAmount * prices.shortTokenPrice.min -
positionInfo.fees.positionFeeAmount * prices.shortTokenPrice.min;
If any of the values are incorrect, the netValue calculation will be wrong.
Insufficient validation could lead to incorrect position valuations and protocol instability.
Add checks for negative values and ensure the position data is not stale.
Implement additional validation mechanisms to ensure data accuracy.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
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.