Hahaha, I’m dying. Just yesterday we were saying that DeFi security wasn’t coming up with any new tricks in practice, and then PeakDeFi went and pulled a big one:

The attacker borrowed a $50 million USDC flash loan from Morpho, briefly deposited the funds into PeakDeFi Fund, and registered a referral contract they controlled. The problem lay in the referral reward calculation logic: the protocol calculated referral commissions based on the funds’ balance during a certain period, but didn’t adequately require the funds to remain in the protocol throughout that period.

The attacker exploited this vulnerability to make a temporary deposit within a single block count toward the commission calculation, then withdrew the principal and repaid the flash loan. In the end, they received about $33,820 in unauthorized rewards.

This attack didn’t rely on any complicated private-key theft or break the underlying blockchain. The amount wasn’t huge, but the sheer audacity is off the charts 🤡

Many protocols focus their audits on lending, swaps, and access controls, while overlooking referral, rebate, and reward mechanisms. But as long as rewards can be redeemed for real assets, they’re a financial entry point that attackers can investigate.