A critical flaw exists in Vault.getTotalCreditCapacityUsd()
where collateral assets are not properly normalized to 18 decimals before USD conversion. This causes the vault's credit capacity to be miscalculated by a factor of 10^(18-collateralDecimals), leading to severe miscalculation of available credit and system insolvency.
The protocol uses a standardized 18-decimal system for internal calculations, particularly for USD values. This is evident in how the protocol handles token amounts elsewhere:
This conversion is consistently used throughout the codebase for token amount normalization:
However, in getTotalCreditCapacityUsd()
of vault.sol
leaves, this normalization is missing:
The problem compounds because:
totalAssets()
returns the raw token balance in the token's native decimals
The debt calculation is normalized with 18 decimals.
The vulnerability leads to:
Massively inflated/dinflated credit capacity for low-decimal tokens (e.g., USDC)
Severely undervalued credit capacity for high-decimal tokens , and underflow reverts for correct actions
Manual review and mathematical analysis
Replace the direct casting with proper decimal normalization:
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.