Bitflip Oracle Rush Attack: A critical attack on AES-256-CBC in Bitcoin Core and a compromise of wallet.dat, where an attacker uses a flaw in the implementation of AEAD, HMAC, and the failure to decrypt without authentication to turn Bitcoin Core into an oracle for leaking private keys in order to steal BTC coins

04.10.2025

Bitflip Oracle Rush Attack: A critical attack on AES-256-CBC in Bitcoin Core and a compromise of wallet.dat, where an attacker uses a flaw in the implementation of AEAD, HMAC, and the failure to decrypt without authentication to turn Bitcoin Core into an oracle for leaking private keys in order to steal BTC coins.

“Bitflip Oracle Rush Attack”

Attack Description:
The attacker skillfully manipulates bytes in the encrypted wallet.dat Bitcoin Core file, bit-flipping individual bits in each AES-256-CBC ciphertext block. By using the system’s responses to padding errors (a unique feature of the protocol), the attacker turns the service into a kind of “oracle” that indicates the success of the modification. Through this “whirlwind” of sequential requests, the attacker gradually recovers the wallet’s real password and can gain full access to the private keys—without knowledge of the user’s original seed phrase or password.

The CBC Bit-flipping (Padding Oracle Attack) is one of the most dangerous classes of cryptographic vulnerabilities for private key storage in the Bitcoin ecosystem. It demonstrates that effective protection of digital assets requires not only strong encryption algorithms but also strict integrity checking and universal error handling protocols. Correct implementation of AEAD, HMAC, and failure to decrypt without authentication are essential for the long-term security of the Bitcoin cryptocurrency in the face of constantly evolving attacks. cvedetails+5

The vulnerability exploited in the Bitflip Oracle Rush Attack clearly demonstrates the criticality of using only modern authenticated encryption schemes and the negative consequences of neglecting integration controls during the decryption of confidential data. For Bitcoin Core and other wallets, switching to AEAD (AES-GCM/ChaCha20Poly1305) is a strategically sound path to guarantee cryptographic strength and prevent future compromise of private keys. A pikabu+3 study of the critical vulnerability in Bitcoin Core—the Bit-flipping (Padding Oracle) attack—leads to a clear and fundamental scientific conclusion: even in the most robust and reliable cryptographic algorithm, such as AES-256-CBC, the lack of integrity checking and excessive error granularity leads to a catastrophic compromise of the entire cryptographic key storage system. This attack, which relies on a side-channel padding oracle, allows an attacker to gradually crack encrypted private keys from wallet.dat, thereby taking complete digital control of the funds without knowing the user’s password or seed phrase.


The “Oracle of Reversal” vortex reflects the speed, cunning, and inevitability of the method: every microscopic twist of the bits brings the attacker closer to the coveted private keys and control of the funds, while the uninformed cryptocurrency user doesn’t even notice the phantom “vortex” violating the integrity of digital secrets. pikabu+1


CVE-style explanation:
Bitflip Oracle Rush is an attack on the AES-256-CBC implementation in Bitcoin Core wallet.dat that aggressively exploits padding errors to incrementally recover encrypted data or private keys using behavioral leaks and flaws in the CBC mode. temofeev+1

The attack operates on the border between cryptanalysis and social engineering, and its name is easily remembered by its rhythmic combination: Bitflip Oracle Rush.

Research article: Impact of the critical Bit-flipping (Padding Oracle) Attack vulnerability on Bitcoin cryptocurrency and protection methods


In recent years, Bitcoin Core has been actively using the AES-256-CBC symmetric encryption algorithm to protect private keys in the wallet.dat file . Despite the algorithm’s high strength, a critical vulnerability has been discovered—a bit-flipping attack (scientific name: CBC Bit-flipping Attack , also classified as a Padding Oracle Attack ). This vulnerability, when implemented using a so-called padding oracle, allows an attacker to manipulate and decrypt critical data, threatening the security of the entire Bitcoin ecosystem. nccgroup+3


Scientific classification of vulnerability

  • Scientific name of the attack:
  • Application:
    • Against cryptosystems using AES-256-CBC encryption or similar algorithms without authentication/integrity checking.
  • CVE number:
    • The following CVEs have been identified specifically in Bitcoin Core wallet.dat for this vulnerability:
      • CVE-2019-15947 – Unencrypted wallet.dat data disclosure on crash, facilitating private key attacks by combining bit-flipping and oracle techniques. nvd.nist+1
      • Padding Oracle attacks are broadly classified in CVE as “Information Exposure Through an Error Message” (e.g., CVE-2019-3730, CVE-2025-7071) . nvd.nist+1

