RAMnesia Attack: A RAM-based cryptohack that allows for total recovery of private keys and complete theft of funds from lost Bitcoin wallets. An attacker exploits the “Black Box” of memory and triggers the Secret Key Leakage vulnerability, thus destroying the Bitcoin cryptocurrency’s security.

21.09.2025

RAMnesia Attack: A RAM-based cryptohack that allows for total recovery of private keys and complete theft of funds from lost Bitcoin wallets. An attacker exploits the "Black Box" of memory and triggers the Secret Key Leakage vulnerability, thus destroying the Bitcoin cryptocurrency's security.

RAMnesia Attack

RAMnesia is a daring cryptographic attack in which an attacker turns a victim’s RAM into a “black box” for hunting forgotten private keys. In the attack scenario, the hacker runs a dispatcher utility that regularly dumps the memory of active crypto processes (for example, those running libbitcoin or BIP38 encryption). As a result, as soon as a chimera developer error (failure to clear memory) leaves a valuable “gold mine” in RAM—a private key, password, or factor—RAMnesia catches on and mercilessly extracts the key, while the owner is unaware of the theft.

The critical vulnerability “Secret Key Leakage Attack” (Ink Stain Attack, Private Key Disclosure) (CVE-2023-39910) could lead to the complete destruction of cryptocurrency security and catastrophic losses of user funds. All software that processes cryptographic keys must implement memory checks/cleanups and utilize only cryptographic and system security best practices. securitm+4

A critical vulnerability involving the leakage of private keys from RAM poses a grave threat to the entire Bitcoin ecosystem. Attacks such as the Secret Key Leakage Attack or Ink Stain Attack, formalized as CVE-2023-39910, can completely undermine the fundamental principle of decentralized security: in the hands of an attacker, even an instant compromise of a single private key means irreversible and unconditional loss of funds, the impossibility of restoring access, and the undermining of trust in the system as a whole.

Neglect of secure memory management, blatant disregard for RAM sanitization standards, and errors in generating or storing key materials open the door to stealth attacks that leave no trace on the blockchain but can lead to large-scale theft, massive asset loss, and long-term reputational damage. Historical incidents and recent research have shown that a single technological lapse is enough to destroy millions of addresses, hundreds of thousands of bitcoins, and the trust of users, developers, and the industry as a whole. bluescreen+1


Critical Memory Vulnerability: A Fatal Private Key Disclosure Attack and a Total Danger to the Bitcoin Ecosystem


Research paper: The Impact of the Memory Leakage Vulnerability on the Security of Bitcoin


Annotation

This article examines a critical vulnerability related to private key leakage from RAM in Bitcoin cryptocurrency applications. It analyzes the vulnerability’s impact on the Bitcoin ecosystem, describes typical attacks (Ink Stain Attack, Secret Key Leakage Attack), and provides the current vulnerability ID from the Common Vulnerability and Exposure (CVE) database. It also discusses scientific terminology, attack consequences, practical examples, and prevention recommendations.


How does vulnerability arise?

A cryptographic vulnerability arises from careless handling of private keys and other secrets in process memory. In many implementations, such as libbitcoin, BIP38, and other wallet-based systems, private keys, seeds, and derived values ​​are stored in regular variables that are not cleared after use. This allows attackers with access to process memory (via memory dumps, cold-boot attacks, swap files, etc.) to recover private keys and seize control of the user’s crypto assets. keyhunters+1

In the most high-profile cases, such as the vulnerability in Libbitcoin Explorer (CVE-2023-39910 – Milk Sad), the cause of the leak is either weak entropy or insecure memory management (missing mlock/explicit_bzero/Rust RAII, etc.). incibe+1


Scientific name of the attack and formalization

In the scientific cryptographic community, the following terms are used for such attacks:

  • Ink Stain Attack
  • Secret Key Leakage Attack
  • Private Key Compromise
  • Cryptographic Key Disclosure Attack
  • Key Compromise Attack
  • In English-language literature, the general name “Key Leakage Attack” or “Private Key Disclosure Attack” is often encountered. keyhunters

CVE/Vulnerability ID

The most high-profile implementation of this vulnerability in the Bitcoin ecosystem:

  • CVE-2023-39910 (Milk Sad vulnerability) is a critical vulnerability in the entropy generator and memory handling in Libbitcoin Explorer 3.0.0–3.6.0 that allowed attackers to mass-extract private keys and steal user funds. nvd.nist+3

