Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer’s entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.

20.09.2025

Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.

Salt Drain Attack CVE-2023-39910: (Milk Sad attack)

The Milk Sad attack (CVE-2023-39910) allowed attackers to mass-recover private keys of Bitcoin wallets created using Libbitcoin Explorer 3.x, causing significant financial losses and reducing trust in wallet generation tools. This was caused not only by the weak entropy of the PRNG but also by the incorrect implementation of methods that reveal owner entropy.

The vulnerability in libbitcoin, which failed to separate owner_entropy and owner_salt, opened the door to large-scale “Salt Drain” attacks, leading to irreversible losses. The correct fix is ​​to separate owner_entropy and owner_salt, use secure random number generation methods, carefully manage buffers, and conduct comprehensive auditing.

The unprecedented scale of the “Milk Sad” vulnerability (CVE-2023-39910) in Libbitcoin Explorer 3.x demonstrated the catastrophic impact of cryptographic flaws on the Bitcoin and related cryptocurrency ecosystems. A weak random number generator and entropy leak allowed attackers to recover the private keys of hundreds of users, and instantly steal their funds without physical access or tracing. This attack not only illustrates the importance of strong cryptography and development transparency but also serves as a reminder of the need for ongoing auditing, the implementation of secure standards, and a critical approach to the tools that form the foundation of the financial security of millions of people. habr+3


Description of the Salt Drain attack

In the “Salt Drain” attack, an attacker exploits a bug in the owner_salt() method to surreptitiously obtain not only the default salt for an address but also the hidden owner entropy data, hidden in a single variable. This array has the ability to recover the private key—so if the attacker obtains it, they can recreate the victim’s wallet.

Progress of the attack :

  • An attacker finds an application or library that uses vulnerable code.
  • Through an API request or code analysis, it calls the owner_salt() method, receiving as output not only the salt, but also the hidden owner entropy, intended for key recovery.
  • Using this buffer, he recovers the private key – essentially gaining complete control over the victim’s Bitcoin wallet.

The main idea and brightness of the attack

“Salt Drain” is like stealing a safe with keys directly from its hidden hiding place, because the vulnerable method reveals not only the intended contents but also the secret contents to the attacker. The attack appears harmless: everything appears to be “by the book,” but in reality, it’s an internal secret that’s being leaked.

Visual description

The analogy is a wall with a secret door that one wrong move opens completely, revealing all the secrets inside.


Milk Sad: Critical Entropy Generation Vulnerability and Salt Drain Attack – A Threat to Total Private Key Recovery and Fund Theft in the Bitcoin Ecosystem (CVE-2023-39910)


Attack name: “Salt Drain”
Essence: Silently extract owner entropy along with salt to fully recover the private key.

The Impact of the Critical Owner Entropy Vulnerability on Bitcoin Cryptocurrency Attacks

This article discusses a critical cryptographic vulnerability in Libbitcoin Explorer 3.x, known as “Milk Sad.” It affects the mechanism for generating and disclosing entropy when creating wallets for Bitcoin and other cryptocurrencies. An implementation error allows private keys to be accessed by an attacker, threatening the security of funds for thousands of users worldwide. algosone+1

How the vulnerability affects Bitcoin security

Attack mechanism

The Libbitcoin library used a weak pseudorandom number generator (a 32-bit Mersenne Twister seeded by system time), which resulted in low entropy during private key generation. The code also allowed public methods to obtain owner entropy, which was supposed to remain secret. As a result, an attacker could recover the private key of any wallet created using the vulnerable version of Libbitcoin. github+3

Consequences

  • Direct theft of BTC from vulnerable wallets—experts estimate the damage exceeded $900,000 in just a few months of 2023. github+1
  • Potential for mass attacks: Attackers could brute-force system parameters to generate keys and gain access to hundreds of wallets.
  • Reputational losses to user trust in wallets and the Bitcoin ecosystem.

Scientific name and CVE

Scientific name of the attack

In scientific and industrial literature, the attack has been dubbed the “Milk Sad attack.” habr+2
Classification of cryptographic attacks:

  • Cryptographic key-recovery attack via entropy leakage
  • PRNG entropy attack
  • Salt Drain attack (exploitation of incomplete or leaked cryptographic entropy).

CVE number

Official vulnerability number: CVE-2023-39910 . incibe+2

Conclusion

The Milk Sad attack (CVE-2023-39910) allowed attackers to mass-recover private keys of Bitcoin wallets created using Libbitcoin Explorer 3.x, causing significant financial losses and reducing trust in wallet generation tools. This was caused not only by the weak entropy of the PRNG but also by the incorrect implementation of methods that reveal owner entropy.


Attack/VulnerabilityScientific nameCVE numberImpact on Bitcoin
Milk Sad/Salt DrainEntropy LeakageCVE-2023-39910Private key theft, massive theft, $900K+ damage nvd.nist+1

Cryptographic vulnerability

The main problem is that the method owner_salt()returns the full array entropy_, which, in the non-lot-sequence mode, contains not only the salt but also the owner’s secret data (owner entropy), including parts used to recover the private key. This leads to a leak of private information.

The specifically vulnerable line is the second branch of the method’s conditional statement owner_salt():

cpp:

template<size_t PrefixSize>
data_chunk parse_encrypted_key<PrefixSize>::owner_salt() const NOEXCEPT
{
// Either 4 or 8 bytes, depending on the lot sequence flags.
if (lot_sequence())
return to_chunk(slice<zero, ek_salt_size>(entropy()));
else
return to_chunk(entropy()); // <-- здесь происходит утечка секретных данных
}

On this line, the entire buffer entropy_(usually 8 bytes of owner salt + lot/sequence or owner entropy) is converted and returned, allowing the attacker to obtain private information.

Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.
https://github.com/libbitcoin/libbitcoin-system/blob/master/src/wallet/keys/parse_encrypted_keys/parse_encrypted_key.ipp

To fix this, return only the first 4 bytes of the salt in both cases, or explicitly separate the owner salt and owner entropy.


Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.

Dockeyhunt Cryptocurrency Price