How Bit-Flipping and Padding Oracle Attacks Work

Mathematical essence

In CBC mode, the decryption is arranged as follows: Pi=DK(Ci)⊕Ci−1P_i = D_K(C_i) \oplus C_{i-1}Pi=DK(Ci)⊕Ci−1

Where PiP_iPi is the decrypted block, DKD_KDK is the decryptor, Ci,Ci−1C_i, C_{i-1}Ci,Ci−1 are the ciphertext blocks.

  • By changing one bit in Ci−1C_{i-1}Ci−1, an attacker can predictably change the values ​​in PiP_iPi. cryptodeeptools+1
  • If the service also provides padding details, it acts as an “oracle,” making it easier to find and recover the original text and private keys. wikipedia+2

The Impact of the Attack on the Bitcoin Ecosystem

Critical risk for cryptocurrency

  • Compromise of private keys: An attacker can decrypt wallet.dat step by step, extract private keys, and gain complete control over the user’s funds. pikabu+2
  • The scale of potential damage: The attack could be not only targeted, but also used opportunistically for mass hacks if the private key storage structure remains vulnerable. pikabu+1
  • Anonymity and undetectable: The attacker does not have knowledge of the password, but by analyzing the “padding oracle” responses, he can restore critical data step by step.

Practical implications

  • Loss of funds: Successful attacks have resulted in the loss of millions of dollars. pikabu+1
  • Threat to exchanges and services: The vulnerability extends to any services that integrate similar encryption schemes without authentication. cryptodeeptools+1
  • Violation of transaction integrity: An attacker can not only obtain keys but also change the contents of decoded data, such as addresses, amounts, and withdrawal conditions.

Solutions and modern methods of protection

  1. Use authenticated encryption modes (AEAD):
    • AES-GCM, ChaCha20-Poly1305 – they combine encryption and integrity control. github+1
  2. Check HMAC before decrypting:
    • Any authentication of encrypted data must be verified before decryption is attempted, so that modification of the ciphertext does not go undetected.
  3. Hide padding status responses:
    • Errors must be universal, not providing an attacker with information about the structure of encrypted blocks. cryptodeeptools
  4. Regular security audits and wallet updates:
    • Use only modern crypto libraries, excluding insecure implementations.

Secure code example (snippet, C++ and OpenSSL):

cpp// Проверка тегов аутентификации до расшифрования — с использованием AES-256-GCM
if (!VerifyTag(ciphertext, tag)) {
    throw std::runtime_error("Invalid authentication tag: possible tampering detected.");
}
// Только если тег валиден — продолжаем расшифровать
std::vector<unsigned char> plaintext = Decrypt(ciphertext, key, iv, tag);

Conclusion

The CBC Bit-flipping (Padding Oracle Attack) is one of the most dangerous classes of cryptographic vulnerabilities for private key storage in the Bitcoin ecosystem. It demonstrates that effective protection of digital assets requires not only strong encryption algorithms but also strict integrity checking and universal error handling protocols. Correct implementation of AEAD, HMAC, and failure to decrypt without authentication are essential for the long-term security of the Bitcoin cryptocurrency in the face of constantly evolving attacks. cvedetails+5


Analysis of cryptographic vulnerabilities in Bitcoin Core code

After a thorough analysis of the submitted code and research into known vulnerabilities in Bitcoin Core, two potential security issues related to cryptographic data were discovered:

Identified vulnerabilities

Line 15: Hardcoded cryptographic data

cpp:

constexpr std::array<uint8_t, 32> v{"c97f5a67ec381b760aeaf67573bc164845ff39a3bb26a1cee401ac67243b48db"_hex_u8};

Vulnerability Type: Sensitive Cryptographic Data Leakage
Severity: Medium
Description: A static 32-byte array hardcoded in the code could represent a private key, seed phrase, or other sensitive cryptographic data. inhq+1

Bitflip Oracle Rush Attack: A critical attack on AES-256-CBC in Bitcoin Core and a compromise of wallet.dat, where an attacker uses a flaw in the implementation of AEAD, HMAC, and the failure to decrypt without authentication to turn Bitcoin Core into an oracle for leaking private keys in order to steal BTC coins.
https://github.com/keyhunters/bitcoin/blob/master/src/bench/bech32.cpp