Impact on the attack against Bitcoin

Technical and economic consequences:

  • Complete loss of control over funds. Lost private key = lost Bitcoins – no return possible. core+1
  • Mass user compromise : The vulnerability is being exploited automatically, affecting thousands of wallets worth over $900,000 USD. habr+1
  • Declining trust in the ecosystem : Such mistakes undermine the very idea of ​​decentralized governance and frighten investors and developers.
  • The attack is possible remotely and physically: through access to the process memory on the user’s device, through swap/core dumps, or through the unintentional publication of secrets. core+1

Example attack scenario (Secret Key Leakage):

  1. The user generates or imports a key into a vulnerable wallet (libbitcoin, bx, etc.).
  2. The private key temporarily appears in the process’s memory and is not cleared (or is generated through a weak entropy source).
  3. The attacker obtains a memory dump (via a malicious application, physical access, an OS bug, a swap file, etc.).
  4. The private key is extracted from the dump, and the funds are transferred to the attacker’s address.

Discussion and recommendations

  • This category of vulnerabilities is a fundamental threat to the decentralized ecosystem, since the compromise of private keys = absolute loss of funds.
  • It is necessary to strictly follow best practices for memory management: use mlock, explicit memory zeroing ( explicit_bzero, OpenSSL_cleanse, etc.), allocators such as libsodium. stackoverflow+3
  • Equally important is to use cryptographically secure random number generators, rather than, as in the case of CVE-2023-39910, insecure or outdated PRNGs.

Conclusion

The critical vulnerability “Secret Key Leakage Attack” (Ink Stain Attack, Private Key Disclosure) (CVE-2023-39910) could lead to the complete destruction of cryptocurrency security and catastrophic losses of user funds. All software that processes cryptographic keys must implement memory checks/cleanups and utilize only cryptographic and system security best practices. securitm+4


Cryptographic vulnerability

Analysis of cryptographic vulnerabilities in libbitcoin code

Based on the analysis of the provided libbitcoin code (implementation of BIP38 encryption),  6 critical vulnerabilities related to leakage of private keys and secret data into memory were discovered.

Main vulnerabilities and their locations

Critical vulnerabilities (private key leak):

Line 358-379:  encrypt()Forklog+1 function

cpp:

auto encrypted1 = xor_data<half>(secret, derived.first);
aes256::encrypt(encrypted1, derived.second);
auto encrypted2 = xor_offset<half, half, half>(secret, derived.first);

Problem:  The variable  secret (containing the private key) remains in memory after the encryption operation is complete. There is no explicit memory cleanup.

Line 446-448: Function  decrypt_secret()iacr+1

cpp:

const auto secret = xor_data<hash_size>(encrypted, derived.first);

Problem:  The decrypted private key is stored in a local variable  secret without being securely cleared from memory.


RAMnesia Attack: A RAM-based cryptohack that allows for total recovery of private keys and complete theft of funds from lost Bitcoin wallets. An attacker exploits the "Black Box" of memory and triggers the Secret Key Leakage vulnerability, thus destroying the Bitcoin cryptocurrency's security.
https://github.com/libbitcoin/libbitcoin-system/blob/master/src/wallet/keys/encrypted_keys.cpp

High vulnerabilities (password and temporary key leaks):

Line 257-259: Function  normal()moldstud+1

cpp:

static data_chunk normal(const std::string& passphrase) NOEXCEPT
{
std::string copy{ passphrase };
return to_canonical_composition(copy) ? to_chunk(copy) : data_chunk{};
}

Problem:  A local copy of the password is created in memory without using secure memory clear ( secure memory clearing).

Line 146-159: Function  create_private_key()geeksforgeeks+1

cpp:

auto encrypt1 = xor_data<half>(seed, derived1);
aes256::encrypt(encrypt1, derived2);
const auto combined = splice(slice<quarter, half>(encrypt1), slice<half, half + quarter>(seed));
auto encrypt2 = xor_offset<half, zero, half>(combined, derived1);

Problem:  Temporary variables  encrypt1,  encrypt2,  combined contain secret data and are not explicitly cleared from memory.

Average vulnerabilities:

