KLAYswap Hack

TOTAL LOST $1.9M
Medium Other

Summarize with AI

Affected Chain 2023 Incident surface
Recovered - No recovery reported
All-Time Rank #676 By amount stolen
Auditors 2 Prior security audits

Incident Overview

Exploiters have stolen $1.9m from South Korean cryptocurrency platform KLAYswap using a Border Gateway Protocol (BGP).

According to reports, the attackers used a Border Gateway Protocol (BGP) hijack to manipulate the network flow and configure it in a way that allowed users connected to KLAYswap to download malicious code from the server sent by the attackers instead of the normal software development kit file or KakaoTalk.

When a token-related function was executed through the KLAYswap UI on February 3, the researchers found that a malicious external attack occurred due to the infection of SDK files from external sites, which did not originate from KLAYswap's own front-end source code. Instead, the user's normal Kakao SDK JavaScript file request was connected to a third-party server built by the attacker, which was not a Kakao server, that led to an incident in which malicious code files were downloaded.

The malicious JavaScript allowed the attackers to intercept funds as a user-initiated transaction. Over a two-hour period, the hackers stole cryptocurrency totaling 2.2 billion won (about $1.9 million) from 407 abnormal transactions from 325 customer wallets.

The attackers changed all transaction requests of users to either directly send or approve the user's token to their contract and load it on the KLAYswap site. By changing the Kakao SDK script, the malicious code was created in the form of interfering with the operation of the existing KLAYswap code and allowing its own code to be executed. If a transaction occurred with corrupted logic, the user's assets were approved for use or the assets were transferred directly to the attacker's address.

KLAYswap developers say they blocked all functions of KLAYswap and performed an emergency check to prevent further damage after the incident was identified. They also restricted the operation of Klaytn minter, a blockchain platform in the bridge, to prevent the transfer of stolen assets to other exchange platforms through the Orbit Bridge.

South Korean cybersecurity firm S2W analyzed the attack and found that the malicious code was distributed only to users who accessed it through KLAYswap by checking the referrer value of the HTTP header when connecting. Other users received a server-side error.

Incident Report

Protocol / Project KLAYswap
Date of Incident
Attack Technique Other
Classification Exchange (DEX)

Protocol Information

Protocol Type Farm
Affected Token KSP
Official Website klayswap.com/
Protocol Twitter/X @KLAYswap
Team Anonymous
Source Code Unverified

Market Context at Time of Hack

Token Categories
Decentralized Exchange (DEX) Token DeFi Ethereum Ecosystem AMM Avalanche Ecosystem Fantom Ecosystem Arbitrum Ecosystem BNB Chain Ecosystem

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 KLAYswap's contract logic - root cause: exchange (dex)
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 Haechi, Theori — still lost $1.9M. Prior audits don't guarantee safety, especially after post-audit code changes.

If you're auditing a protocol with similar architecture to KLAYswap, these are the critical security checks that could have prevented this incident (February 2023).

  • 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 KLAYswap

The KLAYswap 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