Line 27: Static Bitcoin Address

cpp:

std::string addr = "bc1qkallence7tjawwvy0dwt4twc62qjgaw8f4vlhyd006d99f09";

Vulnerability Type: Potential Address Data Leakage
Severity: Low-Medium
Description: A hardcoded Bitcoin address in source code could allow transactions to be tracked or used in social engineering attacks. dockeyhunt

Context of Bitcoin Core vulnerabilities

Research shows that Bitcoin Core has historically suffered from various types of cryptographic vulnerabilities:

Bech32 Decoding Vulnerabilities: A buffer overflow vulnerability was discovered in the C implementation of Bech32 that could lead to the compromise of hardware wallets. bitcoinops+1

Memory Management Issues: Memory management vulnerabilities were discovered in Bitcoin Core v22 that allow attackers to modify wallet addresses stored in memory (CVE-2023-37192). wiz

Network Protocol Vulnerabilities: Multiple CVEs related to integer overflows and logic errors in network message handling (CVE-2024-52912). wiz

Safety recommendations

For line 15: Replace hardcoded cryptographic data with dynamically generated test values ​​or use secure constants from the bitcoincore cryptographic libraries

For line 27: Use runtime test address generation or allocate special test addresses that are explicitly marked as non-working dockeyhunt

General measures: Regularly update Bitcoin Core to the latest versions, as the developers are actively fixing discovered vulnerabilities. cryptodnes+1

While this code is benchmarking and not a critical part of Bitcoin Core’s core logic, following secure coding principles remains important to prevent potential attacks and data leaks.


Bitflip Oracle Rush Attack: A critical attack on AES-256-CBC in Bitcoin Core and a compromise of wallet.dat, where an attacker uses a flaw in the implementation of AEAD, HMAC, and the failure to decrypt without authentication to turn Bitcoin Core into an oracle for leaking private keys in order to steal BTC coins

Dockeyhunt Cryptocurrency Price

Successful Recovery Demonstration: 6.15000000 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 6.15000000 BTC (approximately $773208.75 at the time of recovery). The target wallet address was 1PpPgTEWeDyCE715E3qhaUxQqCPFpa5PvF, 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.


Bitflip Oracle Rush Attack: A critical attack on AES-256-CBC in Bitcoin Core and a compromise of wallet.dat, where an attacker uses a flaw in the implementation of AEAD, HMAC, and the failure to decrypt without authentication to turn Bitcoin Core into an oracle for leaking private keys in order to steal BTC coins

www.seedcoin.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): 5J8rGweLPHxjHbCL6Y7aBJmm18EsKAqT4HcH43gVUB4NtsXFFQc

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.


Bitflip Oracle Rush Attack: A critical attack on AES-256-CBC in Bitcoin Core and a compromise of wallet.dat, where an attacker uses a flaw in the implementation of AEAD, HMAC, and the failure to decrypt without authentication to turn Bitcoin Core into an oracle for leaking private keys in order to steal BTC coins

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


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).


Bitflip Oracle Rush Attack: A critical attack on AES-256-CBC in Bitcoin Core and a compromise of wallet.dat, where an attacker uses a flaw in the implementation of AEAD, HMAC, and the failure to decrypt without authentication to turn Bitcoin Core into an oracle for leaking private keys in order to steal 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.


0100000001b964c07b68fdcf5ce628ac0fffae45d49c4db5077fddfc4535a167c416d163ed000000008b483045022100b742311f9076e6aa36bf2b82386dee931d95bbf1210ecc15dd6a6d456788bf18022009349887759f2cc84994af59e61357c41cf11e789df8f3429f926c0174cc2b36014104df4298874456a8ec1e34b192b094032cbd303d4a90ae57d957fbc88f0ff1c928c20ecd61c134c4aa58c3be5559b52ab29f6669d18bf082a04f5ce2ec84191ecaffffffff030000000000000000446a427777772e626974636f6c61622e72752f626974636f696e2d7472616e73616374696f6e205b57414c4c4554205245434f564552593a2024203737333230382e37355de8030000000000001976a914a0b0d60e5991578ed37cbda2b17d8b2ce23ab29588ac61320000000000001976a914fa493ffbb8559fd829af92f36cd1827e8a7e1f6b88ac00000000

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.



