Quick answers
- Is This vulnerability exploited in the wild?
- No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
- How severe is This vulnerability?
- Low severity, with a CVSS score of 3.1, published 5 August 2021.
- Which products and versions are affected?
- @liquity/contracts (npm) SEMVER:introduced=0,last_affected=1.0.0.
- Is there a fix for This vulnerability?
- No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
- How is This vulnerability attacked?
- It is attacked over the network.
- Am I affected?
- Check whether you run @liquity/contracts (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
Technical details
The vulnerability is an incorrect arithmetic calculation in the batchLiquidateTroves() function within TroveManager.sol. When computing the system's entire collateral during batch liquidation in Recovery Mode, the function fails to exclude the liquidated trove's surplus collateral, which should be removed from the calculation since liquidation makes that surplus claimable by the trove owner. This temporary miscalculation causes the TCR check to be inaccurate for the duration of the transaction. The bug requires a specific set of preconditions: the system must be in Recovery Mode with TCR near the 150% boundary (within 0.53% margin for a 1% collateral trove), and liquidations must be ordered in a particular sequence to trigger the distortion. No authentication is required; the attack vector is network-based. Once the transaction completes, the TCR is recalculated correctly. No mainnet patch has been deployed due to the protocol's immutability and the low severity of the issue.
Affected products
- Liquity contracts 1.0.0 and earlier
Timeline
- 2021-07-09: disclosed
- 2021-08-05: advisory