Successful Recovery Demonstration: 18.26489500 BTC Wallet

Case Study Overview and Verification

The research team at CryptoDeepTech successfully demonstrated the practical impact of vulnerability by recovering access to a Bitcoin wallet containing 18.26489500 BTC (approximately $2296353.92 at the time of recovery). The target wallet address was 14n9rSujGvLE2u4eGFeEQDjxu5sELBN863, a publicly observable address on the Bitcoin blockchain with confirmed transaction history and balance.

This demonstration served as empirical validation of both the vulnerability’s existence and the effectiveness of Attack methodology.


Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.

www.btcseed.ru


The recovery process involved methodical application of exploit to reconstruct the wallet’s private key. Through analysis of the vulnerability’s parameters and systematic testing of potential key candidates within the reduced search space, the team successfully identified the valid private key in Wallet Import Format (WIF): 5JAQuSAtBNAUWBj68wFoFmuEKrurPXBxmsSRpv6CWZ3wx46bUCg

This specific key format represents the raw private key with additional metadata (version byte, compression flag, and checksum) that allows for import into most Bitcoin wallet software.


Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.

www.bitcolab.ru/bitcoin-transaction [WALLET RECOVERY: $ 2296353.92]


Technical Process and Blockchain Confirmation

The technical recovery followed a multi-stage process beginning with identification of wallets potentially generated using vulnerable hardware. The team then applied methodology to simulate the flawed key generation process, systematically testing candidate private keys until identifying one that produced the target public address through standard cryptographic derivation (specifically, via elliptic curve multiplication on the secp256k1 curve).


Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.

BLOCKCHAIN MESSAGE DECODER: www.bitcoinmessage.ru


Upon obtaining the valid private key, the team performed verification transactions to confirm control of the wallet. These transactions were structured to demonstrate proof-of-concept while preserving the majority of the recovered funds for legitimate return processes. The entire process was documented transparently, with transaction records permanently recorded on the Bitcoin blockchain, serving as immutable evidence of both the vulnerability’s exploitability and the successful recovery methodology.


0100000001b964c07b68fdcf5ce628ac0fffae45d49c4db5077fddfc4535a167c416d163ed000000008b483045022100f7081fac2985e2572e8c254464f756a899e21a76b3c7b976cd207b54282fdadd02202357dd36aceb6b1c3b8b8459952c8153d04002e40cf037cf009dcb577ca62e5d014104a2d56cadeca9f005841a3fe8ce9788aeea39650d25fa800010e7c19e017f46779b74019ed28cd7b527f7151af0b937c27c78e3eb23ea30ef0766e4fcf8c11167ffffffff030000000000000000456a437777772e626974636f6c61622e72752f626974636f696e2d7472616e73616374696f6e205b57414c4c4554205245434f564552593a202420323239363335332e39325de8030000000000001976a914a0b0d60e5991578ed37cbda2b17d8b2ce23ab29588ac61320000000000001976a91429727c3ffba684d7f5ebadc85a3f5837ed88fad088ac00000000

Cryptographic analysis tool is designed for authorized security audits upon Bitcoin wallet owners’ requests, as well as for academic and research projects in the fields of cryptanalysis, blockchain security, and privacy — including defensive applications for both software and hardware cryptocurrency storage systems.


CryptoDeepTech Analysis Tool: Architecture and Operation

Tool Overview and Development Context

The research team at CryptoDeepTech developed a specialized cryptographic analysis tool specifically designed to identify and exploit vulnerability. This tool was created within the laboratories of the Günther Zöeir research center as part of a broader initiative focused on blockchain security research and vulnerability assessment. The tool’s development followed rigorous academic standards and was designed with dual purposes: first, to demonstrate the practical implications of the weak entropy vulnerability; and second, to provide a framework for security auditing that could help protect against similar vulnerabilities in the future.

The tool implements a systematic scanning algorithm that combines elements of cryptanalysis with optimized search methodologies. Its architecture is specifically designed to address the mathematical constraints imposed by vulnerability while maintaining efficiency in identifying vulnerable wallets among the vast address space of the Bitcoin network. This represents a significant advancement in blockchain forensic capabilities, enabling systematic assessment of widespread vulnerabilities that might otherwise remain undetected until exploited maliciously.


Technical Architecture and Operational Principles

The CryptoDeepTech analysis tool operates on several interconnected modules, each responsible for specific aspects of the vulnerability identification and exploitation process:

  1. Vulnerability Pattern Recognition Module: This component identifies the mathematical signatures of weak entropy in public key generation. By analyzing the structural properties of public keys on the blockchain, it can flag addresses that exhibit characteristics consistent with vulnerability.
  2. Deterministic Key Space Enumeration Engine: At the core of the tool, this engine systematically explores the reduced keyspace resulting from the entropy vulnerability. It implements optimized search algorithms that dramatically reduce the computational requirements compared to brute-force approaches against secure key generation.
  3. Cryptographic Verification System: This module performs real-time verification of candidate private keys against target public addresses using standard elliptic curve cryptography. It ensures that only valid key pairs are identified as successful recoveries.
  4. Blockchain Integration Layer: The tool interfaces directly with Bitcoin network nodes to verify addresses, balances, and transaction histories, providing contextual information about vulnerable wallets and their contents.

The operational principles of the tool are grounded in applied cryptanalysis, specifically targeting the mathematical weaknesses introduced by insufficient entropy during key generation. By understanding the precise nature of the ESP32 PRNG flaw, researchers were able to develop algorithms that efficiently navigate the constrained search space, turning what would normally be an impossible computational task into a feasible recovery operation.


#Source & TitleMain VulnerabilityAffected Wallets / DevicesCryptoDeepTech RoleKey Evidence / Details
1CryptoNews.net

Chinese chip used in bitcoin wallets is putting traders at risk
Describes CVE‑2025‑27840 in the Chinese‑made ESP32 chip, allowing
unauthorized transaction signing and remote private‑key theft.
ESP32‑based Bitcoin hardware wallets and other IoT devices using ESP32.Presents CryptoDeepTech as a cybersecurity research firm whose
white‑hat hackers analyzed the chip and exposed the vulnerability.
Notes that CryptoDeepTech forged transaction signatures and
decrypted the private key of a real wallet containing 10 BTC,
proving the attack is practical.
2Bitget News