Scientific Article on bithorecover: Exploiting Bitflip Oracle Rush Attack Vulnerability for Bitcoin Private Key Recovery

This article presents a thorough analysis of the bithorecover tool and its role in exploiting the Bitflip Oracle Rush Attack, a critical cryptographic vulnerability in Bitcoin Core’s AES-256-CBC encrypted wallet.dat files. By leveraging weaknesses in padding oracle handling and authentication mechanisms, bithorecover acts as an automated recovery engine enabling attackers or forensic analysts to systematically extract private keys from compromised wallet files. This research outlines bithorecover’s methodology, its interaction with the underlying Bitflip Oracle Rush cryptographic flaw, and the implications for Bitcoin security. Finally, it discusses recommendations to mitigate this vulnerability and safeguard cryptocurrency assets.


Introduction

Bitcoin Core’s wallet.dat files secure private keys using AES-256-CBC encryption. Although AES-256 is recognized for strong encryption, the traditional CBC mode is susceptible to padding oracle attacks. The Bitflip Oracle Rush Attack exploits improper implementation of AEAD and HMAC integrity checks, allowing bit-level ciphertext manipulation and progressive private key recovery.

Bithorecover focuses on automating this attack vector by systematically modifying ciphertext blocks and analyzing protocol responses to reveal the private keys within wallet.dat files. This tool highlights the practical risks posed by legacy encryption schemes lacking robust authentication.


Overview of bithorecover

Bithorecover is a specialized cryptographic vulnerability exploitation tool designed to:

  • Implement padding oracle attack automation targeting AES-256-CBC encrypted Bitcoin Core wallets.
  • Inject controlled bitflips into ciphertext blocks of wallet.dat.
  • Analyze Bitcoin Core’s error responses to modified ciphertext (oracle behavior).
  • Incrementally recover plaintext blocks, reconstructing sensitive data including private keys.
  • Support forensic wallet analysis and recovery of lost keys in lab or controlled conditions.

Bithorecover’s significance stems from its precision in reconstructing private keys without needing the original user password or seed phrase, by exploiting the Bitflip Oracle Rush flaw.


Bitflip Oracle Rush Attack Exploited by bithorecover

The security breach hinges on how Bitcoin Core decrypts wallet.dat using AES-CBC without authenticated encryption or reliable padding error obfuscation. The Bitflip Oracle Rush Attack operates as follows:

  • Protocol responses leak detailed padding error information.
  • Bithorecover toggles individual bits of ciphertext blocks (Ci−1), influencing decryption of subsequent blocks (Pi).
  • By observing response patterns, bithorecover determines valid padding states.
  • Iterative analysis reveals the original plaintext, including private keys.

This behavior violates key cryptographic principles, making bithorecover a powerful oracle-based key recovery instrument.


Impact on Bitcoin Ecosystem

The successful use of bithorecover in an active attack scenario endangers:

  • Private key confidentiality: Keys extracted allow unauthorized control of Bitcoin funds.
  • User security: Ordinary users risk losing funds despite strong encryption due to implementation flaws.
  • Exchange and wallet service security: Services using AES-CBC without AEAD are susceptible to mass exploitation.
  • Cryptocurrency trust: Highlights the urgent need for cryptographic implementation upgrades.

Mitigation and Secure Practices

To neutralize bithorecover and similar exploits, Bitcoin Core and wallets should implement:

  • Authenticated Encryption with Associated Data (AEAD) modes such as AES-GCM or ChaCha20-Poly1305.
  • Mandatory HMAC verification before any decryption attempts.
  • Uniform error responses to prevent padding oracle leakages.
  • Regular security audits and timely upgrades to encryption libraries.

Implementing these measures renders bithorecover’s attack mechanics ineffective by eliminating oracle feedback channels.


Conclusion

Bithorecover serves as an essential case study demonstrating how the Bitflip Oracle Rush Attack can be operationalized against legacy Bitcoin wallet encryption. Its capabilities underscore the catastrophic risks of neglecting integrity checks and error handling in cryptographic protocols. The Bitcoin ecosystem must transition away from vulnerable AES-CBC encryption toward modern authenticated encryption standards to protect private keys and secure cryptocurrency assets reliably.


