Article

Bybit Hack Analysis: Strengthening Crypto Exchange Security

Bybit hacked! $1.4B crypto currency stolen! Exploited Safe{Wallet}, API key leak, AWS S3 breach? Exchange security is at stake! Check your security now!

The $1.4 billion hacking incident that occurred on February 21, 2025, at the cryptocurrency exchange Bybit sent shockwaves throughout the cryptocurrency industry. The theft of a massive amount of cryptocurrency assets, including 401,347 Ethereum, shows that even the top 10 global cryptocurrency exchanges, presumed to maintain high security, are not immune to hacking.  

This blog post aims to provide a detailed analysis of the Bybit hacking incident, examining the causes, impact, and potential security enhancement measures.

Incident Summary and Timeline

  • February 18th: The attacker deployed a malicious contract, marking the beginning of the hack.
  • February 21st: A massive amount of Ether was transferred from Bybit's multi-signature cold wallet to an unknown address. All transactions were recorded on the blockchain.  

Technical Analysis: Sophisticated Attack Techniques

This hacking incident was a highly sophisticated attack that exploited vulnerabilities between the Safe{Wallet} platform and Bybit's internal systems. The attacker injected malicious JavaScript code into the app.safe.global platform, which Bybit signers used for transaction management. This malicious code was designed to remain dormant until specific conditions were met, activating at a specific time to target high-value assets.  

Malicious Code Injection and Analysis

The attacker injected malicious JavaScript code into app.safe.global, accessed by Bybit signers. This code was designed to operate only under specific conditions, remaining undetected by ordinary users while targeting high-value assets.  

Two key JavaScript files were modified for the attack: _app-52c9031bfa03da47.js and 6514.b556851795a4cbaa.js. These files were subtly altered to manipulate critical functions related to transaction execution, signing, and gas limit calculations.

  • One file modified the executeTransaction and signTransaction calls. 
  • The other file modified the useGasLimit call.
  • The last modified time of one of the malicious JavaScript files was traced back to February 19th.  
  • The normal JavaScript file was likely replaced with malicious code on February 19th.

Code Analysis: Patches and Exploits

The malicious code targeted specific addresses and transaction types. It verified the signer and Safe addresses against a predefined target list. If a signer's address was identified as a target, the page would reload to prevent the signing of proposals.

The core of the hack focused on the Safe address. If the Safe address was a target and the current transaction operation was set to its default value (0), the malicious code would be executed.

Detailed Patch Analysis:

  1. executeTransaction Call Patch:
    • The transaction was rewritten to divert funds to the attacker's address.  
    • It checked if the Safe address was a target and if the transaction operation was set to 0.
    • If both conditions were met, the transaction data was modified to transfer funds to the attacker's address.  
    • The original transaction data was temporarily stored and restored after the malicious transaction was executed.
  2. signTransaction Call Patch:
    • Similar to the executeTransaction patch, this modified the transaction data to execute the attack if the Safe address was targeted and the transaction operation was set to its default value (0).
    • If the signer's address was on the target list, the page would reload, hindering legitimate transaction approvals.
    • Like the executeTransaction patch, the original transaction data was temporarily stored and restored.
  3. useGasLimit Call Patch:
    • This patch was designed to return a specific gas limit value (218207) for targeted Safe addresses.
    • By manipulating the gas limit, malicious transactions could be executed without triggering alarms.

Exploitation of the Safe{Wallet} Platform

The attackers exploited vulnerabilities in the Safe{Wallet} platform. By injecting malicious code into the transaction signing process, they were able to alter transaction details while displaying a normal address on the UI, deceiving signers into approving malicious transactions.  

The attackers bypassed the multi-signature mechanism by manipulating the UI and altering transaction data, tricking signers into authorizing the transfer of funds to the attacker's control. The UI displayed a normal transaction, but the actual data was modified to transfer funds to the attacker.  

Potential API Key Leak and S3 Bucket Compromise

Investigations suggest a potential compromise of Safe.Global's AWS infrastructure, with the possibility of the AWS S3 or CloudFront account/API Key being leaked or compromised. This could have allowed the attacker to modify JavaScript files hosted on Safe.Global's infrastructure.  

Evidence Supporting API Key Leak

  1. JavaScript File Modification: The malicious JavaScript files were modified on February 19th, before the actual hack on February 21st, suggesting unauthorized access to Safe.Global's servers.
  2. Modification Time: The modification timestamps align with the attack timeline, indicating a deliberate and organized attack.
  3. Wayback Archive Analysis: Analysis shows the normal JavaScript file was replaced with malicious code on February 19th.  
  4. Chrome Cache Data: Chrome cache files show that resources served from Safe{Wallet}'s AWS S3 bucket on February 21st were last modified on February 19th.
  5. Response Headers: Response headers for the modified JavaScript resources indicate modification in the AWS S3 bucket on February 21st at 14:15:13 and 14:15:32 UTC, approximately two minutes after the malicious transaction was executed.  

Risks of API Key Leakage

