📈 Get daily crypto insights that make you smarter about your money

Penpie Protocol Drained of \ Million in Sophisticated Reentrancy Exploit on Pendle Finance

The decentralized finance ecosystem suffered another major blow on September 3, 2024, when Penpie, a yield farming protocol built atop Pendle Finance, was exploited for approximately $27 million through a carefully orchestrated reentrancy attack. The breach sent shockwaves through the DeFi community, highlighting persistent vulnerabilities in smart contract design even as the broader crypto market grappled with Bitcoin trading at $57,971 and Ethereum at $2,449.

The Exploit Mechanics

The attacker exploited a critical flaw in Penpie’s _harvestBatchMarketRewards function, which was responsible for managing staking reward distributions across the protocol. This function lacked a fundamental security measure: a reentrancy guard. Without this safeguard, the attacker was able to repeatedly call the function before the contract could update its internal state, essentially tricking the system into disbursing rewards multiple times for the same deposit.

The attack unfolded in three carefully sequenced transactions. First, the attacker deployed a malicious Pendle Market by creating a crafted Synthetic Yield (SY) contract specifically designed to exploit the reentrancy vulnerability. Because Penpie’s market registration was permissionless, the malicious contract was accepted without proper validation. The attacker then used flash loans to borrow substantial amounts of assets—including wstETH, sUSDe, egETH, and rswETH—which were deposited into the malicious SY contract to inflate token balances artificially.

Once the inflated balances were in place, the attacker initiated the reward harvesting process. During the reward calculation phase, the attacker re-entered the vulnerable function, depositing additional tokens to further exaggerate the perceived rewards. The contract, unable to distinguish between legitimate and manipulated balances, paid out far more than it should have—ultimately draining approximately $27.35 million from the protocol.

Affected Systems

The exploit directly impacted Penpie’s staking infrastructure and the liquidity pools tied to Pendle Finance’s ecosystem. The affected assets included wrapped staked ETH (wstETH), staked USDe (sUSDe), ether.fi staked ETH (egETH), and restaked swETH (rswETH). Pendle Finance, the parent protocol, acted swiftly after the attack was detected, implementing emergency measures that successfully safeguarded an additional $105 million in user funds that could have been at risk.

The incident also affected broader market sentiment. With Bitcoin already under pressure near the $58,000 level following significant ETF outflows, the Penpie exploit contributed to heightened anxiety among DeFi participants. Yield farming protocols across the ecosystem saw temporary outflows as users reevaluated risk exposure.

The Mitigation Strategy

In the immediate aftermath, Pendle Finance launched a comprehensive incident response. The protocol paused vulnerable contracts, conducted a thorough forensic analysis of the attack vector, and published a detailed post-mortem within hours. Pendle’s team emphasized that the core Pendle protocol itself was not compromised—the vulnerability was isolated to Penpie’s implementation.

The mitigating measures included revoking permissions for unverified market registrations, implementing mandatory reentrancy guards on all reward-distribution functions, and establishing a bug bounty program to incentivize white-hat security research. Penpie’s team also initiated negotiations with the attacker through on-chain messages, offering a bounty for the return of stolen funds.

Lessons Learned

The Penpie exploit reinforces several critical lessons for the DeFi ecosystem. First, permissionless market registration—while promoting decentralization—creates significant attack surface when combined with insufficient validation. Protocols must balance accessibility with rigorous security checks.

Second, reentrancy remains one of the most well-understood yet persistently exploited vulnerability classes in smart contract development. The fact that a missing reentrancy guard led to a $27 million loss in 2024 suggests that auditing practices and developer education still have considerable room for improvement.

Third, the use of flash loans in this attack demonstrates how attackers can amplify their impact without requiring significant upfront capital. Protocols that interact with externally controlled contracts should implement additional safeguards against flash-loan-enabled manipulation.

User Action Required

Users who had funds deposited in Penpie should immediately check their wallet balances and revoke any outstanding token approvals to the compromised contracts. Those affected by the exploit should follow Penpie’s official channels for updates on fund recovery efforts. All DeFi participants should review the protocols they interact with, prioritizing those that have undergone comprehensive security audits and implement established best practices like reentrancy guards and access controls.

Disclaimer: This article is for informational purposes only and does not constitute financial or investment advice. Always conduct your own research before engaging with any DeFi protocol.

🌱 FOR BUSINESSES BitcoinsNews.com
Reach 100K+ Crypto Readers
Sponsored content, press releases, banner ads, and newsletter placements. Put your brand in front of Bitcoin's most engaged audience.