Line 276-286:  create_token()github+1 function

cpp:

auto factor = scrypt_token(normal(passphrase), owner_salt);
if (lot_sequence)
factor = bitcoin_hash2(factor, owner_entropy);

Problem:  Critical dependence on the quality of the user’s password for the system entropy.

Line 104-107: Function  scrypt_token()stackoverflow+1

cpp:

static hash_digest scrypt_token(const data_slice& data, const data_slice& salt)
{
return scrypt<16384, 8, 8, true>::hash<hash_size>(data, salt);
}

Problem:  Derived keys may remain in stack memory after function execution.

Relationship to known vulnerabilities

These issues are particularly critical in the context of the recently discovered  CVE-2023-39910  (“Milk Sad”) vulnerability in libbitcoin Explorer 3.x, which led to thefts of over  $900,000 . While CVE-2023-39910 is related to a weak random number generator (PRNG), the discovered memory vulnerabilities create additional attack vectors. investing+4

Security implications

Leaking cryptographic keys into memory poses a serious security risk: fabianmonrose.github+1

  • Memory dump attacks  – attackers can extract private keys from process dumps
  • Swapping attacks  – sensitive data can end up in the operating system’s swap file
  • Cold boot attacks  – data remains in RAM for some time after power is removed
  • Multi-user systems  – other processes can access freed memory

Recommendations for correction

To fix the vulnerabilities found, it is recommended to: stackoverflow+2

  1. Use secure memory cleaning:
    • explicit_bzero() for Linux/BSD
    • SecureZeroMemory() for Windows
    • OPENSSL_cleanse() for OpenSSL
  2. Use protected memory allocators  (for example,  libsodium with the function  sodium_malloc())
  3. Use  volatile pointers  to prevent compiler optimizations
  4. Implement RAII  with automatic cleanup in destructors

RAMnesia Attack: A RAM-based cryptohack that allows for total recovery of private keys and complete theft of funds from lost Bitcoin wallets. An attacker exploits the "Black Box" of memory and triggers the Secret Key Leakage vulnerability, thus destroying the Bitcoin cryptocurrency's security.
https://b8c.ru/privkeyroot

PrivKeyRoot: A Forensic Instrument for Analyzing RAM-Based Private Key Leakage in Bitcoin Wallets

The security of the Bitcoin ecosystem stands upon the unbreakable secrecy of private keys. However, recent discoveries, such as the RAMnesia Attack and its formal vulnerability record in CVE-2023-39910 (Milk Sad), demonstrate that memory mismanagement in cryptographic libraries can lead to catastrophic key leakage from system RAM. This paper introduces PrivKeyRoot, a specialized forensic and diagnostic instrument designed to analyze memory-based vulnerabilities and recover cryptographic materials such as private keys. The study focuses on the application of PrivKeyRoot to RAMnesia-style attacks and evaluates its implications for both offensive cryptanalysis and defensive wallet recovery.


One of the most fundamental assumptions in Bitcoin security is that private keys remain inaccessible once generated inside wallet software. This assumption fails when software libraries such as libbitcoin or BIP38-based tools mishandle memory. The RAMnesia Attack leverages the persistence of sensitive data in RAM, exploiting improper zeroization, swap file exposure, or residual memory regions to retrieve forgotten private keys.

In this context, PrivKeyRoot emerges as a dual-purpose tool: designed originally as a forensic recovery instrument to assist in regaining lost access to damaged wallets, but equally capable of highlighting critical failures in cryptographic system design. Its integration of memory scanning, entropy analysis, and leakage detection provides an unprecedented view into how private key disclosure can devastate decentralized systems like Bitcoin.


PrivKeyRoot: Instrument Overview

PrivKeyRoot was engineered as a low-level cryptographic key analysis suite. It incorporates techniques from digital forensics, penetration testing, and memory dumping in order to investigate in-memory leakage of sensitive key material. The primary features of PrivKeyRoot include:

  • Memory Scanner for Key Patterns: Searches live process RAM and core dumps for probable Bitcoin private key candidates (32-byte secp256k1 scalars).
  • Entropy Analyzer: Differentiates between true key material and random noise based on cryptographic entropy models.
  • BIP32/BIP38 Decoder: Converts recovered memory fragments into hierarchical deterministic (HD) keys or encrypted key formats.
  • CVE Signature Detection: Maps discovered leaks against documented vulnerabilities, such as CVE-2023-39910, identifying unsafe key material persistence.
  • Forensic Logging: Provides reports suitable for both cryptocurrency recovery scenarios and bug assessment of cryptographic software libraries.

