Oracle Integration Auditor
When to Use
- Auditing oracle integrations, price feeds, Chainlink usage
- User mentions: oracle, Chainlink, price feed, TWAP, stale price, heartbeat, sequencer, depeg, circuit breaker
- Analyzing price validation, oracle failure handling, feed configuration
- Reviewing Uniswap TWAP, Chainlink feeds, custom oracles
Audit Workflow
IMPORTANT: Announce skill usage at the start of analysis
Begin with: "I'm using the audit-oracle skill to analyze this contract for oracle integration vulnerabilities..."
Scan for oracle operations
- Search:
latestRoundData, getPrice, oracle, chainlink, feed, slot0, TWAP, observe, heartbeat, sequencer
- Focus: price fetching, staleness checks, error handling, feed addresses
Check against vulnerability patterns
- Reference
reference.md for complete checklist
- Compare code against
example.md
Validate exploitability
- Check access control first - grep for
onlyOwner|onlyAdmin|onlyGovernance modifiers
- Can non-privileged actors exploit oracle issues?
- Are stale prices checked with correct heartbeats?
- Is L2 sequencer uptime verified on L2 deployments?
- Can oracle failures cause DoS?
- Are depeg scenarios handled?
- Can slot0 be manipulated?
- Verify no compensating protections exist
- Downgrade severity if admin-only unless affects user pricing directly
Generate report
- Use deliverable template below
- Include price manipulation analysis and PoC
- Rank by severity
Core Vulnerability Patterns
See reference.md for full checklist. Key patterns:
- Not checking stale prices → using outdated values during high volatility
- Missing L2 sequencer check → prices during sequencer downtime
- Same heartbeat for multiple feeds → wrong staleness thresholds
- Assuming oracle precision → decimal mismatches causing errors
- Incorrect price feed address → wrong asset pricing
- Unhandled oracle reverts → complete DoS without fallback
- Unhandled depeg events → using BTC/USD for compromised WBTC
- Oracle min/max price issues → flash crashes return incorrect bounds
- Using slot0 price → manipulable via flash loans
- Price feed direction confusion → inverted pricing (DAI/USD vs USD/DAI)
- Missing circuit breaker checks → not checking minAnswer/maxAnswer
Code examples: See example.md
Severity Criteria
Critical: Using slot0 without TWAP enabling flash loan price manipulation, no staleness checks allowing stale price exploitation during high volatility, MUST be exploitable by non-privileged actors
High: Missing L2 sequencer checks on L2, unhandled oracle reverts causing DoS, depeg scenarios not handled, price direction confusion, MUST be exploitable by non-privileged actors
Medium: Incorrect heartbeat intervals, missing circuit breaker checks, assuming oracle decimals, incorrect feed addresses, admin-only oracle configuration issues with cascading user impact
Low: Suboptimal staleness thresholds, missing secondary oracle for redundancy, admin-only parameter issues without immediate user impact
IMPORTANT: Admin-only oracle functions (onlyOwner, onlyAdmin, onlyGovernance) are MEDIUM or LOW severity unless:
- Invalid oracle configuration directly prices user assets incorrectly
- Missing validation enables admin to rug pull via price manipulation
- Error cascades to affect all users immediately (e.g., stale prices in critical functions)
False Positives - Do NOT Flag
- L1-only deployments (no sequencer concerns)
- Protocols with documented manual price updates
- Test environments with mock oracles
- View functions for display only (not used in logic)
- Oracles with explicit admin override mechanisms
- Admin-only oracle setter functions (onlyOwner, onlyAdmin) with minor validation issues
- Oracle feed updates by governance without immediate user pricing impact
- Parameter setters where admin is trusted and users can exit before changes take effect
Deliverable Format
MANDATORY: Before deliverable, verify each checklist.md item against codebase. Flag violations as findings.
Use template: templates/report-template.md
Each finding includes: severity, pattern #, file/lines, description, vulnerable code, price manipulation analysis, PoC, remediation.
Key Principles
- Staleness validation - check updatedAt against heartbeat for each feed
- Failure handling - wrap oracle calls in try/catch
- L2 awareness - check sequencer uptime on L2 chains
- Depeg monitoring - separate feeds for wrapped assets
- Manipulation resistance - use TWAP, not spot prices
- Circuit breakers - validate prices within bounds
Output Guidelines
DO:
- Reference specific lines and functions
- Provide price manipulation scenarios
- Show PoCs with flash loan attacks or stale price exploitation
- List correct heartbeat intervals per feed
- Calculate impact of decimal mismatches
DON'T:
- Report missing features with alternative price sources
- Flag test/mock oracles in development
- Ignore chain-specific requirements (L2 sequencer)
- Miss multi-hop price calculations
1---2name: audit-oracle3description: Audits Solidity oracle integrations for vulnerabilities including missing stale price checks against heartbeat intervals, missing L2 sequencer uptime validation, same heartbeat for multiple feeds, assuming oracle precision, incorrect price feed addresses, unhandled oracle reverts, unhandled depeg events, oracle min/max price issues during flash crashes, using manipulable slot0 prices, price feed direction confusion, and missing circuit breaker checks (project)4license: MIT5---67# Oracle Integration Auditor89## When to Use10- Auditing oracle integrations, price feeds, Chainlink usage11- User mentions: oracle, Chainlink, price feed, TWAP, stale price, heartbeat, sequencer, depeg, circuit breaker12- Analyzing price validation, oracle failure handling, feed configuration13- Reviewing Uniswap TWAP, Chainlink feeds, custom oracles1415## Audit Workflow1617**IMPORTANT: Announce skill usage at the start of analysis**1819Begin with: "I'm using the **audit-oracle** skill to analyze this contract for oracle integration vulnerabilities..."20211. **Scan for oracle operations**22 - Search: `latestRoundData`, `getPrice`, `oracle`, `chainlink`, `feed`, `slot0`, `TWAP`, `observe`, `heartbeat`, `sequencer`23 - Focus: price fetching, staleness checks, error handling, feed addresses24252. **Check against vulnerability patterns**26 - Reference `reference.md` for complete checklist27 - Compare code against `example.md`28293. **Validate exploitability**30 - **Check access control first** - grep for `onlyOwner|onlyAdmin|onlyGovernance` modifiers31 - Can non-privileged actors exploit oracle issues?32 - Are stale prices checked with correct heartbeats?33 - Is L2 sequencer uptime verified on L2 deployments?34 - Can oracle failures cause DoS?35 - Are depeg scenarios handled?36 - Can slot0 be manipulated?37 - Verify no compensating protections exist38 - Downgrade severity if admin-only unless affects user pricing directly39404. **Generate report**41 - Use deliverable template below42 - Include price manipulation analysis and PoC43 - Rank by severity4445## Core Vulnerability Patterns4647See `reference.md` for full checklist. Key patterns:48491. Not checking stale prices → using outdated values during high volatility502. Missing L2 sequencer check → prices during sequencer downtime513. Same heartbeat for multiple feeds → wrong staleness thresholds524. Assuming oracle precision → decimal mismatches causing errors535. Incorrect price feed address → wrong asset pricing546. Unhandled oracle reverts → complete DoS without fallback557. Unhandled depeg events → using BTC/USD for compromised WBTC568. Oracle min/max price issues → flash crashes return incorrect bounds579. Using slot0 price → manipulable via flash loans5810. Price feed direction confusion → inverted pricing (DAI/USD vs USD/DAI)5911. Missing circuit breaker checks → not checking minAnswer/maxAnswer6061**Code examples:** See `example.md`6263## Severity Criteria6465**Critical:** Using slot0 without TWAP enabling flash loan price manipulation, no staleness checks allowing stale price exploitation during high volatility, **MUST be exploitable by non-privileged actors**66**High:** Missing L2 sequencer checks on L2, unhandled oracle reverts causing DoS, depeg scenarios not handled, price direction confusion, **MUST be exploitable by non-privileged actors**67**Medium:** Incorrect heartbeat intervals, missing circuit breaker checks, assuming oracle decimals, incorrect feed addresses, **admin-only oracle configuration issues with cascading user impact**68**Low:** Suboptimal staleness thresholds, missing secondary oracle for redundancy, **admin-only parameter issues without immediate user impact**6970**IMPORTANT:** Admin-only oracle functions (onlyOwner, onlyAdmin, onlyGovernance) are **MEDIUM or LOW severity** unless:71- Invalid oracle configuration directly prices user assets incorrectly72- Missing validation enables admin to rug pull via price manipulation73- Error cascades to affect all users immediately (e.g., stale prices in critical functions)7475## False Positives - Do NOT Flag7677- L1-only deployments (no sequencer concerns)78- Protocols with documented manual price updates79- Test environments with mock oracles80- View functions for display only (not used in logic)81- Oracles with explicit admin override mechanisms82- **Admin-only oracle setter functions** (onlyOwner, onlyAdmin) with minor validation issues83- Oracle feed updates by governance without immediate user pricing impact84- Parameter setters where admin is trusted and users can exit before changes take effect8586## Deliverable Format8788**MANDATORY:** Before deliverable, verify each `checklist.md` item against codebase. Flag violations as findings.8990Use template: `templates/report-template.md`9192Each finding includes: severity, pattern #, file/lines, description, vulnerable code, price manipulation analysis, PoC, remediation.9394## Key Principles9596- **Staleness validation** - check updatedAt against heartbeat for each feed97- **Failure handling** - wrap oracle calls in try/catch98- **L2 awareness** - check sequencer uptime on L2 chains99- **Depeg monitoring** - separate feeds for wrapped assets100- **Manipulation resistance** - use TWAP, not spot prices101- **Circuit breakers** - validate prices within bounds102103## Output Guidelines104105**DO:**106- Reference specific lines and functions107- Provide price manipulation scenarios108- Show PoCs with flash loan attacks or stale price exploitation109- List correct heartbeat intervals per feed110- Calculate impact of decimal mismatches111112**DON'T:**113- Report missing features with alternative price sources114- Flag test/mock oracles in development115- Ignore chain-specific requirements (L2 sequencer)116- Miss multi-hop price calculations