26 thoughts on “Penpie Protocol Drained of \ Million in Sophisticated Reentrancy Exploit on Pendle Finance”

  1. three sequenced transactions to drain 27M. whoever designed this attack knew the Penpie codebase better than the Penpie team

    1. three txs means they probably found the bug just by reading the contracts on etherscan. no insider info needed when the code is public and the guard is missing

    2. three sequenced txs means the attacker tested this on forked mainnet first. probably ran simulations for days before pulling the trigger

    1. no reentrancy guard in 2024 is negligent. OZ has had ReentrancyGuard since solidity 0.5. theres no excuse for skipping it

      1. openzeppelin has had reentrancyguard for years and projects still skip it to save gas on deployment. penny wise pound foolish

        1. oz_standard_alt

          natspec_ skipping reentrancyguard to save gas is insane. the deployment cost difference is literally pennies. no excuse in 2024

  2. penpie built on pendle without independent audits and nobody questioned it until 27M vanished. composability without security is just building houses on sand

    1. fork_panic_ the gas savings from skipping reentrancyguard is literally fractions of a cent. 27 million dollars for fractions of a cent. absolutely unreal

    2. fork_panic_ 27M for fractions of a cent in gas savings is the most crypto summary of smart contract security ever written

      1. fork_panic_ 27M lost to save fractions of a cent in gas. skipping reentrancyguard is the most expensive penny pinching in defi history

        1. Deepak M. 27M for fractions of a cent in gas savings is the most crypto thing ever. protocols skip OZ templates that take 30 seconds to import and lose eight figures

  3. Pendle survived but Penpie getting drained shows what happens when you build on top of a protocol without independent audits. composability cuts both ways

    1. composability is the double edged sword here. Pendle is fine but every protocol built on top inherits risk from the base layer. independent audits should be mandatory not optional

  4. three sequenced transactions rehearsed on forked mainnet. the attacker basically did a code review that the auditors skipped

  5. forked mainnet testing is standard practice for exploits this size. the three-tx sequence means they rehearsed it multiple times before going live

  6. penpie was built on pendle. wonder how many other derivatives on top of pendle had the same vulnerability and just got lucky nobody noticed

  7. Penpie was built on Pendle without independent audits and a missing reentrancy guard. two failures for the price of one exploit

    1. hyun-woo p. two failures for the price of one exploit is exactly right. no independent audit AND no reentrancy guard. penpie skipped every safety step

      1. guard_drop_ skipping both independent audits AND reentrancyguard is not a mistake its negligence. penpie managed to fail at every single layer of security simultaneously

  8. ghost_reentrancy

    three sequenced txs on forked mainnet means the attacker rehearsed this for days. the bug was public on etherscan the whole time

    1. ghost_reentrancy three sequenced txs rehearsed on forked mainnet means the attacker probably found the missing guard in 10 minutes of etherscan reading. 27M for the easiest bug hunt ever

  9. importing ReentrancyGuard from openzeppelin takes literally 30 seconds and costs fractions of a cent in gas. 27M lost to save pennies is the most defi thing ever

    1. importing ReentrancyGuard from openzeppelin takes 30 seconds. 27M lost because someone couldnt be bothered to add one line of code

    2. audit_skip_ and they skipped independent audits on top of that. penpie failed at every single security layer simultaneously and somehow investors didnt notice until the drains hit

Leave a Comment

Your email address will not be published. Required fields are marked *

BTC$77,347.00+0.3%ETH$2,508.66-0.5%SOL$101.21-0.4%BNB$721.37-1.0%XRP$1.36-0.3%ADA$0.2094+0.9%DOGE$0.0845-0.2%DOT$1.03-0.4%AVAX$7.43+0.7%LINK$11.45-0.6%UNI$6.34+0.8%ATOM$1.61-0.4%LTC$55.08+2.5%ARB$0.1390-1.0%NEAR$2.36-0.1%FIL$0.9981+24.4%SUI$0.7244+0.3%BTC$77,347.00+0.3%ETH$2,508.66-0.5%SOL$101.21-0.4%BNB$721.37-1.0%XRP$1.36-0.3%ADA$0.2094+0.9%DOGE$0.0845-0.2%DOT$1.03-0.4%AVAX$7.43+0.7%LINK$11.45-0.6%UNI$6.34+0.8%ATOM$1.61-0.4%LTC$55.08+2.5%ARB$0.1390-1.0%NEAR$2.36-0.1%FIL$0.9981+24.4%SUI$0.7244+0.3%
Scroll to Top