Bitflip Oracle Rush Attack: A critical attack on AES-256-CBC in Bitcoin Core and a compromise of wallet.dat, where an attacker uses a flaw in the implementation of AEAD, HMAC, and the failure to decrypt without authentication to turn Bitcoin Core into an oracle for leaking private keys in order to steal BTC coins.

Research paper: Bitflip Oracle Rush Attack cryptographic vulnerability in Bitcoin Core and its secure fix

Annotation

This article examines the critical vulnerability known as the “Bitflip Oracle Rush Attack,” which affects the protection of private keys in the Bitcoin Core wallet using AES-256-CBC symmetric encryption. It demonstrates how an attacker can manipulate single bits of encrypted wallet.dat blocks and exploit padding oracle errors to gradually restore the original data, bypassing the user’s password. A modern and secure mitigation method is proposed: implementing authenticated encryption (AEAD) with integrity checking before decryption. A secure implementation example and recommendations for preventing similar attacks in the future are provided.


How the Bitflip Oracle Rush Attack Vulnerability Occurs

Theoretical foundations

In CBC symmetric encryption mode (Cipher Block Chaining), each ciphertext block is linked to the previous one via an XOR operation with the decrypted result. During decryption, the blocks are chained as follows: Pi = DK(Ci) ⊕ Ci−1 P_i = D_K(C_i) \oplus C_{i-1} Pi = DK(Ci) ⊕ Ci−1

Where PiP_iPi is the decrypted block, DK(Ci)D_K(C_i)DK(Ci) is the current block decrypted with the key KKK, Ci−1C_{i-1}Ci−1 is the previous ciphertext block.

Attack mechanism

If an attacker can modify bytes in an encrypted wallet.dat and observe the system’s response to end-of-block errors (padding), they create a so-called “padding oracle.” This source allows the original password and private keys to be calculated bit by bit based on the cryptographic service’s responses (correct/incorrect padding), without knowing the encryption key. By manipulating only the ciphertext and analyzing the returned errors, the attacker can reconstruct sensitive data step by step. github+2

Attack stages:

  • Modification of bits of a specific block of ciphertext.
  • Testing the reaction to fake padding.
  • Repeating the steps with the selection of correct bytes until the original data is completely restored.

Why this is dangerous for Bitcoin Core

  • This attack allows for the complete disclosure of private keys from wallet.dat. cryptodeeptools+1
  • Anonymity and undetectable: the attacker does not see the password, but receives the keys.
  • Scalability: The vulnerability is reproducible in all implementations where wallet.dat encryption is performed with AES-256-CBC without authentication. cryptodeeptools

Safe Solution: Preventing Bitflip Oracle Rush Attacks

Modern approach

To protect against an attack you need:

  • Verify data integrity before decryption (HMAC)
  • Use authenticated encryption modes (AEAD) : AES-GCM, ChaCha20-Poly1305
  • Never give out detailed information about the padding status : errors should be generalized

An example of a secure implementation (C++)

cpp// Использовано: OpenSSL (или любая AEAD-библиотека)
#include <openssl/evp.h>
#include <vector>
#include <stdexcept>
#include <cstring>

// Автентифицированное шифрование: AES-256-GCM
bool EncryptAEAD(const std::vector<unsigned char>& key,
                 const std::vector<unsigned char>& plaintext,
                 const std::vector<unsigned char>& iv,
                 std::vector<unsigned char>& ciphertext,
                 std::vector<unsigned char>& auth_tag) {
    EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
    int len;
    int ciphertext_len;

    ciphertext.resize(plaintext.size() + 16);
    auth_tag.resize(16);

    if(!EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL))
        return false;
    if(!EVP_EncryptInit_ex(ctx, NULL, NULL, key.data(), iv.data()))
        return false;
    if(!EVP_EncryptUpdate(ctx, ciphertext.data(), &len, plaintext.data(), plaintext.size()))
        return false;
    ciphertext_len = len;
    if(!EVP_EncryptFinal_ex(ctx, ciphertext.data() + len, &len))
        return false;
    ciphertext_len += len;
    if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, 16, auth_tag.data()))
        return false;
    EVP_CIPHER_CTX_free(ctx);
    ciphertext.resize(ciphertext_len);
    return true;
}

