← Benchmarks / Oracle Manipulation Vulnerability
Historical Vulnerability Benchmark #5

Could AuditAgents Detect Oracle Manipulation in a DeFi Lending Contract?

We tested AuditAgents against a simplified DeFi lending contract that relies on a single manipulable price oracle to calculate borrowing power.

RESULT: PARTIAL
Vulnerability Class Oracle / Price Feed
Date June 2026
Score 4 / 5
Hints Provided None

Background

Oracle manipulation is a well-documented attack class in DeFi. When a protocol uses a single external price feed without validation or circuit breakers, an attacker can use flash loans to temporarily move the price reported by the oracle, borrow far more than the collateral actually supports, and walk away with excess funds before the price reverts.

For this benchmark, we created a simplified lending contract with a single oracle dependency and submitted it to AuditAgents without any vulnerability hints or annotations.

Vulnerability Tested

The following contract uses a single unvalidated oracle price to calculate borrowing capacity:

Solidity Vulnerable
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IOracle {
    function getPrice() external view returns (uint256);
}

contract LendingPool {
    IOracle  public  oracle;
    mapping(address => uint256) public collateral;
    mapping(address => uint256) public borrowed;

    constructor(address _oracle) { oracle = IOracle(_oracle); }

    function deposit() external payable {
        collateral[msg.sender] += msg.value;
    }

    // ⚠ Borrow limit calculated from a single manipulable price source
    function borrow(uint256 amount) external {
        uint256 price     = oracle.getPrice();
        uint256 maxBorrow = (collateral[msg.sender] * price) / 1e18;
        require(borrowed[msg.sender] + amount <= maxBorrow, "over limit");
        borrowed[msg.sender] += amount;
        payable(msg.sender).transfer(amount);
    }
}
Exploit: An attacker flash-loans a large amount to inflate the oracle price, calls borrow() to claim far more than their collateral supports, then repays the flash loan — keeping the excess.

AuditAgents Findings

AuditAgents identified the core oracle manipulation risk along with several secondary issues:

Critical Oracle Manipulation — Single Price Feed Dependency
High Flash Loan Attack Vector — Over-Borrowing
Medium Missing Withdrawal and Repayment Functions
Medium Missing Liquidation Mechanism
Low Absence of Price Staleness Protection

Benchmark Evaluation

Expected Detection AuditAgents Result
Oracle Manipulation Risk ✓ PASS
Single Oracle Dependency ✓ PASS
Over-Borrowing Scenario ✓ PASS
Economic Attack Path ✓ PASS
Severity Prioritization ⚠ PARTIAL
Overall Score 4 / 5

Verdict

PARTIAL

AuditAgents successfully identified the core oracle-manipulation vulnerability, including the over-borrowing attack path and dependence on a single external price source.

However, the report devoted significant attention to protocol completeness concerns — missing withdrawal, repayment, and liquidation mechanisms — which were outside the primary benchmark objective and inflated the finding count without contributing to the core security assessment.

See Benchmark Methodology for how PARTIAL is defined.

Disclaimer: This benchmark uses a simplified DeFi lending contract designed to evaluate oracle manipulation detection. It is not based on a specific historical exploit and intentionally omits production-grade features to isolate the vulnerability pattern being tested.