Leaked API keys or compromised AWS S3 accounts can have severe consequences, allowing attackers to:

  • Modify Website Content: Inject malicious code into the Safe{Wallet} platform.  
  • Redirect User Transactions: Alter transaction details to send funds to attacker-controlled addresses.  
  • Access Sensitive Data: Access sensitive data stored in AWS S3 buckets.

The Attacker: North Korean Lazarus Group

The FBI has attributed the Bybit hack to the North Korean hacking group TraderTraitor, also known as the Lazarus Group. The Lazarus Group has a history of sophisticated cyberattacks targeting cryptocurrency exchanges and financial institutions for financial gain.  

  • North Korea was responsible for approximately $800 million in stolen cryptocurrency in 2024 alone.
  • The scale of North Korean attacks is about five times larger than those by other actors, demonstrating their focus on high-impact operations.  
  • These attacks are believed to circumvent international sanctions and fund the North Korean regime.
  • The Lazarus Group has been linked to attacks on Sony Pictures, the Central Bank of Bangladesh, and the WannaCry ransomware attack.

Bybit's Response and Recovery Efforts

Bybit has taken several steps to address the breach and restore user trust:

  • Prompt Disclosure and Transparent Communication: Bybit acknowledged the hacking incident and promptly informed users with transparency.
  • Compensation for Affected Users: Bybit fully compensated affected users, preventing the loss of customer funds.
  • Bounty Program: Bybit has implemented a bounty program, offering rewards for information leading to asset recovery.  
  • Security Enhancement: Bybit is strengthening its security systems to prevent future attacks.  
  • ETH Purchase: Bybit purchased over 1 trillion won worth of ETH to cover the losses.
  • Security Review: Bybit's legal and security teams are investigating the incident.

Safe{Wallet}'s Actions

Safe{Wallet} also acknowledged the system breach and took the following actions:

  • JavaScript Resource Modification: JavaScript resources in the AWS S3 bucket appear to have been modified on February 21st, approximately two minutes after the malicious transaction.
  • Malicious Code Removal: Safe{Wallet} removed the malicious code that was found in the Chrome cache files and served via their AWS S3 bucket.

Implications for the Cryptocurrency Industry

The Bybit hacking incident highlights crucial areas for improvement in the cryptocurrency industry:

  • Strong Security Protocols: Exchanges and wallet providers need to invest in robust security measures.  
  • Smart Contract Security: Thorough audits and testing of smart contracts are crucial.
  • Supply Chain Security: Increased vigilance regarding supply chain security is necessary to prevent malicious code injection.
  • User Education: Users should be educated about phishing attacks and social engineering techniques.
  • Collaboration and Information Sharing: Industry-wide collaboration and information sharing are essential for threat identification and prevention.
  • Multi-Factor Authentication: Implement multi-factor authentication to secure platforms.

Conclusion: Towards a Secure Ecosystem

The Bybit hacking incident serves as a stark reminder of the risks faced by the cryptocurrency industry. This incident should be a catalyst for all stakeholders, including exchanges and related businesses, to reinforce security measures. Collective wisdom and collaboration are crucial for building a more secure and trustworthy cryptocurrency ecosystem.

The Risk of API Key Leakage

While investigations are ongoing, the Bybit hacking incident may have been caused by the leakage of an API key that granted access to Safe{Wallet}’s S3 or CloudFront. With the increasing use of cloud systems and SaaS services, hacking incidents caused by the leakage of non-human identities like API keys are on the rise. Therefore, it is critical to monitor API key leakage centrally and implement measures to mitigate threats related to non-human identities.  

Cremit provides internal monitoring for non-human identity leaks and accurate API key detection. If you need assistance, start here or contact us

Unlock AI-Driven Insights to Master Non-Human Identity Risk.

Go beyond basic data; unlock the actionable AI-driven insights needed to proactively master and mitigate non-human identity risk

A dark-themed cybersecurity dashboard from Cremit showing non-human identity (NHI) data analysis. Key metrics include “Detected Secrets” (27 new) and “Found Sensitive Data” (58 new) from Jan 16–24, 2024. Two donut charts break down source types of detected secrets and sensitive data by platform: GitHub (15k), GetResponse (1,352), and Atera (352), totaling 16.9k. The dashboard includes a line graph showing trends in sensitive data over time, and bar charts showing the top 10 reasons for sensitive data detection—most prominently email addresses and various key types (API, RSA, PGP, SSH).

Blog

Explore more news & updates

Stay informed on the latest cyber threats and security trends shaping our industry.

