Protocol assumes that all future collateral and prices will have 18 decimals #432
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-479
edited-by-warden
grade-b
Q-67
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L109
Vulnerability details
Impact
The sponsor will provide support for additional LSTs if Eigenlayer accepts them. They may also switch to a different oracle if a better one becomes available.
Therefore, I took time to explore potential issues that could arise if more LSTs are supported or the oracle is replaced in this system.
The exchange rate cannot be accurately calculated or utilized if the collateral token or the price return by any orale does not have 18 decimal places.
If it uses more decimals, users will appear way more deposited than they are.
If it uses less decimals, users will appear way less deposited than they are.
As a result, users may be able to withdraw significantly more reETH than they should be able to or they may mint significantly less than expected.
Proof of Concept
LRTDepositPool.sol
Attacker can drain the contract by minting a large number of tokens if the system supports LSTs with more than 18 decimals. The same risk applies if the oracle has more than 18 decimals.
Tools Used
VS Code
Recommended Mitigation Steps
Do not assume that LSTs or price oracles have 18 decimals.
Assessed type
Decimal
The text was updated successfully, but these errors were encountered: