1 major finding · 8 minor findings
Earlier concerns neither republished nor resolved: 2 minor findings · 2 suggestions. See the Run archive for their assessments.
Findings
[major] · CoinControl maximum depth is serialized as minimum depth
The IPC reader sets the maximum depth to 0 for a default CoinControl, making confirmed coins unavailable to multiprocess GUI sends.
Location: src/ipc/capnp/wallet.cpp:196 (head).
Details and suggested fix
The builder writes m_min_depth as maxDepth, and the reader also reads getMinDepth() into m_max_depth. A default CCoinControl has m_min_depth = 0 and m_max_depth = DEFAULT_MAX_DEPTH, so the wallet process receives a maximum depth of 0. AvailableCoins skips outputs whose depth exceeds that maximum, making confirmed UTXOs ineligible.
In multiprocess bitcoin-gui, prepareTransaction passes its cached-balance check, but createTransaction then fails with insufficient funds unless trusted unconfirmed outputs cover the amount. Other calls that pass a CCoinControl have the same bound. For example, a fee bump sets m_min_depth = 1 and cannot add inputs. Funds are not affected.
Serialize m_max_depth with setMaxDepth(), read it with getMaxDepth(), and add a round-trip test with unequal bounds.
[minor] · Reading a WitnessUnknown destination throws
A transaction containing a witness v2+ output can make multiprocess wallet-history IPC calls fail while that transaction remains in the wallet.
Location: src/ipc/capnp/wallet.cpp:137 (head).
Details and suggested fix
When the reader sees witnessUnknown, it calls std::get<WitnessUnknown>(dest) before decoding. The destination is freshly constructed: list elements come from emplace_back() via ReadDestEmplace::update, and CRecipient::dest and CCoinControl::destChange start as CNoDestination. The std::get therefore throws std::bad_variant_access. The builder emits witnessUnknown, so every such destination fails on the reading side.
MakeWalletTx extracts a destination from every output, including outputs the wallet does not own. A third party can therefore pay the user in a transaction that also has a witness v2+ output. After that, getWalletTxs, getWalletTx and getWalletTxDetails fail for that transaction. GUI sends to future-segwit addresses fail the same way. How bitcoin-gui surfaces the IPC exception was not traced.
Construct a WitnessUnknown from the reader and assign it to dest; the type has no default constructor. Add a round-trip test for every CTxDestination alternative, starting from a default-constructed destination.
[minor] · PayToAnchor destinations cannot be serialized
A P2A output in a wallet transaction, including one created by a third party, makes WalletTx IPC calls fail while the transaction remains in the wallet.
Location: src/ipc/capnp/wallet.cpp:113 (head).
Details and suggested fix
PayToAnchor is its own CTxDestination alternative, so std::get_if<WitnessUnknown> does not match it and the builder throws std::logic_error.
ExtractDestination returns PayToAnchor for anchor outputs, and MakeWalletTx extracts the destination of every output. A wallet transaction with a P2A output, such as a third-party payment with an anchor, can therefore no longer be returned by getWalletTxs, getWalletTx or getWalletTxDetails while it stays in the wallet. Other calls that carry a PayToAnchor destination fail the same way.
Add a PayToAnchor case. Either give it a dedicated field, or encode it as witnessUnknown and map it back to PayToAnchor on read when the version and program match, so destination comparisons keep working.
[minor] · Restoring a wallet without loading it trips the Result reader assertion
The GUI's restore-and-migrate action aborts the process decoding the reply instead of continuing to migration.
Location: src/ipc/capnp/common-types.h:370 (head).
Details and suggested fix
MigrateWalletActivity::restore_and_migrate calls restoreWallet(..., /*load_after_restore=*/false, ...). RestoreWallet only loads the wallet when that flag is set, so WalletLoaderImpl::restoreWallet returns a successful util::Result holding a null unique_ptr<Wallet>.
The util::Result builder passes the null pointer to the interface builder, which sets nothing. The reader then reaches assert(result.hasValue()); assertions are always enabled. bitcoin-node forwards the GUI's WalletLoader calls to the spawned bitcoin-wallet, so bitcoin-node decodes this reply and aborts. The backup has already been copied into the wallet directory, but migration never starts.
Have the reader construct an empty value when the field is unset and the value type is nullable. Add IPC test coverage for restoreWallet with load_after_restore=false.
[minor] · IPC trace logging can write wallet passphrases to debug.log
With IPC trace logging enabled, forwarded wallet RPC parameters and GUI passphrase arguments are logged, unlike in the regular RPC server.
Location: src/ipc/capnp/chain.capnp:143 (head).
Details and suggested fix
Wallet RPCs served by the spawned wallet process are invoked through ActorCallback.call. That call carries the whole JSONRPCRequest, including params as JSON text.
libmultiprocess logs request.toString() on the client side and params.toString() on the server side at Log::Trace. Bitcoin Core enables that level when IPC trace logging is requested (-debug=ipc with -loglevel=ipc:trace). A walletpassphrase, encryptwallet or walletpassphrasechange call can therefore put the passphrase in debug.log. The GUI's Wallet.unlock, encryptWallet and changeWalletPassphrase passphrase fields go through the same logging. LogEscape truncates to the configured max_chars, so whether a given secret appears depends on field order and length.
Skip or redact payload logging for secret-bearing methods, and add a test that passphrases never appear in IPC trace output.
[minor] · Wallet RPCs registered over IPC lose their OpenRPC metadata
In multiprocess mode, getopenrpcinfo and rpc.discover omit every wallet method, even though those methods remain callable.
Location: src/ipc/capnp/chain.cpp:185 (head).
Details and suggested fix
WalletLoaderImpl::registerRpcs copies metadata_fn into each forwarded command. However, the RPCCommand schema has no metadata field, and the server-side handleRpc rebuilds the command with the five-argument constructor, leaving metadata_fn null. CRPCTable::buildOpenRPCDoc skips commands whose metadata_fn is null. When bitcoin-node spawns bitcoin-wallet, both discovery documents therefore omit every wallet method, leaving clients that generate bindings from them with an incomplete API.
metadata_fn is a function pointer and cannot cross the process boundary. Carry serialized RPCMethod metadata, or a callback that produces it, and have discovery use it. A multiprocess test that checks for a wallet method in getopenrpcinfo would catch this.
[minor] · Spawn-only Init methods can reinitialize a running node through -ipcbind
Calling makeWalletLoader on a running bitcoin-node replaces global chain parameters and reruns logging setup, widening what socket clients can do but not who can connect.
Location: src/ipc/capnp/init.capnp:37 (head).
Details and suggested fix
-ipcbind serves the node's Init object, which exposes makeNode, makeUnstableChain and makeWalletLoader. makeWalletLoader takes GlobalArgs, and CustomPassField runs ReadGlobalArgs before the method body. This happens even though BitcoinNodeInit does not override makeWalletLoader, so the call itself returns null.
On a running node, ReadGlobalArgs overwrites the gArgs settings, calls SelectParams (replacing globalChainParams while ChainstateManager options still hold a reference to the old object), and reruns init_process (InitLogging, InitParameterInteraction).
The socket already grants unauthenticated RPC access, so this is not privilege escalation. A buggy or misconfigured client can still corrupt or crash the node in ways RPC cannot.
Decide which Init methods a running node serves to socket clients. At minimum, make ReadGlobalArgs and init_process refuse to run on a non-parent connection or after initialization.
[minor] · SecureString and CKey copies in IPC buffers are never cleansed
Passphrases and private keys sent over IPC remain in ordinary, unlocked heap buffers, bypassing SecureString's cleanse-on-free guarantee.
Location: src/ipc/capnp/common-types.h:197 (head).
Details and suggested fix
The SecureString builder copies the passphrase into Cap'n Proto message storage, and the reader copies it back out. Both comments make memory_cleanse the caller's responsibility, but nothing under src/ipc calls it. The CKey builder used by addHDKey copies the secret the same way.
The request and response buffers for encryptWallet, unlock and changeWalletPassphrase are therefore freed without being wiped. This occurs in the GUI, in bitcoin-node (which forwards these calls), and in bitcoin-wallet, where the buffers can end up in swap, core dumps or reused heap. Exploiting this requires access to process memory, swap or core dumps.
Cleanse the request and response segments of secret-bearing methods once consumed, including on error paths. Otherwise, document that multiprocess mode does not provide this guarantee.
[minor] · CoinControl lock time, version and weight limit revert to defaults over IPC
The builder omits the presence fields checked by the reader, so these values revert to defaults; no current IPC caller was identified that sets them.
Location: src/ipc/capnp/wallet.cpp:198 (head).
Details and suggested fix
The builder writes lockTime, version and maxTxWeight but never calls setHasLockTime, setHasVersion or setHasMaxTxWeight. The reader applies each value only when its corresponding has* field is nonzero. The wallet process therefore always sees m_locktime unset, m_version at DEFAULT_WALLET_TX_VERSION and no weight cap. A caller that requests a TRUC (version 3) transaction, a specific lock time or a weight limit gets a transaction built without that setting.
No current caller sending these values over IPC was identified: the GUI sets none of them, and wallet RPCs run inside the wallet process. The behavior change is established, but its production impact is unconfirmed.
Set each presence field when writing its value, and include these fields in the CCoinControl round-trip test.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: Clarify whether IPC should override the wallet-tool opt-out
- [suggestion]: Update the usage guide’s future-tense process-splitting description
- [minor]: Keep subtree mismatches failing lint
- [minor]: An omitted address-book purpose is read as RECEIVE (earlier report)