Part of CertiK’s series
CertiK reviewed Venus Protocol (Venus - Correlated token oracles) on 12 Apr 2024: 12 findings, 0 critical; 9 marked fixed, 3 open.
Report hosted on skynet.certik.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 1 | 0 | 0 |
| Medium | 0 | 0 | 1 |
| Low | 2 | 0 | 8 |
In each of the contracts cited, the role `admin` has the authority to update the implementation contract. Any compromise to the `admin` account may allow a hacker to take advantage of this authority and change the implementation contract which is pointed by proxy and therefore execute potential malicious functionality in the implementation contract.
While the tokens used all have 18 decimals, this is implicitly assumed in the `getUnderlyingAmount()` functions where `1 ether` of `EXP_SCALE` is used. To be more explicit, the token decimals can be used to ensure future oracles take into consideration that this value is dependent on the token decimals.
Some of the referenced tokens utilize ERC4626 vaults, whose rate can be manipulated. Additionally, depending on the implementation of the other tokens and staking contracts, their rates may also be manipulatable. For example `sFrax` is an ERC4626 vault utilizing an internal balance for the `totalAssets()`. In this case shares are converted to assets by multiplying by `totalAssets()` and dividing by the total supply of shares. However, this can be manipulated via multiple calls to `deposit()` and `redeem()` by depositing an amount that would cause the maximum rounding error. The rounded amount is then distributed amongst the shares, increasing their value and thus allowing for subsequent deposit calls to take advantage of a greater rounding error. Note that the `sFrax.deposit()` function makes the following check ```solidity require((shares = previewDeposit(assets)) != 0, "ZERO_SHARES"); ``` Which, is why the exploiter always chooses the maximum amount of assets to deposit, that will give 1 share. For example assume that `totalSupply = 1` and `storedTotalAssets = 2` and `_rewardToDistribute = 0` so that `totalAssets() = 2`, so the initial rate is 1 share to 2 assets. - Exploiter calls `deposit(3)` to receive 3*1/2 = 1 share and then `totalSupply = 2` and `totalAssets() = 5`. - Exploiter then calls `redeem(1)` to receive 5 * 1 /2 = 2 assets and `totalSupply = 1` and `totalAssets() = 3`. Rate is now 3 assets to 1 share. - Exploiter calls `deposit(5)` to receive 5*1/3 = 1 share and then `totalSupply = 2` and `totalAssets() = 8`. - Exploiter then calls `redeem(1)` to receive 8 * 1 /2 = 4 assets and `totalSupply = 1` and `totalAssets() = 4`. Rate is now 4 assets to 1 share. - Exploiter calls `deposit(7)`to receive 7*1/4 = 1 share and then `totalSupply = 2` and `totalAssets() = 11`. - Exploiter then calls `redeem(1)` to receive 11 * 1 /2 = 5 assets and `totalSupply = 1` and `totalAssets() = 6`. Rate is now 6 assets to 1 share. - This continues until the attacker reaches the desired manipulated rate for each share. Note, that the cost of this manipulation is at least the desired rate manipulation times the `totalSupply` they do not own. So that if the `totalSupply` not held by a single entity is great enough, then the price manipulation is infeasible.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (12)
1,045 projects reviewed · 1,376 reports · latest May 2025
See CertiK’s auditsSomething wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.
Tell us