Vulnerability Context: Linking PrivKeyRoot with RAMnesia

The Secret Key Leakage Attack (Ink Stain Attack) occurs due to vulnerable memory-handling practices in Bitcoin wallet implementations. Specifically:

  • Private keys and intermediate secrets remain in memory after encryption/decryption, visible to RAM scanners.
  • Temporary values generated during password-to-key conversions (e.g., in scrypt) are never securely erased.
  • System swapping or cold-boot residuals allow attackers or forensic analysts to retrieve data after system failure.

By applying PrivKeyRoot to a system compromised by RAMnesia, the researcher (or attacker) can extract the “forgotten” secrets. For instance, in libbitcoin Explorer (bx) versions affected by CVE-2023-39910, PrivKeyRoot can target stack and heap memory segments known to contain vulnerable variables (secret, encrypted1, decrypt_secret). The result is direct recovery of the private key, enabling full wallet compromise or legitimate restoration.


Attack and Recovery Scenarios

PrivKeyRoot highlights how the same tool can be ethically applied for recovery or exploited for theft:

  1. Offensive Scenario (Cryptographic Exploit)
    • An attacker injects a memory dumper alongside a running Bitcoin wallet.
    • PrivKeyRoot scans the dump, detects 32-byte secp256k1 structures, and applies entropy recognition to filter noise.
    • The recovered private key grants full unauthorized access to Bitcoin funds.
  2. Defensive Scenario (Forensic Recovery)
    • A user loses access to a wallet due to software corruption or forgotten password.
    • A RAM snapshot from a crashed device contains residual cryptographic material.
    • PrivKeyRoot identifies the fragments, rebuilds the private key, and allows the user to re-import the recovered data for legitimate access.

Implications for Bitcoin Security

The existence of tools like PrivKeyRoot raises critical questions for cryptocurrency security:

  • Irreversibility of Loss: Once a private key appears in RAM unprotected, the probability of irreversible compromise increases exponentially.
  • Silent Exploits: Memory-based attacks leave no blockchain trace—stolen funds appear as legitimate transfers.
  • Ecosystem Trust: Repeated CVE disclosures such as CVE-2023-39910 (Milk Sad) erode user confidence. The mere possibility of leakage threatens Bitcoin’s principle of trustless decentralization.

Mitigation and Recommendations

Based on case studies and forensic insights drawn from PrivKeyRoot experiments, the following countermeasures are critical:

  • Secure Memory Management: Apply explicit zeroization (explicit_bzero, OPENSSL_cleanse) and protected allocators (e.g., libsodium_malloc).
  • Disable Swapping: Key material must never touch system swap files or disk caches.
  • RAII Secure Containers: Use cryptographic wrappers to ensure automatic cleanup upon scope exit.
  • Entropy Source Validation: Avoid weak or flawed PRNGs that can expose predictable keys.
  • Automated Key Leakage Testing: Integrate tools like PrivKeyRoot in continuous audit pipelines for cryptographic libraries.

PrivKeyRoot demonstrates how the study of memory leakage in Bitcoin wallets is not merely academic but profoundly practical: it can either facilitate catastrophic theft in hands of attackers, or enable legitimate recovery for users who have lost access to funds. The detailed forensic application of this instrument emphasizes a core principle of cryptography—the secrecy of private keys is absolute, and any single exposure destroys all security guarantees.

In the wake of the RAMnesia Attack and CVE-2023-39910, the existence of PrivKeyRoot serves as a stark warning: Bitcoin’s security future hinges upon rigorous adoption of memory-safety practices. Without such proactive measures, the next large-scale collapse of trust in cryptocurrency might already be lurking in an uncleaned memory buffer.


RAMnesia Attack: A RAM-based cryptohack that allows for total recovery of private keys and complete theft of funds from lost Bitcoin wallets. An attacker exploits the "Black Box" of memory and triggers the Secret Key Leakage vulnerability, thus destroying the Bitcoin cryptocurrency's security.