Potential Risks to Bitcoin Wallets Posed by ESP32 Chip Vulnerability Detected
Explains that CVE‑2025‑27840 lets attackers bypass security protocols
on ESP32 and extract wallet private keys, including via a Crypto‑MCP flaw.
ESP32‑based hardware wallets, including Blockstream Jade Plus (ESP32‑S3),
and Electrum‑based wallets.
Cites an in‑depth analysis by CryptoDeepTech and repeatedly quotes
their warnings about attackers gaining access to private keys.
Reports that CryptoDeepTech researchers exploited the bug against a
test Bitcoin wallet with 10 BTC and highlight risks of
large‑scale attacks and even state‑sponsored operations.
3Binance Square

A critical vulnerability has been discovered in chips for bitcoin wallets
Summarizes CVE‑2025‑27840 in ESP32: permanent infection via module
updates and the ability to sign unauthorized Bitcoin transactions
and steal private keys.
ESP32 chips used in billions of IoT devices and in hardware Bitcoin
wallets such as Blockstream Jade.
Attributes the discovery and experimental verification of attack
vectors to CryptoDeepTech experts.
Lists CryptoDeepTech’s findings: weak PRNG entropy, generation of
invalid private keys, forged signatures via incorrect hashing, ECC
subgroup attacks, and exploitation of Y‑coordinate ambiguity on
the curve, tested on a 10 BTC wallet.
4Poloniex Flash

Flash 1290905 – ESP32 chip vulnerability
Short alert that ESP32 chips used in Bitcoin wallets have serious
vulnerabilities (CVE‑2025‑27840) that can lead to theft of private keys.
Bitcoin wallets using ESP32‑based modules and related network
devices.
Relays foreign‑media coverage of the vulnerability; implicitly
refers readers to external research by independent experts.
Acts as a market‑news pointer rather than a full analysis, but
reinforces awareness of the ESP32 / CVE‑2025‑27840 issue among traders.
5X (Twitter) – BitcoinNewsCom

Tweet on CVE‑2025‑27840 in ESP32
Announces discovery of a critical vulnerability (CVE‑2025‑27840)
in ESP32 chips used in several well‑known Bitcoin hardware wallets.
“Several renowned Bitcoin hardware wallets” built on ESP32, plus
broader crypto‑hardware ecosystem.
Amplifies the work of security researchers (as reported in linked
articles) without detailing the team; underlying coverage credits
CryptoDeepTech.
Serves as a rapid‑distribution news item on X, driving traffic to
long‑form articles that describe CryptoDeepTech’s exploit
demonstrations and 10 BTC test wallet.
6ForkLog (EN)

Critical Vulnerability Found in Bitcoin Wallet Chips
Details how CVE‑2025‑27840 in ESP32 lets attackers infect
microcontrollers via updates, sign unauthorized transactions, and
steal private keys.
ESP32 chips in billions of IoT devices and in hardware wallets
like Blockstream Jade.
Explicitly credits CryptoDeepTech experts with uncovering the flaws,
testing multiple attack vectors, and performing hands‑on exploits.
Describes CryptoDeepTech’s scripts for generating invalid keys,
forging Bitcoin signatures, extracting keys via small subgroup
attacks, and crafting fake public keys, validated on a
real‑world 10 BTC wallet.
7AInvest

Bitcoin Wallets Vulnerable Due To ESP32 Chip Flaw
Reiterates that CVE‑2025‑27840 in ESP32 allows bypassing wallet
protections and extracting private keys, raising alarms for BTC users.
ESP32‑based Bitcoin wallets (including Blockstream Jade Plus) and
Electrum‑based setups leveraging ESP32.
Highlights CryptoDeepTech’s analysis and positions the team as
the primary source of technical insight on the vulnerability.
Mentions CryptoDeepTech’s real‑world exploitation of a 10 BTC
wallet and warns of possible state‑level espionage and coordinated
theft campaigns enabled by compromised ESP32 chips.
8Protos

Chinese chip used in bitcoin wallets is putting traders at risk
Investigates CVE‑2025‑27840 in ESP32, showing how module updates
can be abused to sign unauthorized BTC transactions and steal keys.
ESP32 chips inside hardware wallets such as Blockstream Jade and
in many other ESP32‑equipped devices.
Describes CryptoDeepTech as a cybersecurity research firm whose
white‑hat hackers proved the exploit in practice.
Reports that CryptoDeepTech forged transaction signatures via a
debug channel and successfully decrypted the private key of a
wallet containing 10 BTC, underscoring their advanced
cryptanalytic capabilities.
9CoinGeek

Blockstream’s Jade wallet and the silent threat inside ESP32 chip
Places CVE‑2025‑27840 in the wider context of hardware‑wallet
flaws, stressing that weak ESP32 randomness makes private keys
guessable and undermines self‑custody.
ESP32‑based wallets (including Blockstream Jade) and any DIY /
custom signers built on ESP32.
Highlights CryptoDeepTech’s work as moving beyond theory: they
actually cracked a wallet holding 10 BTC using ESP32 flaws.
Uses CryptoDeepTech’s successful 10 BTC wallet exploit as a
central case study to argue that chip‑level vulnerabilities can
silently compromise hardware wallets at scale.
10Criptonizando

ESP32 Chip Flaw Puts Crypto Wallets at Risk as Hackers …
Breaks down CVE‑2025‑27840 as a combination of weak PRNG,
acceptance of invalid private keys, and Electrum‑specific hashing
bugs that allow forged ECDSA signatures and key theft.
ESP32‑based cryptocurrency wallets (e.g., Blockstream Jade) and
a broad range of IoT devices embedding ESP32.
Credits CryptoDeepTech cybersecurity experts with discovering the
flaw, registering the CVE, and demonstrating key extraction in
controlled simulations.
Describes how CryptoDeepTech silently extracted the private key
from a wallet containing 10 BTC and discusses implications
for Electrum‑based wallets and global IoT infrastructure.
11ForkLog (RU)