OWASP NHI5:2025 Insecure Authorization Deep Dive
Explore OWASP NHI5: Insecure Authorization. See how Non-Human Identities gain excess privileges, causing breaches. Learn countermeasures like Zero Trust & least privilege.
OWASP NHI4:2025 Insecure Authentication Deep Dive Introduction: The Era of Non-Human Identities Beyond Humans
Deep dive into OWASP NHI4: Insecure Authentication. Understand the risks of NHIs, key vulnerabilities, and how Zero Trust helps protect your systems.
Secret Sprawl and Non-Human Identities: The Growing Security Challenge
Discover NHI sprawl vulnerabilities and how Cremit's detection tools safeguard your organization from credential exposure. Learn to manage NHI risks.
Navigating the Expanding AI Universe: Deepening Our Understanding of MCP, A2A, and the Imperative of Non-Human Identity Security
Delve into AI protocols MCP & A2A, their potential security risks for AI agents, and the increasing importance of securing Non-Human Identities (NHIs).
Stop Secrets Sprawl: Shifting Left for Effective Secret Detection
Leaked secrets threaten fast-paced development. Learn how Shift Left security integrates early secret detection in DevOps to prevent breaches & cut costs.
Hidden Dangers: Why Detecting Secrets in S3 Buckets is Critical
Learn critical strategies for detecting secrets in S3 buckets. Understand the risks of exposed NHI credentials & why proactive scanning is essential.
NHI2 2025: Secret Leakage – Understanding and Mitigating the Risks
NHI2 Secret Leakage: Exposed API keys and credentials threaten your business. Learn how to prevent unauthorized access, data breaches, and system disruption.
Stop the Sprawl: Introducing Cremit’s AWS S3 Non-Human Identity Detection
Cremit Launches AWS S3 Non-Human Identity (NHI) Detection to Boost Cloud Security
Human vs. Non-Human Identity: The Key Differentiators
Explore the critical differences between human and non-human digital identities, revealing hidden security risks and the importance of secret detection.
Wake-Up Call: tj-actions/changed-files Compromised NHIs
Learn from the tj-actions/changed-files compromise: CI/CD non-human identity (NHI) security risks, secret theft, and proactive hardening.
NHI 3 2025: 3rd Party Supply Chain Dangers
Discover the security risks of vulnerable third-party non-human identities (NHI3:2025) and learn effective strategies to protect your organization from this OWASP Top 10 threat.
Build vs. Buy: Making the Right Choice for Secrets Detection
Build vs. buy secrets detection: our expert guide compares costs, features, and ROI for in-house and commercial security platforms.
Bybit Hack Analysis: Strengthening Crypto Exchange Security
Bybit hacked! $1.4B crypto currency stolen! Exploited Safe{Wallet}, API key leak, AWS S3 breach? Exchange security is at stake! Check your security now!
Rising Data Breach Costs: Secret Detection's Role
Learn about the growing financial impact of data breaches and how secret detection and cybersecurity strategies can safeguard your data and business.
NHI1 2025: Improper Offboarding- A Comprehensive Overview
Discover how improper offboarding exposes credentials, leading to vulnerabilities like NHI sprawl, attack surface expansion, and compliance risks.
Behind the Code: Best Practices for Identifying Hidden Secrets
Improve code security with expert secret detection methods. Learn strategies to safeguard API keys, tokens, and certificates within your expanding cloud infrastructure.
Understanding the OWASP Non-Human Identities (NHI) Top 10 Threats
Understanding NHI OWASP Top 10: risks to non-human identities like APIs and keys. Covers weak authentication, insecure storage, and more.
Securing Your Software Pipeline: The Role of Secret Detection
Prevent secret leaks in your software pipeline. Discover how secret detection improves security, safeguards CI/CD, and prevents credential exposure.
What Is Secret Detection? A Beginner’s Guide
Cloud security demands secret detection. Learn its meaning and why it's essential for protecting sensitive data in today's cloud-driven organizations.
Full Version of Nebula – UI, New Features, and More!
Explore the features in Nebula’s full version, including a refined UI/UX, fine-grained access control, audit logs, and scalable plans for teams of all sizes.
Unveiling Nebula: An Open-Source MA-ABE Secrets Vault
Nebula is an open-source MA-ABE secrets vault offering granular access control, enhanced security, and secret management for developers and teams.
Vigilant Ally: Helping Developers Secure GitHub Secrets
The Vigilant Ally Initiative supports developers secure API keys, tokens, and credentials on GitHub, promoting secure coding and secrets management.
Cremit Joins AWS SaaS Spotlight Program
Cremit joins the AWS SaaS Spotlight Program to gain insights through mentorship and collaboration, driving innovation in AI-powered security solutions.
DevSecOps: Why start with Cremit
DevSecOps is security into development, improving safety with early vulnerability detection, remediation, and compliance, starting with credential checks.
Credential Leakage Risks Hiding in Frontend Code
Learn why credentials like API keys and tokens are critical for access control and the risks of exposure to secure your applications and systems effectively.
Introducing Probe! Cremit's New Detection Engine
Probe detects exposed credentials and sensitive data across cloud tools, automating validation and alerts, with AI-powered scanning for enhanced security.
Customer Interview: Insights from ENlighten
We interviewed Jinseok Yeo from ENlighten, Korea’s top energy IT platform, on how they secure credentials and secrets. Here’s their approach to security.
6 Essential Practices for Protecting Non-Human Identities
Safeguard your infrastructure: Learn 6 best practices to protect API keys, passwords & encryption keys with secure storage, access controls & rotation.
Microsoft Secrets Leak: A Cybersecurity Wake-Up Call
See how an employee error at Microsoft led to the exposure of sensitive secrets and 38 terabytes of data.