# Exploiter can force user into unhealthy condition and liquidate him

Donating low-LTV collateral to a victim's Position skews weighted-average LTV in RiskModule, making a healthy position liquidatable and letting attacker seize collateral.

- Payout: Audit contest
- Severity: medium
- Program: Sentiment
- Found by: A2-security
- Disclosed: 2024-08-07
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2024-08-sentiment-v2-judging/issues/299
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-sentiment-v2%3AM-13
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:liquidation vuln:oracle-manipulation

**Target:** RiskModule.isPositionHealthy / _getMinReqAssetValue in Position/Pool lending protocol
**Root cause:** getAssetValue reads live IERC20.balanceOf(position), so donated tokens inflate totalAssetValue and shift per-asset weights; _getMinReqAssetValue then weights debt toward the low-LTV asset, raising minReqAssetValue above totalAssetValue.
**Steps:**
1. Victim holds portfolio [USDC $1000 @95% LTV, WBTC $10 @30% LTV] in a Position, borrows $940 DAI from a pool.
2. Attacker flash-loans ~$990 WBTC and transfers it directly to the victim's Position address.
3. Attacker calls liquidate; validateLiquidation -> isPositionHealthy recomputes weights: totalAssetValue=$2000, weights [50,50].
4. _getMinReqAssetValue: 940*50/95=494 plus 940*50/30=1566 => ~$2060 > $2000, position deemed unhealthy.
5. Liquidator repays $940 debt, seizes $1000 USDC + $1000 WBTC (incl. donated funds), repays flash loan, keeps profit.
**How found:** Reading RiskModule.getAssetValue and noticing it uses live balanceOf(position) rather than tracked deposits, then reasoning that donations shift the weighted-average LTV used in _getMinReqAssetValue.
**Exploitation:** Attacker flash-loans the low-LTV collateral asset, donates it to the victim Position to skew weighted-average LTV, then liquidates the now-'unhealthy' position to capture donated funds plus victim collateral at discount, repaying the flash loan.
**Insight:** When health checks weight debt by live token balances, any external transfer into the position is an attack surface: look for donation-based manipulation of weighted averages, not just oracle prices.