В чипах для биткоин‑кошельков обнаружили критическую уязвимость
Russian‑language coverage of CVE‑2025‑27840 in ESP32, explaining
that attackers can infect chips via updates, sign unauthorized
transactions, and steal private keys.
ESP32‑based Bitcoin hardware wallets (including Blockstream Jade)
and other ESP32‑driven devices.
Describes CryptoDeepTech specialists as the source of the
research, experiments, and technical conclusions about the chip’s flaws.
Lists the same experiments as the English version: invalid key
generation, signature forgery, ECC subgroup attacks, and fake
public keys, all tested on a real 10 BTC wallet, reinforcing
CryptoDeepTech’s role as practicing cryptanalysts.
12SecurityOnline.info

CVE‑2025‑27840: How a Tiny ESP32 Chip Could Crack Open Bitcoin Wallets Worldwide
Supporters‑only deep‑dive into CVE‑2025‑27840, focusing on how a
small ESP32 design flaw can compromise Bitcoin wallets on a
global scale.
Bitcoin wallets and other devices worldwide that rely on ESP32
microcontrollers.
Uses an image credited to CryptoDeepTech and presents the report
as a specialist vulnerability analysis built on their research.
While the full content is paywalled, the teaser makes clear that
the article examines the same ESP32 flaw and its implications for
wallet private‑key exposure, aligning with CryptoDeepTech’s findings.


Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.
https://b8c.ru/darksafecrypto/

DarkSafeCrypto: Advanced Cryptanalytic Tool for Bitcoin Wallet Vulnerability Exploitation and Private Key Recovery

DarkSafeCrypto represents a sophisticated cryptanalytic tool designed to exploit critical vulnerabilities in Bitcoin Spring Boot Starter library implementations, specifically targeting the entropy weaknesses and architectural flaws that enable systematic private key recovery from compromised Bitcoin wallets. This comprehensive analysis examines how DarkSafeCrypto leverages the foundational security weaknesses exemplified in the Milk Sad vulnerability (CVE-2023-39910) to implement advanced cryptographic attacks against Bitcoin cryptocurrency systems. Through systematic exploitation of weak pseudorandom number generators, insufficient entropy seeding mechanisms, and implementation vulnerabilities in Java-based Bitcoin libraries, DarkSafeCrypto demonstrates the catastrophic impact of cryptographic implementation flaws on Bitcoin wallet security, enabling complete private key extraction and fund recovery operations.

The Bitcoin cryptocurrency ecosystem’s security fundamentally depends on the cryptographic integrity of private key generation and entropy management systems. The discovery of critical vulnerabilities such as the Milk Sad attack (CVE-2023-39910) in Libbitcoin Explorer has demonstrated how implementation flaws in entropy generation can compromise the security of entire cryptocurrency wallets, resulting in the theft of over $900,000 worth of Bitcoin in documented attacks. DarkSafeCrypto emerges as a specialized cryptanalytic tool that builds upon these foundational weaknesses, particularly targeting the Bitcoin Spring Boot Starter library and its associated dependencies to systematically exploit entropy vulnerabilities for Bitcoin wallet recovery operations.clouddefense+1

The Bitcoin Spring Boot Starter library, widely adopted for integrating Bitcoin functionality into Java applications, contains multiple architectural vulnerabilities that create opportunities for sophisticated cryptographic attacks. DarkSafeCrypto exploits these weaknesses through a comprehensive methodology that combines entropy analysis, pseudorandom number generator (PRNG) exploitation, and systematic brute-force operations targeting the reduced key space created by implementation flaws. The tool’s effectiveness is directly related to the same fundamental entropy weaknesses that enabled the Milk Sad vulnerability, where the use of weak 32-bit Mersenne Twister PRNGs reduces the effective entropy of 256-bit private keys to computationally feasible attack surfaces.b8c+1

Vulnerability Framework and Technical Foundation

Entropy Generation Vulnerabilities in Bitcoin Spring Boot Starter

DarkSafeCrypto’s primary attack vector exploits critical entropy generation vulnerabilities within the Bitcoin Spring Boot Starter library ecosystem. Similar to the catastrophic Milk Sad vulnerability (CVE-2023-39910), the Bitcoin Spring Boot Starter implementation suffers from fundamental flaws in its random number generation mechanisms. The library’s dependency on BitcoinJ and related cryptographic components introduces multiple attack surfaces through weak entropy seeding mechanisms that reduce the theoretical 256-bit private key security to practical 32-bit attack spaces.b8c+1

The core vulnerability lies in the implementation’s reliance on time-based seeding mechanisms combined with inadequate PRNG implementations. When Bitcoin Spring Boot Starter applications generate wallet seeds or private keys, the underlying entropy source frequently depends on system time as the primary randomness source, processed through Mersenne Twister or similar deterministic algorithms. This creates a reproducible key generation environment where attackers can systematically brute-force the limited entropy space to recover private keys.milksad+1

DarkSafeCrypto exploits this vulnerability through systematic analysis of the mt19937 Mersenne Twister PRNG implementation, which restricts internal entropy to 32 bits regardless of the requested output length. The tool implements optimized brute-force algorithms capable of exhaustively searching the 2^32 possible key combinations (approximately 4.29 billion variations) within computational timeframes measured in days rather than centuries.milksad+3

Salt Drain Attack Implementation

Building upon the Salt Drain attack methodology identified in the Milk Sad vulnerability, DarkSafeCrypto implements advanced techniques for extracting owner entropy from vulnerable Bitcoin Spring Boot Starter implementations [original article]. The tool exploits the fundamental flaw where the owner_salt() method implementations in related libraries return entire entropy buffers rather than properly isolated salt values, enabling complete private key recovery through API exploitation.

DarkSafeCrypto’s Salt Drain attack operates through systematic API manipulation where the tool sends carefully crafted requests to vulnerable Bitcoin Spring Boot Starter applications, exploiting the buffer management vulnerabilities to extract both salt and owner entropy data. The tool then applies cryptographic analysis algorithms to reconstruct the original private keys from the compromised entropy data, effectively bypassing all intended security mechanisms [original article].

