The vault collateral value lacks adequate validation. The current implementation does not verify validity of the collateral value, which can result in incorrect calculations, potentially resulting in the liquidation of the vault.
The Vault calculates the total EUR value of all acceptedTokens and the balance of the Vault of all these tokens. The return value of the average price is not validated, potentially resulting in a lower total EURO value than the contract really has.
https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/SmartVaultV3.sol#L67-L73
The lack of adequate validation for the vault collateral value introduces a risk of incorrect financial calculations and undermines the reliability of the system's valuation process. This can potentially lead to financial inaccuracies and compromise the integrity of the vault's operations.
The Vault has the following balances
1 wbtc
500 arb
2 eth
PriceCalculator returns correct value
39,300 EUR is minted
The PriceCalculator returns 0 for wbtc, but the rest is correctly returned
Token price used: Sat, 30 Dec, 8.35PM
| Collateral | Amount | Value | Total Value in EUR |
|---|---|---|---|
| wbtc | 1 | 38383.89 | 38,383.89 |
| arb | 500 | 1.36 | 680.23 |
| eth | 2 | 2083.07 | 4,166.13 |
Total EurCollateral value: 43,230.25 EUR
| Collateral | Amount | Value | Total Value in EUR |
|---|---|---|---|
| wbtc | 1 | 0 | 0 |
| arb | 500 | 1.36 | 680.23 |
| eth | 2 | 2083.07 | 4,166.13 |
Total EurCollateral value: 4,846.36 EUR
Resulting in a under collateral vault, which can be liquidated and result in loss funds
Check the return value of the PriceCalculator and revert if the price is zero
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.