Cryptographic Vulnerabilities Due to Private Key Leaks in Memory: Analysis and Secure Solutions


Annotation

This article examines a fundamental security issue in cryptocurrency applications, using BIP38 and libbitcoin as examples: the leakage of private keys and other cryptographic secrets through RAM. It describes the causes of the vulnerability (RAMnesia Attack), its potential consequences, and accompanying technical diagnostics. It also illustrates a scientifically proven approach to secure data management with an example of a secure implementation in C++. The proposed methods allow for effective prevention of the vulnerability and make similar attacks impossible in the future.


How does vulnerability arise?

Most modern cryptographic libraries make extensive use of dynamic and stack-based memory to store passwords, private keys, and derived data (seed, factor, entropy, etc.). After the corresponding functions complete, the data remains in memory until it is overwritten or freed by the OS. Compilers and runtimes often do not guarantee immediate or complete erasure of sensitive data, and optimizations may even omit explicit zeroing altogether. stackoverflow+1

Thus, private keys, temporary entropies, or derived values ​​from scrypt or hmac functions become easily accessible for analyzing memory dumps, side-channel attacks, cold-boot attacks, or exploits with local user privileges. cgi.uoa+1

The following code fragment is particularly vulnerable:

cpp:

// Пример из libbitcoin (уязвимая реализация)
auto encrypted1 = xor_data<half>(secret, derived.first); // <--- secret в памяти
aes256::encrypt(encrypted1, derived.second);
auto encrypted2 = xor_offset<half, half, half>(secret, derived.first); // еще один дубликат
// secret не очищается, остается в памяти!

As a result, an attack like RAMnesia can exploit this behavior by regularly scanning an application’s memory for “forgotten” keys and secrets.


Consequences and vulnerabilities

  • Access of any local or remote user to the process memory → compromise of private keys, loss of funds.
  • Physical access to the device (cold boot) → recovery of secrets from RAM even after power off.
  • Access via swap/dumps/crashes → secrets are written to swap or core files.

A Solid Fix: Secure Memory Management

Key principles

  1. Using a secure memory allocator : All critical data should be placed only in memory that is not swapped out (mlock).
  2. Explicit guaranteed zeroing of memory after key use: use explicit_bzeroSecureZeroMemoryOPENSSL_cleanse, or safe functions from controversial standards. stackoverflow+2
  3. RAII (Resource Acquisition Is Initialization): automatic memory release and cleanup through specialized classes.
  4. Isolation of keys from compiler optimizations: volatile records, special directives for preserving zeroing operations.

A Better Approach: An Example of a Safe RAII Wrapper and Memory Scraping

We use the capabilities of modern libraries (for example, [libsodium]): libsodium+1

cpp:

#include <sodium.h>
#include <stdexcept>

// Обёртка для безопасной работы с секретными данными (RAII)
class SecureBuffer {
void* ptr_;
size_t size_;
public:
SecureBuffer(size_t size) : size_(size) {
ptr_ = sodium_malloc(size_);
if (ptr_ == nullptr)
throw std::runtime_error("Cannot allocate secure memory");
sodium_mlock(ptr_, size_); // Запрет выгрузки в swap
}
void* get() const { return ptr_; }
size_t size() const { return size_; }
~SecureBuffer() {
sodium_memzero(ptr_, size_); // Явная чистка памяти
sodium_munlock(ptr_, size_); // Разблокировка
sodium_free(ptr_);
}
// запрет копирования!
SecureBuffer(const SecureBuffer&) = delete;
SecureBuffer& operator=(const SecureBuffer&) = delete;
};

// Пример использования
void encrypt_sensitive() {
SecureBuffer keybuf(32);
// ... наполнить keybuf, использовать ...
// Данные keybuf гарантированно будут очищены и освобождены при выходе из области видимости
}
  • All key operations now work only with SecureBuffer.
  • If using conventional memory, use explicit_bzero(ptr, size).

Security guarantees

  • Secrets are not stored on disk/swap – mlock functions are used.
  • Memory is always forced to be cleared , regardless of the compiler’s behavior.
  • Exception-safe (RAII) – key cleanup is guaranteed even if an exception is thrown.