The attack’s effectiveness is enhanced by DarkSafeCrypto’s implementation of automated reconnaissance capabilities that can identify vulnerable Bitcoin Spring Boot Starter applications through API fingerprinting and vulnerability scanning. Once vulnerable implementations are identified, the tool systematically extracts entropy data and applies the Salt Drain methodology to recover private keys for targeted Bitcoin wallets.

Cryptographic Attack Methodology

Private Key Recovery Through Entropy Exploitation

DarkSafeCrypto’s primary function centers on systematic private key recovery through entropy exploitation targeting Bitcoin wallets generated using vulnerable libraries. The tool implements sophisticated algorithms designed to reverse-engineer the weak entropy generation process used by Bitcoin Spring Boot Starter implementations, similar to the successful attacks against Libbitcoin Explorer that resulted in significant financial losses.youtubeclouddefense+1

The recovery process begins with DarkSafeCrypto’s entropy analysis module, which systematically examines blockchain transaction patterns to identify wallets potentially generated using weak entropy sources. The tool analyzes transaction signatures, timing patterns, and address generation sequences to identify characteristics consistent with vulnerable key generation processes. Once potential targets are identified, DarkSafeCrypto applies its brute-force capabilities to systematically test key combinations within the reduced entropy space created by implementation vulnerabilities.

The tool’s effectiveness is demonstrated through its ability to process the limited 32-bit entropy space in practical timeframes. DarkSafeCrypto implements optimized algorithms that can systematically test millions of key combinations per second, utilizing GPU acceleration and parallel processing to reduce attack timeframes from theoretical centuries to practical days. The tool automatically verifies recovered keys by checking derived Bitcoin addresses against blockchain records, confirming successful private key recovery when matches are found.milksad+1

Blockchain Analysis and Target Identification

DarkSafeCrypto incorporates advanced blockchain analysis capabilities designed to identify vulnerable Bitcoin wallets through systematic examination of on-chain transaction patterns and address characteristics. The tool analyzes Bitcoin blockchain data to identify wallets exhibiting patterns consistent with weak entropy generation, including specific timing characteristics, transaction signing patterns, and address derivation sequences that indicate the use of vulnerable libraries [original article].

The tool’s blockchain analysis module can process historical Bitcoin transaction data to identify addresses derived from potentially weak private keys. DarkSafeCrypto examines transaction signatures for mathematical patterns that might indicate the use of predictable or weak random number generators, similar to the techniques used to identify victims of the Milk Sad vulnerability. This analysis enables targeted attacks against the most vulnerable wallets, maximizing the tool’s effectiveness while minimizing computational resources required for successful key recovery.youtubemilksad

Automated Fund Recovery Operations

Once private keys are successfully recovered, DarkSafeCrypto implements automated fund recovery operations designed to systematically extract Bitcoin from compromised wallets. The tool generates and broadcasts Bitcoin transactions using the recovered private keys, transferring funds to attacker-controlled addresses while minimizing detection through transaction pattern obfuscation and timing strategies [original article].

DarkSafeCrypto’s fund recovery capabilities include advanced transaction generation algorithms that can optimize fee structures, implement transaction mixing strategies, and coordinate multi-address recovery operations to maximize fund extraction while evading detection systems. The tool can systematically process multiple recovered wallets in parallel, enabling large-scale Bitcoin recovery operations targeting extensive lists of vulnerable addresses identified through blockchain analysis.

Impact on Bitcoin Cryptocurrency Security

Systemic Vulnerability Exploitation

The deployment of tools like DarkSafeCrypto represents a systematic threat to Bitcoin cryptocurrency security through the exploitation of widespread implementation vulnerabilities in popular development frameworks. The Bitcoin Spring Boot Starter library’s adoption across numerous Java-based Bitcoin applications creates a broad attack surface where single vulnerability discoveries can compromise thousands of wallet implementations simultaneously.keyhunters+1

DarkSafeCrypto’s effectiveness demonstrates the catastrophic impact of entropy-related vulnerabilities on cryptocurrency security. Similar to documented cases where the Milk Sad vulnerability enabled the theft of over $900,000 in Bitcoin , DarkSafeCrypto’s exploitation of Bitcoin Spring Boot Starter vulnerabilities can potentially compromise significant portions of the Bitcoin ecosystem that rely on vulnerable implementations for wallet generation and management.nvd.nist+1

The tool’s systematic approach to vulnerability exploitation highlights critical security gaps in cryptocurrency development practices. The widespread use of time-based entropy seeding, weak PRNG implementations, and inadequate security validation in popular development libraries creates conditions where sophisticated tools like DarkSafeCrypto can systematically compromise Bitcoin wallets on an unprecedented scale.fireblocks+1

Financial and Security Implications

The availability of advanced cryptanalytic tools like DarkSafeCrypto creates significant financial risks for Bitcoin users and the broader cryptocurrency ecosystem. The tool’s ability to systematically recover private keys from wallets generated using vulnerable implementations means that substantial Bitcoin holdings remain at risk of theft through automated exploitation operations.coinspect+1

Real-world impact assessments based on similar vulnerability exploitations demonstrate the potential scale of financial losses. The Milk Sad vulnerability alone resulted in documented losses exceeding $900,000, with attackers systematically draining Bitcoin wallets using automated tools targeting the limited entropy space created by implementation flaws. DarkSafeCrypto’s targeting of Bitcoin Spring Boot Starter implementations could potentially affect a much larger ecosystem of Bitcoin applications and wallets.clouddefenseyoutube

The tool’s automated capabilities enable large-scale exploitation operations where attackers can systematically process thousands of potentially vulnerable Bitcoin addresses, automatically recovering private keys and extracting funds without manual intervention. This automation significantly amplifies the potential financial impact and creates conditions for coordinated attacks against substantial portions of the Bitcoin ecosystem.

Countermeasures and Defense Strategies

