Files
nexus/wiki/concepts/Oracle-Manipulation.md
2026-04-21 00:02:55 +08:00

37 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Oracle Manipulation"
type: concept
tags: [smart-contract, vulnerability, defi, security]
sources: [blockchain-security-auditor]
last_updated: 2026-04-20
---
## Definition
预言机操纵Oracle Manipulation是指攻击者通过操纵区块链上的价格数据源预言机来影响资产价格从而在 DeFi 协议中获取不正当利益。
## Attack Vector
1. 识别使用链上价格预言机的协议
2. 通过 Flash Loan 借用大量资产
3. 在单笔交易内操纵交易对储备量
4. 协议使用被操纵的价格计算抵押品价值
5. 攻击者借出超出正常限额的资产
6. 归还 Flash Loan利润落袋
## Vulnerable Patterns
- **Spot Price Oracle**:使用 Uniswap V2 即时价格
- **缺乏 TWAP 时间加权)
- **缺乏价格更新验证**
- **过长的价格 staleness 容忍**
## Mitigation
- **TWAPTime-Weighted Average Price**:使用时间加权平均价格
- **Chainlink Oracle**:使用去中心化预言机网络
- **价格更新验证**:检查 timestamp、roundId
- **价格波动限制**:设置最大允许偏差
## Connections
- [[DeFi Attack Vector]] ← is_type_of ← [[Oracle Manipulation]]
- [[Flash Loan Attack]] ← exploits ← [[Oracle Manipulation]]
- [[Chainlink]] ← provides ← [[Oracle Manipulation]] Mitigation