Conclusions and recommendations

  • It is critical to review any cryptographic code for memory and key leaks.
  • It is strongly recommended to use proven memory-safe libraries ( libsodium, RAII approaches, standard cleanup functions). manpages.debian+2
  • Document and test memory cleanup behavior (including through fuzzing and dynamic analysis).
  • Do not use “manual” zeroing without special tools – compilers can optimize it.
  • In scenarios with particularly sensitive keys, disable the output of memory to swap using OS/kernel means.

Scientific final conclusion

A critical vulnerability involving the leakage of private keys from RAM poses a grave threat to the entire Bitcoin ecosystem. Attacks such as the Secret Key Leakage Attack or Ink Stain Attack, formalized as CVE-2023-39910, can completely undermine the fundamental principle of decentralized security: in the hands of an attacker, even an instant compromise of a single private key means irreversible and unconditional loss of funds, the impossibility of restoring access, and the undermining of trust in the system as a whole.

Neglect of secure memory management, blatant disregard for RAM sanitization standards, and errors in generating or storing key materials open the door to stealth attacks that leave no trace on the blockchain but can lead to large-scale theft, massive asset loss, and long-term reputational damage. Historical incidents and recent research have shown that a single technological lapse is enough to destroy millions of addresses, hundreds of thousands of bitcoins, and the trust of users, developers, and the industry as a whole. bluescreen+1

The only guarantee of Bitcoin and cryptocurrency security is rigorous scientific discipline in the architecture of key storage devices and strict adherence to secure memory management methods. Only the implementation of secure algorithms for generating, storing, and clearing secret data can make attacks like RAMnesia, Ink Stain, or CVE-2023-39910 impossible and preserve the essence of cryptoanarchy—personal digital sovereignty and genuine financial independence.


  1. https://top-technologies.ru/ru/article/view?id=37634
  2. https://www.itsec.ru/articles/upravlenie-uyazvimostyami-v-kriptokoshelkah
  3. https://habr.com/ru/articles/430240/
  4. https://habr.com/ru/articles/817237/
  5. https://bluescreen.kz/niesiekretnyi-kliuch-issliedovatieli-obnaruzhili-uiazvimosti-v-kriptokoshielkakh/
  6. https://forklog.com/news/v-chipah-dlya-bitcoin-koshelkov-obnauzhili-kriticheskuyu-uyazvimost
  7. https://pikabu.ru/story/private_key_debug_nekorrektnaya_generatsiya_privatnyikh_klyuchey_sistemnyie_uyazvimosti_bitkoina_chast_1_12755765
  8. https://www.kaspersky.ru/blog/vulnerability-in-hot-cryptowallets-from-2011-2015/36592/
  9. https://osp.ru/os/2025/02/13059629

Literature


The use of the described tools almost completely closes the type of vulnerability associated with the leakage of private data through memory, and makes RAMnesia attacks ineffective even with local access to the device/process.


  1. https://stackoverflow.com/questions/10683941/clearing-memory-securely-and-reallocations
  2. https://www.bacancytechnology.com/blog/cpp-for-cybersecurity
  3. https://cgi.di.uoa.gr/~xenakis/Published/64-ARES-2016/protecting%20sensitive%20information%20in%20the%20volatile%20memory.pdf
  4. https://www.reddit.com/r/ProgrammingLanguages/comments/100tyxg/secrets_management_in_volatile_memory_best/
  5. https://stackoverflow.com/questions/77286578/clearing-memory-buffers-securely-to-prevent-data-leaks-in-c
  6. https://manpages.debian.org/testing/manpages-dev/explicit_bzero.3.en.html
  7. https://man.freebsd.org/cgi/man.cgi?query=explicit_bzero
  8. https://libsodium.net/guide/SecureMemory.html
  9. https://libsodium.gitbook.io/doc/memory_management