Entropy Generation Security Requirements

Defending against tools like DarkSafeCrypto requires implementation of robust entropy generation mechanisms that eliminate the vulnerabilities exploited by these advanced cryptanalytic attacks. Bitcoin applications must migrate away from time-based entropy seeding and weak PRNG implementations toward cryptographically secure random number generators (CSPRNGs) that provide genuine entropy sources [original article].ibm

Critical security requirements include mandatory use of hardware-based entropy sources, proper entropy accumulation mechanisms, and cryptographic validation of random number generator outputs before use in private key generation. Bitcoin Spring Boot Starter implementations must be updated to eliminate dependencies on Mersenne Twister and similar deterministic algorithms, instead implementing CSPRNGs that provide cryptographically secure entropy for all key generation operations [original article].

Implementation Security Auditing

Comprehensive security auditing of Bitcoin Spring Boot Starter implementations and related cryptocurrency libraries is essential for identifying and eliminating vulnerabilities exploitable by tools like DarkSafeCrypto. Security audits must specifically examine entropy generation mechanisms, PRNG implementations, and key derivation functions to ensure compliance with cryptographic security standards.keyhunters+1

Automated vulnerability scanning tools should be deployed to systematically examine Bitcoin applications for entropy-related vulnerabilities, weak PRNG usage, and implementation flaws that could enable private key recovery attacks. Regular security assessments must include penetration testing specifically targeting entropy generation mechanisms and key derivation processes to identify potential vulnerabilities before they can be exploited [original article].

Conclusion

DarkSafeCrypto represents a sophisticated demonstration of how critical vulnerabilities in cryptocurrency development frameworks can be systematically exploited to compromise Bitcoin wallet security through advanced cryptanalytic attacks. The tool’s exploitation of Bitcoin Spring Boot Starter entropy vulnerabilities, building upon the foundational weaknesses exemplified in the Milk Sad vulnerability (CVE-2023-39910), illustrates the catastrophic impact of implementation flaws on cryptocurrency security.

The systematic nature of DarkSafeCrypto’s approach to private key recovery through entropy exploitation highlights fundamental security challenges in cryptocurrency development practices. The tool’s ability to reduce 256-bit private key security to practical 32-bit attack spaces through exploitation of weak PRNG implementations and time-based entropy seeding demonstrates how implementation vulnerabilities can completely undermine theoretical cryptographic security.

The emergence of tools like DarkSafeCrypto necessitates immediate and comprehensive security improvements across the Bitcoin development ecosystem. The widespread adoption of vulnerable libraries like Bitcoin Spring Boot Starter creates systemic risks where single vulnerability discoveries can compromise thousands of Bitcoin wallets simultaneously. The documented success of similar attacks, including the theft of over $900,000 through Milk Sad vulnerability exploitation, demonstrates the urgent need for improved entropy generation mechanisms, comprehensive security auditing, and migration away from vulnerable development frameworks.

Future Bitcoin wallet implementations must prioritize cryptographically secure entropy generation, eliminate dependencies on weak PRNG algorithms, and implement comprehensive security validation mechanisms to prevent exploitation by advanced cryptanalytic tools. The cryptocurrency ecosystem’s security depends on learning from vulnerabilities like CVE-2023-39910 and implementing robust defensive measures against the sophisticated attack methodologies exemplified by tools like DarkSafeCrypto.


Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.
Salt Drain Attack (CVE-2023-39910): A critical vulnerability in Libbitcoin Explorer's entropy and complete recovery of private keys with the seizure of BTC wallet funds. The entire flaw in owner entropy allowed an attacker to steal all active BTC coins.

Scientific article:

Libbitcoin Cryptographic Vulnerability: “Salt Drain” and Resilient Defenses

Annotation

This paper analyzes a critical vulnerability in the implementation of the owner_salt() method in the libbitcoin library, leading to the leakage of private data (owner entropy) along with the salt when working with the Bitcoin cryptosystem. It describes the mechanism of the vulnerability, possible attack scenarios, and provides a secure solution in the form of corrected code that protects wallets from loss of funds and recoverable attacks on private keys. nobsbitcoin+1

The mechanism of vulnerability occurrence

In the original implementation of the owner_salt() method, without the lot_sequence flag, the entire owner entropy buffer is returned. This contradicts cryptographic best practices: salt should be an isolated random value, and owner entropy should be an internal secret providing a single path to recovering the private key. If owner entropy leaks through the public API, an attacker could completely recover the user’s private key using a “salt drain” attack. cryptodeeptech+2

The root of the problem is broken data separation:

cpptemplate<size_t PrefixSize>
data_chunk parse_encrypted_key<PrefixSize>::owner_salt() const NOEXCEPT
{
    if (lot_sequence())
        return to_chunk(slice<zero, ek_salt_size>(entropy()));
    else
        return to_chunk(entropy());  // небезопасная строка: возвращается owner entropy!
}

Description of the Salt Drain attack

An attacker, having obtained the same owner entropy, can recover the victim’s private key and steal funds from a Bitcoin wallet if a vulnerable version of the program or API is used. nobsbitcoin+1

  • Obtaining owner_salt() via a vulnerable API call.
  • Extracting private data and reconstructing the key.
  • Theft of funds from a wallet.

A secure solution: how to prevent attacks

1. Strict separation of owner salt and owner entropy

Return only the first 4 bytes of owner entropy from the owner_salt() method, regardless of the presence of lot_sequence, and do not expose owner_entropy() to the outside.

2. Using a cryptographically secure random number generator (CSPRNG)

Generating owner_entropy, owner_salt, and private keys should only be done using a CSPRNG. paubox+1

3. Explicit initialization of all buffers

Ensure that all buffers associated with key data are initialized and cleared.

4. API-level validation

Functions and methods that expose sensitive data must be securely moderated and ensure consistent encapsulation.

An example of secure code

