OWASP·SC02·critical

Price oracle manipulation

A price the contract trusts can be moved within a single transaction.

What it is

Reading a spot price from an AMM pool means reading a number an attacker can move with capital they only need for one transaction. Flash loans remove the capital requirement entirely, so pool depth is not the protection it looks like.

Why it matters

Borrow against inflated collateral, liquidate solvent positions, or drain a pool through a mispriced swap. This category and access control account for most large DeFi losses.

How to fix it

  • Use a time-weighted average price rather than a spot read, or a dedicated oracle with multiple independent sources.
  • Sanity-check oracle output: reject stale rounds, zero prices, and moves larger than a plausible bound.
  • Assume any price readable in-transaction can be moved in-transaction.

How it is detected

Every audit on EVM Smart Audit checks for SC02 and reports it as passed or flagged in the standards coverage grid — so the report tells you it was checked even when nothing was found. See the detector suite for what else runs alongside it, or the full database for the other 21 checks.

Related weaknesses

Check your contract for price oracle manipulation

The engine runs this check and 21 others on every audit, and shows what passed as well as what failed.

Start your auditSee pricing