monero.loveA little love for the network.
← All news

Monero / Security / Wallets

Monero GUI Developers Move to Reduce Password Exposure in Memory

GUI PR 4802 would stop session-long password caching. We trace the remaining Qt and Wallet API copies and separate proposed, merged and released fixes.

Paper collage of a Monero password crossing memory layers toward an encrypted wallet file, with the first path fading before deeper layers

Monero GUI PR #4802 proposes removing a wallet password from the GUI's session-long state. Instead of keeping that value in an application-wide QML property, the changed code prompts when an operation needs a password and checks it against the encrypted wallet keys file.

The change is open for review. No stable release contains it. The source review did not find evidence linking this password handling to a wallet compromise. The proposal reduces how long one password reference remains live. It does not prove that every copy disappears from process memory.

Released GUI password handling

In the released 0.18.5.4 GUI source, the main application window declares walletPassword. Opening a wallet assigns the password dialog's value to that property. The GUI then reuses it while the wallet remains open.

The released code compares that cached value with later dialog input before it shows seed information or changes password settings. The same comparison protects the option to disable password confirmation before sending and parts of the transaction flow. Other paths pass the cached password into view-only wallet creation, restore-height changes, cache repair, and background-sync configuration.

Wallet switching changes this lifetime. The released wizard controller clears walletPassword when it returns to wallet selection, so the value can cover the full time one wallet remains open rather than the application's total lifetime.

The password dialog is another path. Its password property aliases a LineEdit text value. Opening the dialog calls reset(), which assigns an empty string to both password fields. Closing the released dialog only hides the persistent QML object and leaves those fields unchanged. The entered value can remain current until the dialog opens again or QML destroys the object.

Changes in GUI PR 4802

The proposal contains two commits:

  • 857ab6b4ce52f774e680c8924a8d9d80921f18eb clears both password fields when the dialog closes. It first copies the entered text into a local QML variable, closes and resets the dialog, then emits the accepted signal with that local value.
  • 46d66ef588d1b0349004ce33408f035eba553b8f removes walletPassword. Operations receive a password from the dialog and call a new currentWallet.verifyPassword() method when confirmation is required.

Wallet opening still needs a temporary password. The patch stores it in pendingOpenPassword while the asynchronous open is running, clears that property in the wallet-opened handler, then passes a local value to initialization. A cache-repair retry can keep that local value for another open attempt. This is shorter-lived state, not an immediate wipe of every allocation.

The patch also makes background-sync setup and unlock operations prompt at the time of the action. Ongoing blockchain synchronization does not use the GUI property, while the underlying Wallet API still retains a separate password value.

Password lifetime from user input through GUI and QML state, the C++ Wallet API, and encrypted keys-file verification, with shipped, proposed, unresolved, and merged states labeled

PR #4802 changes the orange GUI layer. The charcoal Wallet API layer remains.

Verification reads and decrypts the keys file

The new C++ method converts the QString password to std::string, arranges to call memwipe on that string's current bytes when the method returns, and invokes Core's verifyWalletPassword. It temporarily unlocks the wallet's keys file and relocks it afterward. A mutex prevents concurrent checks through this method.

This is not a comparison with a password hash cached in the GUI. Core's wallet2::verify_password reads the keys file, parses its encrypted payload, derives a ChaCha key from the supplied password and configured KDF rounds, decrypts account data, deserializes it, and validates the view secret key against its public key. PR #4802 requests view-key checking and skips spend-key verification.

Those steps create buffers and cryptographic temporaries. The proposed wrapper explicitly wipes its local std::string, but the reviewed Core function also uses ordinary strings for file and decrypted account data. PR #4802 does not claim to erase all of them.

Repeated file reads and key derivation also do more work than comparing two live strings. Core PR #10232 notes that file-based verification causes a slight delay when protected dialogs open or a wallet unlocks. PR #4802 does not provide a responsiveness benchmark. Its QML test checks correct and incorrect password results after wallet creation, but does not measure latency or inspect process memory.

Incorrect passwords return the same visible "Wrong password" message used by the changed call sites. Exceptions are caught and logged as verification failures without logging the password. Diagnostic text can still distinguish an exceptional file or parsing failure from an ordinary false result, so logs may reveal operational state even though they do not reveal the credential.