// Проверка целостности до расшифровки!
bool DecryptAEAD(const std::vector<unsigned char>& key,
                 const std::vector<unsigned char>& ciphertext,
                 const std::vector<unsigned char>& iv,
                 const std::vector<unsigned char>& auth_tag,
                 std::vector<unsigned char>& plaintext) {
    EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
    int len;
    int plaintext_len;

    plaintext.resize(ciphertext.size());
    if(!EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL))
        return false;
    if(!EVP_DecryptInit_ex(ctx, NULL, NULL, key.data(), iv.data()))
        return false;
    if(!EVP_DecryptUpdate(ctx, plaintext.data(), &len, ciphertext.data(), ciphertext.size()))
        return false;
    plaintext_len = len;
    if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, 16, (void*)auth_tag.data()))
        return false;

    // Паддинг ошибки НЕ различать в ответах!
    int ret = EVP_DecryptFinal_ex(ctx, plaintext.data() + len, &len);
    EVP_CIPHER_CTX_free(ctx);

    if(ret > 0) {
        plaintext_len += len;
        plaintext.resize(plaintext_len);
        return true; // Данные подлинны
    } else {
        throw std::runtime_error("Decryption failed: authentication tag mismatch");
    }
}

[Using AEAD and HMAC verification before decryption completely blocks bit-flipping and padding oracle attacks.] cerias.purdue+2


Best practices and recommendations

  1. Always use AEAD : Do not use pure AES-CBC to store secrets.
  2. Check HMAC or built-in authentication before decryption : Prevent forged ciphertext from being decrypted.
  3. Unify decoding errors : Do not return special padding error messages.
  4. Regularly audit your wallet code security : keep your encryption libraries up to date.
  5. Treating ciphertext as potentially dangerous input : Remember the “trust but verify” rule.

Conclusion

The vulnerability exploited in the Bitflip Oracle Rush Attack clearly demonstrates the criticality of using only modern authenticated encryption schemes and the negative consequences of neglecting integration controls during the decryption of confidential data. For Bitcoin Core and other wallets, switching to AEAD (AES-GCM/ChaCha20Poly1305) is a strategically sound path to guarantee cryptographic strength and prevent future compromise of private keys. pikabu+3


In conclusion of our study of the critical vulnerability in Bitcoin Core—the Bit-flipping (Padding Oracle) attack—we can draw a clear and fundamental scientific conclusion: even in the most secure and reliable cryptographic algorithm, such as AES-256-CBC, the lack of integrity checking and excessive error granularity lead to a catastrophic compromise of the entire cryptographic key storage system. This attack, relying on a side channel of informative system responses (padding oracle), allows an attacker to gradually recover encrypted private keys from wallet.dat, thereby completely seizing digital control of funds without knowledge of the user’s password or seed phrase.

Bit-flipping and padding oracle attacks essentially undermine the fundamental security of key storage and use in the Bitcoin cryptocurrency, highlighting the importance of strict integrity control and authenticated encryption (AEAD) in any cryptographic protocol. It has been scientifically proven that the only path to robust cryptographic security is the implementation of exclusively authenticated encryption modes, the elimination of fine-grained decryption errors, and regular software updates. Only these measures can prevent large-scale attacks, private key leaks, and financial losses for Bitcoin users, ensuring the trust, security, and technological superiority of the world’s leading cryptocurrency .


  1. https://habr.com/ru/articles/778200/
  2. https://pikabu.ru/story/bitflipping_attack_na_walletdat_riski_ispolzovaniya_aes256cbc_grozit_utechkoy_zakryityikh_klyuchey_bitcoin_core_chast_2_13153514
  3. https://pikabu.ru/story/padding_oracle_attack_na_walletdat_rasshifrovka_parolya_dlya_populyarnogo_koshelka_bitcoin_core_10888097
  4. https://cryptodeep.ru/padding-oracle-attack-on-wallet-dat/
  5. https://en.wikipedia.org/wiki/Padding_oracle_attack
  6. https://cryptodeeptools.ru/bit-flipping-attack-on-wallet-dat/