Sources

  • Ink Stain Attack: Recovering Private Keys to Lost Bitcoin Wallets keyhunters
  • CVE-2023-39910 github+3
  • Milk Sad vulnerability in Libbitcoin Explorer 3.x.
  • Clearing memory buffers securely to prevent data leaks in C stackoverflow
  • SecureMemory | LibSodium.Net libsodium
  • Secure memory | Libsodium documentation – GitBook libsodium.gitbook
  1. https://keyhunters.ru/ink-stain-attack-recovering-private-keys-to-lost-bitcoin-wallets-a-critical-memory-vulnerability-and-secret-key-leakage-attack-leads-to-a-total-compromise-of-the-cryptocurrency-and-allows-an-attacke/
  2. https://service.securitm.ru/vm/vulnerability/fstec/show/BDU:2023-06146
  3. https://www.incibe.es/en/incibe-cert/early-warning/vulnerabilities/cve-2023-39910
  4. https://habr.com/ru/articles/771980/
  5. https://nvd.nist.gov/vuln/detail/CVE-2023-39910
  6. https://core.ac.uk/download/pdf/301367593.pdf
  7. https://stackoverflow.com/questions/77286578/clearing-memory-buffers-securely-to-prevent-data-leaks-in-c
  8. https://libsodium.net/guide/SecureMemory.html
  9. https://libsodium.gitbook.io/doc/memory_management
  10. https://manpages.debian.org/testing/manpages-dev/explicit_bzero.3.en.html
  11. https://github.com/libbitcoin/libbitcoin-explorer/wiki/cve-2023-39910
  12. https://bitcoincore.org/logs/2016-05-zurich-meeting-notes.html
  13. https://www.academia.edu/88930244/Private_Key_Recovery_Combination_Attacks_On_Extreme_Fragility_of_Popular_Bitcoin
  14. https://bitcoinops.org/en/topic-dates/
  15. https://threatprotect.qualys.com/2020/12/14/amnesia33-multiple-vulnerabilities-in-open-source-tcp-ip-stacks/
  16. https://github.com/demining/Physical-Bitcoin-Attacks
  17. https://www.tenable.com/blog/amnesia33-researchers-disclose-33-vulnerabilities-tcpip-libraries-uip-fnet-picotcp-nutnet
  18. https://b8c.ru
  19. https://www.forescout.com/research-labs/amnesia33/
  20. https://www.first.org/cvss/v3-1/examples
  21. https://bdu.fstec.ru/vul/2023-06146
  22. https://www.trendmicro.com/en_us/research/25/c/cve-2025-26633-water-gamayun.html
  23. https://www.cynerio.com/blog/threat-intel-name-wreck-tcp-ip-vulnerabilities
  24. https://www.trendmicro.com/en_us/research/24/g/CVE-2024-38112-void-banshee.html

How it happens:

  • After each encryption or decryption operation, RAMnesia monitors the process to see if there is a “corpse” of a private or decrypted key left in memory.
  • This digital necromancer combs through newly created and forgotten local variables, looking for anomalous values ​​(for example, 32-byte sequences corresponding to secp256k1 keys).
  • Once the loot is found, it is instantly saved to an unprivileged cloud, where the attacker can calmly analyze the keys at their leisure.

Attack Features:

  • Does not require network access – implemented through physical/service access or an exploit.
  • Ideal for attacks on desktop wallets, cloud services, and even cold systems if they run vulnerable code.
  • Uses the power of “digital oblivion”: everything that is not cleared will be found.

RAMnesia: what my memory has forgotten, I will definitely remember!



  1. https://cqr.company/ru/web-vulnerabilities/memory-leaks/
  2. https://trends.rbc.ru/trends/industry/600702d49a79473ad25c5b3e
  3. https://www.securitylab.ru/blog/personal/xiaomite-journal/353817.php
  4. https://cqr.company/ru/web-vulnerabilities/timing-attacks/
  5. https://www.kaspersky.ru/blog/apple-cpu-encryption-vulnerability/37217/
  6. https://habr.com/en/sandbox/19460/
  7. https://moluch.ru/archive/105/24676
  8. https://searchinform.ru/analitika-v-oblasti-ib/utechki-informatsii/sluchai-utechki-informatsii/skrytye-logicheskie-kanaly-utechki-informatsii/
  9. https://pvs-studio.ru/ru/blog/terms/6618/
  10. https://ru.wikipedia.org/wiki/%D0%90%D1%82%D0%B0%D0%BA%D0%B0_%D0%BA%D0%BE%D0%BC%D0%BF%D1%80%D0%BE%D0%BC%D0%B8%D1%81%D1%81%D0%B0_%D0%BC%D0%B5%D0%B6 %D0%B4%D1%83_%D0%B2%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%B5%D0%BC/%D0%BF%D0%B 0%D0%BC%D1%8F%D1%82%D1%8C%D1%8E/%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%BC%D0%B8