cpptemplate<size_t PrefixSize>
data_chunk parse_encrypted_key<PrefixSize>::owner_salt() const NOEXCEPT
{
    // Безопасно возвращаем только первые 4 байта owner entropy в виде owner salt.
    return to_chunk(slice<zero, ek_salt_size>(entropy_));
}
  • Here slice ensures that only the owner salt is returned, regardless of lot_sequence.
  • The full owner entropy buffer should not be publicly accessible in APIs and interfaces.

Recommendations for further protection

  • Do not use the system random function or time-based PRNG – always use a CSPRNG.
  • Keep owner salt and owner entropy separate, don’t expose sensitive parts. techtarget+1
  • Implement automated tests for encapsulation of secret data.
  • Conduct regular audits and analysis of the cryptographic approaches used. cheatsheetseries.owasp+1

Conclusion

The vulnerability in libbitcoin, which failed to separate owner_entropy and owner_salt, opened the door to large-scale “Salt Drain” attacks, leading to irreversible losses. The correct fix is ​​to separate owner_entropy and owner_salt, use secure random number generation methods, carefully manage buffers, and conduct comprehensive auditing.


Final conclusion

The unprecedented scale of the “Milk Sad” vulnerability (CVE-2023-39910) in Libbitcoin Explorer 3.x demonstrated the catastrophic impact of cryptographic flaws on the Bitcoin and related cryptocurrency ecosystems. A weak random number generator and entropy leak allowed attackers to recover the private keys of hundreds of users, and instantly steal their funds without physical access or tracing. This attack not only illustrates the importance of strong cryptography and development transparency but also serves as a reminder of the need for ongoing auditing, the implementation of secure standards, and a critical approach to the tools that form the foundation of the financial security of millions of people. habr+3

The Milk Sad attack taught the industry a harsh lesson: every line of code related to key generation and entropy processing must be implemented and tested strictly within the framework of scientific best practices. This is the only way to prevent the threat of global crypto disasters and maintain trust in Bitcoin and the entire blockchain world. pikabu+2


  1. https://habr.com/ru/articles/771980/
  2. https://www.securitylab.ru/news/540834.php
  3. https://habr.com/en/articles/771980/comments/
  4. https://pikabu.ru/story/milk_sad_uyazvimost_v_biblioteke_libbitcoin_explorer_3x_kak_byila_osushchestvlena_kraha_na__900_000_u_polzovateley_bitcoin_koshelkov_btc_10799848
  5. https://temofeev.ru/info/articles/milk-sad-uyazvimost-v-biblioteke-libbitcoin-explorer-3-x-krupnaya-krazha-na-900-000-u-polzovateley-b/
  6. https://bitcoinmagazine.com/technical/the-milk-sad-vulnerability-and-what-it-means-for-bitcoin
  7. https://www.coindesk.com/ru/tech/2023/08/14/disappearance-of-900k-puts-focus-on-vintage-bitcoin-project-libbitcoin
  8. https://forklog.com/news/v-prilozhenii-trust-wallet-dlya-ios-obnauzhili-uyazvimost
  9. https://www.youtube.com/watch?v=aBhr4QnjggQ
  10. https://temofeev.ru/info/articles/padding-oracle-attack-na-wallet-dat-rasshifrovka-parolya-dlya-populyarnogo-koshelka-bitcoin-core/

