Flash Loan Attack Vector Analysis: PancakeSwap AMM
Flash Loan Attack Vector Analysis: PancakeSwap AMM Target Protocol : PancakeSwap AMM (TVL: $1859.8M) Flash Loan Attack Vector Analysis – PancakeSwap AMM Protocol: PancakeSwap Automated Market Maker (AMM) Chain(s): Ethereum (Mainnet) & Layer‑2 roll‑ups (Arbitrum, Optimism, zkSync) Current TVL: ≈ $1.86 B (as of 02 Sep 2026) Prepared by: Senior DeFi Security Researcher – Smart‑Contract Auditing Team Date: 02 September 2026 1. Executive Summary PancakeSwap is the flagship AMM on the Binance Smart Chain ecosystem and has expanded to Ethereum and multiple L2 solutions. Its core contracts (Factory, Pair, Router, and supporting libraries) are battle‑tested, but the rapid cross‑chain deployment and the ever‑growing reliance on flash‑loan‑driven arbitrage expose a set of nuanced attack surfaces. Our analysis focuses on flash‑loan‑derived attack vectors that could be leveraged against PancakeSwap’s AMM contracts, liquidity pools, and auxiliary components (e.g., staking farms, lottery, and NFT marketplaces). The goal is to identify systemic weaknesses that could be exploited by an adversary with a large, cheap flash‑loan source (e.g., Aave, dYdX, Uniswap V3, or native L2 flash‑loan primitives). Key findings: # Attack Vector Likelihood Potential Impact Overall Risk 1 Manipulation of price oracle via flash‑loan‑driven swap‑sandwich (direct AMM price) Medium‑High (requires > $10 M flash loan) Temporary price distortion → profitable arbitrage, slippage‑driven liquidation of leveraged positions on downstream protocols 7 2 Flash‑loan‑driven liquidity‑drain & re‑add (Liquidity‑Pump‑Dump) Low‑Medium (requires coordinated pool‑specific attack) Short‑term loss of pool depth, front‑running of large trades, possible token‑price manipulation 5 3 Re‑entrancy via malicious token callbacks in swap / addLiquidity (ERC‑777 / ERC‑4626) Low (protected by nonReentrant in core contracts) Drain of pool reserves if a new token bypasses the safeTransfer guard 4 4 Flash‑loan‑driven “price‑oracle” manipu