The StabilityPool's token conversion functions use incorrect decimal scaling, allowing attackers to manipulate DEToken
minting/burning ratios when rToken
and DEToken
have different decimal places.
calculateDeCRVUSDAmount
and calculateRcrvUSDAmount
use incorrect scaling if rToken/DEToken decimals differ.
StabilityPool.sol#calculateDeCRVUSDAmount
StabilityPool.sol#calculateRcrvUSDAmount
See this attack Path:
Deposit rToken
(18 decimals)
Receive inflated DEToken
amount (6 decimals)
Exploit decimal mismatch for profit
Drain pool through redemptions
Incorrect minting/burning of DEToken, leading to loss of funds.
manual
Use WadRayMath
for precise scaling and validate token decimal compatibility. Here's the correct implementation using WadRayMath
for precise decimal handling
Both tokens have 18 decimals. Info
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.