Stratax::calculateOpenParams accepts a TradeDetails struct that includes collateralTokenPrice and borrowTokenPrice. When these fields are non-zero, the function uses them directly without fetching from the oracle. The function and its NatSpec document that prices must be in 8-decimal Chainlink format, but no on-chain validation enforces this.
If a caller provides prices in a different decimal format (e.g. 18 decimals instead of 8), the borrowAmount calculation is scaled by the ratio of the actual and expected decimals. When only one price has the wrong decimal count, the inflation or deflation is not cancelled out, resulting in a borrowAmount that is off by a factor of up to 10^10.
Likelihood:
A frontend or integration passes prices obtained from a non-Chainlink source (e.g. an 18-decimal DEX price feed) without normalizing to 8 decimals before calling calculateOpenParams.
A developer manually specifies only one of the two prices (e.g. for testing or a custom collateral path) and uses a different decimal format than Chainlink's 8-decimal standard.
Impact:
When only the collateral price has wrong decimals (e.g. 18 instead of 8), borrowAmount is inflated by 10^10. Passing this to createLeveragedPosition causes Aave to be asked to borrow an astronomically large amount, which reverts, or if it somehow succeeds, immediately liquidates the position.
When only the borrow price has wrong decimals, borrowAmount is deflated by 10^10. The resulting position is severely underfunded — the collateral supplied far exceeds the debt, leaving most of the user's capital locked idle without generating the intended leverage.
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.
The contest is complete and the rewards are being distributed.