Skip to content

Blog

The Binance attack: what it teaches about tests and API keys

In short

According to Binance’s preliminary findings, the attack began with a compromised engineer’s laptop, not a key leaked from a public repository. The lesson is the same, though: limit secrets and access, and check your safeguards with tests.

On 29 October 2026, by Binance's own estimate about 6.3 billion dollars were taken from the exchange, and according to the analytics firm TRM Labs most of it within about 20 minutes. It is the largest known crypto theft in history (BleepingComputer). It is worth a closer look not out of curiosity but because it shows where software is attacked today and why security testing is no longer an extra. This describes what was known on 1 November 2026: Binance has not yet published its full report, and some facts may change.

What is known about the Binance attack

According to Binance's preliminary findings, the way in was a compromised laptop belonging to a DevOps engineer. The attackers are said to have reached a service container from there and submitted unauthorised withdrawals. Binance says it has found no evidence that wallet private keys leaked. Co-CEO Richard Teng noted that the attack did not rely on a single click or on one person's permissions, and the company also found "additional points of breach" (BleepingComputer).

What is not known: how the laptop was compromised, which controls failed, and what the other points of breach are. Binance promises a detailed report once the investigation ends (CyberInsider). The FBI pointed to the North Korean group TraderTraitor, and Binance says the company, not its users, will bear the losses (Fox Business). These are statements by the parties, and they can only be judged after the report.

What this is not

This is not a story about an API key found in a public repository. Nothing in the available information says it was. The next two parts are separate threads, joined by a conclusion rather than a shared cause.

A separate, common slip: secrets in public repositories

  • According to a GitGuardian report, 28,649,024 new secrets were detected in public commits on GitHub in 2025 (34% more than a year earlier), and 64% of valid secrets detected in 2022 are still active four years later (GitGuardian). This is a report from a company that sells secret scanners.
  • In a 2019 study, a newly pushed string appeared in GitHub's search after a median of 20 seconds (Meli, McNiece, Reaves, NDSS 2019). That is the time to show up in the results, not a measurement of a real attack, but it shows that anyone watching sees a new key almost at once. My conclusion is that removing a key from the code is not enough: it has to be revoked.
  • GitHub blocks pushing a secret to a public repository through protection tied to your account, which is on by default. Protection at the repository level you have to switch on yourself (GitHub Docs).
  • Binance itself advises against keeping API keys in code or a repository, and setting an IP whitelist on all keys. A key without a whitelist cannot initiate a withdrawal, but Binance warns that with a stolen trading key someone can slowly drain value from an account by trading against it in a low-liquidity market (Binance).

Are attacks increasing?

The data let us say attacks are faster, bigger and better aimed. They do not give a simple "worse every year", so the nuances matter:

  • Poland: CERT Polska registered 260,783 incidents in 2025, 152% more than in 2024. But 97% of them were computer fraud, meaning mostly attacks on people (fake pages, phishing) rather than breaches of code. CERT notes that growing awareness and better monitoring also contribute to the rise (CERT Polska, in Polish).
  • Software flaws: according to Verizon's May 2026 report, exploiting vulnerabilities is for the first time in 19 editions the most common way into a breach (31% of cases), ahead of stolen passwords. Verizon also says a third party was involved in 48% of breaches, and that AI is shrinking the time to exploit known flaws "from months to mere hours" (Verizon). That is the report authors' assessment.
  • Cryptocurrency: Chainalysis counted more than 3.4 billion dollars stolen from January to early December 2025, of which North Korean hackers took at least 2.02 billion (51% more than a year earlier). At the same time, hack losses in DeFi stayed low in 2024–2025, which Chainalysis says suggests that improved security practices are making a meaningful difference (Chainalysis).

The last point is good news: security measures work when they are in place and checked.

Why testing matters here

These are my conclusions, not Binance's findings. We do not know what testing Binance had, and this text does not suggest it had none. For a small company or team, security testing checks that the protections you put in place actually work:

  • Secret scanning in the pipeline: a check that stops the push or the build when a key appears in code.
  • Permission tests: an automated test that a key or role can do only what it was created for (a read-only key will not withdraw funds, a user will not see someone else's data). Broken access control ranks first in the OWASP Top 10:2025.
  • Tests of what happens when something goes wrong: what happens when someone with valid access asks for something unusual: limits, approvals, alerts.
  • A key-rotation drill: can you replace a key within minutes, before someone else uses it?

Tests guarantee nothing. They reduce the chance that you learn about a hole from someone else's report.

A checklist

  1. Keys never in code or in the repository: environment variables or a secret manager, with the .env file on the ignore list.
  2. One key per purpose, with minimum permissions.
  3. Keys restricted to specific IP addresses where the service allows it.
  4. Push protection switched on and a secret scanner in the CI pipeline.
  5. Laptops and build servers treated as part of the attack surface. In GitGuardian's analysis of the Shai-Hulud 2 supply-chain attack, as many as 44% of compromised machines held more than 10 secrets, and 59% were CI/CD runners rather than personal computers (GitGuardian).
  6. An owner and a rotation routine: who is responsible for the keys and how often they are replaced.
  7. If a key has reached a repository: revoke and replace it first, and only then clean the history.

What a user can do

This is neither investment nor financial advice. For users, a sensible general rule is to limit the impact: do not expose in one place more than you can afford to lose, and switch on every account protection the service offers. Any system you trust with money or data is software, and software can fail.

I can check your software

I test software, including for security: permissions, handling of secrets, and the paths where something goes wrong. I do not promise an application will be impossible to break. I promise to tell you what I checked and how. I describe the scope on the Testing and consulting page.

If you want your application checked or to talk through a project's safeguards, write to me. We start with a short conversation, and I agree the scope and price individually.

Sources

Questions

Was the Binance attack caused by a leaked API key?

According to Binance’s preliminary findings, no. The company points to a compromised laptop of a DevOps engineer and says it has found no evidence that wallet private keys leaked. The investigation is ongoing and the full report has not been published.

What should I do if an API key reached a repository?

First revoke it and replace it with a new one, because deleting it from the code is not enough: the repository history and copies still contain it. Only then clean the history and switch on secret scanning.

Is a key in a private repository safe?

It is less exposed than in a public one, but it reaches every copy of the repository and the build systems. It is safer to keep keys in environment variables or a secret manager.

Want to talk it through one-on-one?

I usually reply within 2–3 business days.