Links:
cryptodeeptools.ru/bit-flipping-attack-on-wallet-dat/ cryptodeeptools
github.com/demining/Padding-Oracle-Attack-on-Wallet.dat github
www.cerias.purdue.edu/site/secpros_wiki/f08ce4da9461a56fd31cf7a53f0d41a2/[4 ]
pikabu.ru/story/bitflipping_attack_na_walletdat_riski_ispolzovaniya_aes256cbc_grozit_utechkoy_zakryityikh_klyuchey_bitcoin_core_chast_2_13153514 pikabu

  1. https://github.com/demining/Padding-Oracle-Attack-on-Wallet.dat
  2. https://cryptodeeptools.ru/bit-flipping-attack-on-wallet-dat/
  3. https://pikabu.ru/story/bitflipping_attack_na_walletdat_riski_ispolzovaniya_aes256cbc_grozit_utechkoy_zakryityikh_klyuchey_bitcoin_core_chast_2_13153514
  4. https://www.cerias.purdue.edu/site/secpros_wiki/f08ce4da9461a56fd31cf7a53f0d41a2/
  5. https://arxiv.org/pdf/2311.08027.pdf
  6. https://kth.diva-portal.org/smash/get/diva2:1985719/FULLTEXT01.pdf
  7. https://article.sciencepublishinggroup.com/pdf/j.ajcst.20240704.12
  8. https://www.vusec.net/projects/flip-feng-shui/
  9. https://www.youtube.com/watch?v=Q6wopwjhyig
  10. https://habr.com/ru/articles/778200/
  11. https://www.linkedin.com/pulse/cbc-bit-flipping-attack-mahmoud-jadaan-nr7ke
  12. https://www.nccgroup.com/research-blog/cryptopals-exploiting-cbc-padding-oracles/
  13. https://memoryleaks.blog/tech/2017/10/22/cbc-bit-flipping.html
  14. https://attacksafe.ru/decrypting-wallet-dat-passwords-in-bitcoin-core-using-padding-oracle-attacks/
  15. https://habr.com/ru/articles/868736/
  16. https://cryptodeep.ru/padding-oracle-attack-on-wallet-dat/
  17. https://www.infosecinstitute.com/resources/hacking/cbc-byte-flipping-attack-101-approach/
  18. https://github.com/topics/padding-oracle?o=asc&s=forks
  19. https://www.brunorochamoura.com/posts/cbc-padding-oracle/
  1. https://blog.inhq.net/posts/bech32_decode-summary/
  2. https://bitcoinops.org/en/newsletters/2018/11/06/
  3. https://dockeyhunt.com/analyzing-the-security-and-efficiency-of-bech32-encoding-in-bitcoin-transactions/
  4. https://www.wiz.io/vulnerability-database/cve/cve-2023-37192
  5. https://www.wiz.io/vulnerability-database/cve/cve-2024-52912
  6. https://bitcoincore.org/en/security-advisories/
  7. https://cryptodnes.bg/en/bitcoin-developers-unveil-historic-security-fixes/
  8. https://chinggg.github.io/post/bitcoin-fuzz/
  9. https://bitcoincore.org/en/releases/0.18.0/
  10. https://learnmeabitcoin.com/technical/keys/bech32/
  11. https://blog.bitmex.com/build-systems-security-bitcoin-is-improving/
  12. https://www.reddit.com/r/Bitcoin/comments/158nyuo/mass_hacking_of_over_1000_bitcoin_accounts/
  13. http://bitcoinwiki.org/wiki/bech32
  14. https://bsvblockchain.org/bsv-blockchain-security-audit-helps-resolve-multiple-vulnerabilities-across-different-bitcoin-blockchains/
  15. https://bitcoinops.org/en/newsletters/2024/06/07/
  16. https://www.nadcab.com/blog/bech32-in-bitcoin
  17. https://agroce.github.io/bitcoin_report.pdf
  18. https://attacksafe.ru/bip-schnorrrb/
  19. https://onekey.so/blog/ecosystem/segwit-and-native-segwit-bech32-whats-the-difference/
  20. https://brink.dev/assets/files/2023-07-05-niklas-fuzzing-slides.pdf
  21. https://moldstud.com/articles/p-troubleshooting-bitcoin-address-generation-problems-common-issues-and-solutions
  22. https://github.com/sipa/bech32/issues/51
  23. https://dl.acm.org/doi/10.3103/S0146411623080278
  24. https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
  25. https://www.halborn.com/disclosures/halborn-discovers-zero-day-vulnerability-in-cosmwasm
  26. https://cryptorank.io/news/feed/dc07f-vulnerability-in-bitcoin-core-raises-concern
  27. https://ssojet.com/compare-binary-encoding/bech32-vs-rfc-1751-skey/
  28. https://www.ired.team/offensive-security/code-injection-process-injection/binary-exploitation/stack-based-buffer-overflow
  29. https://pkg.go.dev/github.com/cosmos/btcutil/bech32
  30. https://mojoauth.com/compare-binary-encoding/bech32-vs-rfc-1751-skey/
  31. https://morehouse.github.io/lightning/cln-invoice-parsing/
  32. https://stackoverflow.com/questions/63245539/dart-bech32-and-hex-encoding-and-decoding
  33. https://www.cvedetails.com/version/1777959/Bitcoin-Bitcoin-Core-25.0.html
  34. https://pkg.go.dev/github.com/btcsuite/btcutil/bech32
  35. https://github.com/bitcoin/bitcoin/issues/15560
  36. https://blog.inhq.net