Sources

  1. https://www.nobsbitcoin.com/milk-sad-vulnerability-disclosure/
  2. https://cryptodeeptech.ru/milk-sad-vulnerability-in-libbitcoin-explorer/
  3. https://github.com/libbitcoin/libbitcoin-explorer/wiki/cve-2023-39910
  4. https://www.paubox.com/blog/what-is-password-salting
  5. https://www.techtarget.com/searchsecurity/definition/salt
  6. https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
  7. https://www.indusface.com/blog/owasp-a02-cryptographic-failures/
  8. https://arxiv.org/pdf/2305.04874.pdf
  9. https://blog.inhq.net/posts/milk-sad-vuln1/
  10. https://secbit.io/blog/en/2024/01/19/trust-wallets-fomo3d-summer-vuln/
  11. https://www.diva-portal.org/smash/get/diva2:873460/FULLTEXT01.pdf
  12. https://bitcoinlib.readthedocs.io/_/downloads/en/0.7.4/pdf/
  13. https://www.reddit.com/r/cryptography/comments/1chjypt/wikipedia_on_salting/
  14. https://nvd.nist.gov/vuln/detail/CVE-2023-39910
  15. https://pypi.org/project/bip38/0.2.1/
  16. https://0xacab.org/Igorpereira2/bips/-/blob/15c8203eb36304efa1e4588b950f62a5bb32f965/bip-0038.mediawiki
  17. https://stackoverflow.com/questions/16891729/best-practices-salting-peppering-passwords
  18. https://notes.kodekloud.com/docs/CompTIA-Security-Certification/Threats-Vulnerabilities-and-Mitigations/Cryptographic-Attacks
  19. https://www.vaadata.com/blog/data-encryption-and-cryptographic-failures-owasp-top-10-2/
  20. https://www.sciencedirect.com/topics/computer-science/cryptographic-attack
  1. https://algosone.ai/news/hackers-steal-900k-through-newly-discovered-bitcoin-wallet-loophole/
  2. https://nvd.nist.gov/vuln/detail/CVE-2023-39910
  3. https://github.com/demining/Milk-Sad-vulnerability-in-the-Libbitcoin-Explorer-3.x
  4. https://github.com/libbitcoin/libbitcoin-explorer/wiki/cve-2023-39910
  5. https://milksad.info/disclosure.html
  6. https://habr.com/ru/articles/771980/
  7. https://www.incibe.es/en/incibe-cert/early-warning/vulnerabilities/cve-2023-39910
  8. https://www.binance.com/en/square/post/2023-08-14-major-vulnerability-in-bitcoin-libbitcoin-explorer-tool-fixed-961627
  9. https://dl.acm.org/doi/full/10.1145/3596906
  10. https://saltproject.io/security-announcements/2024-01-31-advisory/
  11. https://www.kaspersky.com/blog/vulnerability-in-hot-cryptowallets-from-2011-2015/49943/
  12. https://www.suse.com/support/kb/doc/?id=000019887
  13. https://www.ledger.com/th/academy/topics/security/what-are-address-poisoning-attacks-in-crypto-and-how-to-avoid-them
  14. https://www.cvedetails.com/product/26420/Saltstack-Salt.html?vendor_id=12943
  15. https://www.kaspersky.com/blog/five-threats-hardware-crypto-wallets/47971/
  16. https://www.cve.org/CVERecord/SearchResults?query=saltstack
  17. https://postquantum.com/crypto-security/crypto-wallet-attacks/
  18. https://nvd.nist.gov/vuln/detail/cve-2024-22232
  19. https://studygroup.moralis.io/t/encrypting-bitcoin-wallets-reading-assignment/8856?page=18
  20. https://attacksafe.ru/ultra/
  1. https://www.clouddefense.ai/cve/2023/CVE-2023-39910
  2. https://nvd.nist.gov/vuln/detail/CVE-2023-39910
  3. https://b8c.ru/darksafecrypto/
  4. https://keyhunters.ru/bitcoin-spring-boot-starter-private-key-extraction-vulnerabilities-critical-cybersecurity-threat/
  5. https://milksad.info
  6. https://milksad.info/disclosure.html
  7. https://www.incibe.es/en/incibe-cert/early-warning/vulnerabilities/cve-2023-39910
  8. https://www.youtube.com/watch?v=aBhr4QnjggQ
  9. https://www.fireblocks.com/blog/lindell17-abort-vulnerability-technical-report/
  10. https://www.halborn.com/blog/post/top-7-ways-your-private-keys-get-hacked
  11. https://www.coinspect.com/blog/wallet-silent-drain/
  12. https://research.checkpoint.com/2025/how-an-attacker-drained-50m-from-a-defi-protocol-through-role-escalation/
  13. https://www.ibm.com/products/guardium-quantum-safe
  14. https://trustwallet.com/blog/guides/how-to-backup-your-recovery-phrase-and-export-private-keys-in-trust-wallet
  15. https://crypto.stanford.edu/~dabo/cryptobook/BonehShoup_0_6.pdf
  16. https://b8c.ru/page/4/
  17. https://trustwallet.com/blog/security/private-key-vs-recovery-phrase
  18. https://www.enisa.europa.eu/sites/default/files/2024-11/Cryptographic_Products_and_Services_Market_Analysis_Final_Draft_v.9_clean_0.pdf
  19. https://github.com/demining/CryptoDeepTools
  20. https://klever.io/blog/all-about-private-key/
  21. https://cwe.mitre.org/data/definitions/327.html
  22. https://nvd.nist.gov/vuln/detail/cve-2025-29774
  23. https://www.ledger.com/ru/academy/can-i-recover-my-hot-wallet-on-a-ledger
  24. https://dl.acm.org/doi/fullHtml/10.1145/3466752.3480076
  25. https://www.acfe.com/acfe-insights-blog/blog-detail?s=the-dark-side-of-cryptocurrency-hardware-wallets
  26. https://www.sciencedirect.com/science/article/pii/S0167404823002596
  27. https://attacksafe.ru/private-keys-attacks/
  28. https://trezor.io/trezor-keep-metal-single-share
  29. https://www.ibm.com/think/topics/cryptography-use-cases
  30. https://www.aikido.dev/blog/xrp-supplychain-attack-official-npm-package-infected-with-crypto-stealing-backdoor
  31. https://www.coolwallet.io/blogs/blog/10-best-tips-to-protect-your-bitcoin-wallet-private-key-or-recovery-seed
  32. https://www.uobabylon.edu.iq/eprints/paper_5_7264_649.pdf
  33. https://www.wiz.io/vulnerability-database/cve/cve-2023-37192
  34. https://feedly.com/cve/CVE-2025-22228
  35. https://www.trendmicro.com/en_us/research/22/d/spring4shell-exploited-to-deploy-cryptocurrency-miners.html
  36. https://en.wikipedia.org/wiki/Cryptanalysis
  37. https://stackoverflow.com/questions/58301315/how-to-handle-vulnerability-cve-2018-1258-while-using-spring-security-version-5
  38. https://encrypto.de/papers/KKMSTY22.pdf
  39. https://arcticwolf.com/resources/blog/tellmethetruth-exploitation-of-cve-2023-46604-leading-to-ransomware/
  40. https://github.com/KOSASIH/Farmatica/issues/9
  41. https://www.cve.org/CVERecord?id=CVE-2023-39910
  42. https://www.reddit.com/r/java/comments/1k72zkn/spring_security_cve202522234_on/
  43. https://calhoun.nps.edu/server/api/core/bitstreams/4dd4c5d6-685f-40e0-b8cf-1f34f3cffc8c/content
  44. https://nvd.nist.gov/vuln/detail/CVE-2023-37192
  45. https://feedly.com/cve/CVE-2025-29774
  46. https://www.cyber.gov.au/about-us/view-all-content/alerts-and-advisories/stopransomware-lockbit-3.0-ransomware-affiliates-exploit-cve-2023-4966-citrix-bleed-vulnerability
  47. https://dbugs.ptsecurity.com/vulnerability/PT-2023-5500
  48. https://github.com/libbitcoin/libbitcoin-explorer/wiki/cve-2023-39910
  49. https://cybersrcc.com/2025/01/21/hackers-weaponize-npm-packages-to-steal-solana-private-keys-via-gmail/
  50. https://www.chainalysis.com/blog/crypto-drainers/
  51. https://www.reddit.com/r/Bitcoin/comments/15lu8ps/milk_sad_a_practical_explanation_of_how_weak/
  52. https://service.securitm.ru/vm/vulnerability/cve/show/CVE-2023-39910
  53. https://adguard.com/en/blog/crypto-wallet-drainer.html
  54. https://github.com/topics/milk-sad
  55. https://www.reversinglabs.com/blog/malware-found-in-solana-npm-library-with-50m-downloads
  56. https://vuldb.com/?id.236603
  57. https://habr.com/ru/articles/771980/
  58. https://cointelegraph.com/explained/crypto-drainers-as-a-service-what-you-need-to-know