# Collateral can already be seized even when negRiskMarket is not fully resolved

PredictDotLoan treats a UMA-reported but still-flagged negRisk outcome as final, letting lenders seize collateral before the market is truly determined.

- Payout: Audit contest
- Severity: medium
- Program: Predict Fun
- Found by: PUSH0
- Disclosed: 2024-09-19
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-09-predict-fun-judging/issues/113
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-09-predict-fun%3AM-2
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:business-logic vuln:oracle-manipulation

**Target:** PredictDotLoan lending contract / negRisk market resolution
**Root cause:** _isQuestionPriceAvailable returns true when the UMA adapter reports an outcome OR the negRisk market is determined, ignoring that the negRiskAdapterOperator can still flag/change the UMA answer during the dispute window.
**Steps:**
1. Lender creates a loan against a difficult negRisk market that resolves shortly after loan expiry.
2. UMA oracle reports an answer; negRiskAdapterOperator flags it, so the market is not yet determined.
3. _isQuestionPriceAvailable returns true because the UMA adapter already reported, so the loan can be liquidated.
4. Lender seizes borrower collateral; if the flagged answer later changes, borrower loses funds unfairly.
**How found:** Code review of _isQuestionPriceAvailable noticed the OR between UMA adapter availability and _isNegRiskMarketDetermined, then cross-referenced NegRiskOperator/UmaCtfAdapter to confirm the operator can still change a reported answer.
**Exploitation:** Lender originates a loan on a volatile negRisk market timed to expire just after UMA reports but before the negRiskAdapterOperator dispute window closes; the premature availability check lets the lender liquidate and take collateral before the true outcome is settled.
**Insight:** When a protocol ORs two 'resolved' signals, check whether either signal is only provisional; oracle dispute/flag windows mean 'reported' != 'final' and can let liquidation fire early.

## Proof of concept (copied exactly from the original report)

**Vulnerable _isQuestionPriceAvailable function code**

```
function _isQuestionPriceAvailable(
        QuestionType questionType,
        bytes32 questionId
    ) private view returns (bool isAvailable) {
        if (questionType == QuestionType.Binary) {
            (isAvailable, ) = _isBinaryOutcomeQuestionPriceAvailable(UMA_CTF_ADAPTER, questionId);
        } else {
            (isAvailable, ) = _isBinaryOutcomeQuestionPriceAvailable(NEG_RISK_UMA_CTF_ADAPTER, questionId);
            isAvailable = isAvailable || _isNegRiskMarketDetermined(questionId);
```