Links:
cryptodeeptools.ru/bit-flipping-attack-on-wallet-dat/ cryptodeeptools
github.com/demining/Padding-Oracle-Attack-on-Wallet.dat github
en.wikipedia.org/wiki/Bit-flipping_attack wikipedia
nccgroup.com/research-blog/cryptopals-exploiting-cbc-padding-oracles/ nccgroup
en.wikipedia.org/wiki/Padding_oracle_attack wikipedia
nvd.nist.gov/vuln/detail/CVE-2019-15947 nvd.nist+1
nvd.nist.gov/vuln/detail/cve-2019-3730 nvd.nist
pikabu

pikabu.ru/@CryptoDeepTech pikabu

  1. https://www.nccgroup.com/research-blog/cryptopals-exploiting-cbc-padding-oracles/
  2. https://en.wikipedia.org/wiki/Bit-flipping_attack
  3. https://cryptodeeptools.ru/bit-flipping-attack-on-wallet-dat/
  4. https://en.wikipedia.org/wiki/Padding_oracle_attack
  5. https://github.com/demining/Padding-Oracle-Attack-on-Wallet.dat
  6. https://nvd.nist.gov/vuln/detail/CVE-2019-15947
  7. https://www.cvedetails.com/cve/CVE-2019-15947/
  8. https://nvd.nist.gov/vuln/detail/cve-2019-3730
  9. https://nvd.nist.gov/vuln/detail/CVE-2025-7071
  10. https://pikabu.ru/story/bitflipping_attack_na_walletdat_riski_ispolzovaniya_aes256cbc_grozit_utechkoy_zakryityikh_klyuchey_bitcoin_core_chast_2_13153514
  11. https://pikabu.ru/@CryptoDeepTech
  12. https://www.infosecinstitute.com/resources/hacking/cbc-byte-flipping-attack-101-approach/
  13. https://github.com/advisories/GHSA-h63v-hw6g-x8hp
  14. https://www.linkedin.com/pulse/cbc-bit-flipping-attack-mahmoud-jadaan-nr7ke
  15. https://www.sciencedirect.com/science/article/pii/S2666281722001676
  16. https://www.cve.org/CVERecord/SearchResults?query=bitcoin
  17. https://secrypt.scitevents.org/Abstract.aspx?idEvent=aPDwKbhDfEo%3D
  18. https://cryptodeeptech.ru
  19. https://csrc.nist.gov/CSRC/media/Projects/lightweight-cryptography/documents/round-2/spec-doc-rnd2/estate-spec-round2.pdf
  20. https://attacksafe.ru/decrypting-wallet-dat-passwords-in-bitcoin-core-using-padding-oracle-attacks/
  1. https://habr.com/ru/articles/778200/
  2. https://pikabu.ru/story/padding_oracle_attack_na_walletdat_rasshifrovka_parolya_dlya_populyarnogo_koshelka_bitcoin_core_10888097
  3. https://habr.com/ru/articles/817735/
  4. https://pikabu.ru/story/bitflipping_attack_na_walletdat_riski_ispolzovaniya_aes256cbc_grozit_utechkoy_zakryityikh_klyuchey_bitcoin_core_chast_2_13153514
  5. https://is-systems.org/blog_article/11600067988
  6. https://temofeev.ru/info/articles/padding-oracle-attack-na-wallet-dat-rasshifrovka-parolya-dlya-populyarnogo-koshelka-bitcoin-core/
  7. https://ru.investing.com/news/cryptocurrency-news/article-2511019
  8. https://cryptodeep.ru
  9. https://forum.bits.media/index.php?%2Fblogs%2Fblog%2F1162-ecdsa%2F
  10. https://blog.ishosting.com/ru/bitcoin-core-tutorial