# Any liquidators can pretend to be a loan contract to validate offers, due to insufficient validation

Pool.validateOffer only checks caller is an accepted caller, so a whitelisted liquidator can fabricate an offer and corrupt __outstandingValues accounting without a real loan.

- Payout: Audit contest
- Severity: medium
- Program: Gondi
- Found by: oakcobalt
- Disclosed: 2024-07-25
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-04-gondi-findings/issues/41
- Library page: https://bugbountylibrary.com/r/c4%3A2024-04-gondi%3AM-10
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:access-control vuln:business-logic

**Target:** Pool.sol validateOffer / LoanManager access control
**Root cause:** onlyAcceptedCallers checks membership in _acceptedCallers (which includes liquidators) but never verifies _isLoanContract(msg.sender), so validateOffer's storage writes to __outstandingValues are reachable by liquidators.
**Steps:**
1. Liquidator (an accepted caller) calls `Pool.validateOffer(fabricatedOffer, protocolFee)` directly.
2. Passes onlyAcceptedCallers since liquidator is in _acceptedCallers.
3. Function writes to `__outstandingValues` without loan-contract signature/expiration checks, collateral transfer, or loan storage recording.
4. Accounting state diverges from real loans.
**How found:** Code reading: noticed _acceptedCallers contains both liquidators and loan contracts, then observed validateOffer's modifier only checks membership, not loan-contract identity, while emitLoan performs the real validation.
**Exploitation:** A whitelisted liquidator bypasses MultiSourceLoan.emitLoan's signature verification, expiration checks, collateral NFT transfer, and loan recording by calling validateOffer directly with a fabricated offer, mutating pool outstanding values.
**Insight:** When a modifier gates on a set that mixes privileged roles, check whether each call site needs a specific role subset; here liquidators and loan contracts share one allowlist but validateOffer assumes loan-contract-only semantics.

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

**validateOffer access control only checks accepted callers**

```
function validateOffer(bytes calldata _offer, uint256 _protocolFee) external override onlyAcceptedCallers {
        if (!isActive) {
            revert PoolStatusError();
        }
```

**onlyAcceptedCallers modifier missing loan contract check**

```
modifier onlyAcceptedCallers() {
        if (!_acceptedCallers.contains(msg.sender)) {
            revert CallerNotAccepted();
        }
        _;
    }
```