Why clearing a Qt field is not a forensic guarantee

Qt documents that QString uses implicit sharing. Copies can share one data block until a write causes detachment. Converting a QString to std::string creates a separate encoded value. Passing values through QML signals, JavaScript locals, asynchronous lambda captures, and C++ parameters can extend the number or lifetime of references.

QML properties live with their owning objects, while JavaScript values are reclaimed according to the QML engine's garbage-collection rules. Freed storage can remain in allocator-managed memory until it is reused. A password-mode TextInput changes display and clipboard behavior. It does not turn its backing string into a securely erased container.

Assigning an empty string removes the application's live value at that location. It does not establish that old bytes were overwritten in every shared block, detached allocation, temporary, register, allocator cache, swap area, hibernation image, or earlier crash dump. It is also wrong to assume every stale allocation remains readable or contains a complete password.

The Wallet API still retains a password

Monero Core's WalletImpl has an ordinary std::string m_password. The API assigns it when a wallet is created, recovered, or opened. It reuses the value for password changes, storing to another path, and multisig operations. GUI PR #4802 does not remove or wipe that member.

Core PR #10232 is the broader proposal to remove the Wallet API's cached password and change callers that depend on it. Its discussion covers the tradeoff between prompting, reliable wallet storage, background behavior, and leaving password policy to applications. That PR remains open. Until it or another design lands, removing GUI-managed state is not the same as removing the password from the wallet process.

The encrypted .keys file is a different layer again. Encryption protects the file while it is closed on storage. To open or verify it, the running program must process the supplied password and decrypted material. Disk encryption therefore does not eliminate runtime exposure.

The separate merged wipeable_string fix

Core PR #11715 addresses another mechanism. It changes epee::wipeable_string copy and move assignment so the destination's previous live contents are wiped before its buffer is replaced. The merge commit is b84d6947e4e8fb7ae04d3c963c9e122babc38a44.

That fix does not convert GUI QString values or WalletImpl::m_password into wipeable_string. It protects the old destination buffer in the two corrected assignment paths. It cannot erase unrelated copies. Our separate technical investigation explains the source change and dummy-data tests.

Attacker access requirements

Neither reviewed change gives a remote website a path into Monero GUI memory. Reading useful remnants normally requires another capability, such as malware running with sufficient access, a permitted debugging interface, a process-memory disclosure, a captured core dump, a compromised user session, or privileged forensic access.

Operating-system controls affect who can inspect a process. Linux ptrace access checks consider credentials, capabilities, dumpability and security modules. A crash system can save an image of process memory. For example, systemd-coredump can retain dumps for later debugging. The Linux kernel's hibernation documentation also warns that a suspend image can place sensitive memory on disk when it is not encrypted.

The reviewed evidence does not show credential extraction from Monero GUI. Shortening a password's live lifetime can reduce the window and number of straightforward references available to such access. It cannot guarantee immunity after malware or an intruder controls the host or user session.

Work remaining before release

As of November 27, 2026 UTC, GUI PR #4802 is open with no merged commit. Review still needs to examine functional regressions across wallet opening, cache repair, wallet switching, password changes, seed display, transaction confirmation, view-only creation, restore-height changes, and background synchronization. Responsiveness needs measurement because each confirmation can read and decrypt keys-file data.

Core PR #11715 is merged to development, but the latest stable Core and GUI releases are both 0.18.5.4 from October 17. The release pages show no stable version or verified backport containing the assignment correction. Core PR #10232 is also still open.

Users should treat these as three distinct states: a proposed GUI lifetime reduction, a merged correction for one sensitive-string assignment behavior, and an unresolved Wallet API cache. None is a guarantee that credentials have vanished from every part of process memory.

Support Monero Love

Help keep the public nodes and packages running. Send any amount of XMR.

Scan with a Monero wallet to donate to Monero Love.89hGTKxRVA3AUeKAbCRBt5TMSzq3MQZooNNsezCpNFjp2oeJPRx8AJeGKA8ziHZNqab78f4Vr1ntxhPDxX5298nnGZjHkhm