Whale Loans Hack

TOTAL LOST $12K
Low Other

Summarize with AI

Affected Chain 2022 Incident surface
Recovered - No recovery reported
All-Time Rank #1927 By amount stolen
Auditors 1 Prior security audit

Incident Overview

Whale Loans was exploited due to K-check of the WhaleSwap Finance Pair contract. When a user swaps, there is an issue with the magnitude of the parameters passed in.

The attacker flashloaned BSC-USD and then returns flashloan with a K-check parameter in function swap() contract WhaleswapPair.sol of magnitude 10000^4. However, the K-check takes a parameter of magnitude 10000^2, which causes the K-check to fail.

Exploiter address: https://bscscan.com/address/0xd793ff8d…bf7a50

Attack transaction: https://bscscan.com/tx/0x9f5b02cb…0ebab3

Attacker contract: https://bscscan.com/address/0xf9553675…29385f

Victim address: https://bscscan.com/address/0x8bfee2ca…e76794

Incident Report

Protocol / Project Whale Loans
Date of Incident
Attack Technique Other
Classification Borrowing and Lending
Primary Source View Post-Mortem

Protocol Information

Protocol Type Reserve Currency
Affected Token HUMP
Official Website whale.loans/dashboard
Protocol Twitter/X @WhaleLoans
Team Public / Doxxed
Source Code Unverified

What the Attacker Needed to Succeed

Understanding the prerequisites for this type of attack helps auditors identify protocols that are most at risk and helps developers build better defenses.

Technical Knowledge Deep understanding of other and Solidity and EVM internals
Capital Required Seed capital to cover gas and initial position setup
On-Chain Access Ability to interact with smart contracts and deploy a custom exploit contract
Protocol Analysis Identification of the exploitable vulnerability in Whale Loans's contract logic - root cause: borrowing and lending
Execution Speed Precise transaction ordering and timing to exploit the vulnerability within a single atomic block
Obfuscation Plan A strategy to launder and move stolen funds - typically through mixers, cross-chain bridges, or decentralized DEX swaps to resist tracing

What Auditors Should Check

Could this have been caught in audit? Likely — with a thorough Other audit checklist and test coverage
Audited by BlockSec — still lost $12K. Prior audits don't guarantee safety, especially after post-audit code changes.

If you're auditing a protocol with similar architecture to Whale Loans, these are the critical security checks that could have prevented this incident (June 2022).

  • Verify all logic paths related to Other are guarded by proper access controls and input validation
  • Review privileged functions (owner, admin, governance) for potential abuse vectors - centralization risks should be documented and bounded with timelocks or multi-sigs

Master these auditing techniques with hands-on labs and real exploit scenarios in the Smart Contract Hacking course.

Free Trial

Security Audit History

Sources & References

Learn to Prevent the Next Whale Loans

The Whale Loans hack is one of many attacks that skilled auditors are trained to detect before deployment. Master real exploit patterns and defense techniques with hands-on Web3 security training.

Recreate exploit patterns safely Free Trial