WIP: qml: Hand payment URIs to the running instance

bitcoin-core/gui-qml: PR #988

4 minor findings

Findings

Link

[minor] · Payment URI hand-off trusts a predictable shared-temp endpoint

On Linux using a shared temporary directory, another local account that pre-binds the predictable endpoint can read and discard handed-off payment URIs; this platform-specific attack was not exercised.

Location: qml/paymenturiserver.cpp:62 (head).

Details and suggested fix

ServerName() returns a bare name derived from the network data-directory path, which the Unix fixtures resolve under QDir::tempPath(). With shared /tmp, another local account can predict the name and bind it before the legitimate receiver. SendRequests() writes the complete batch without authenticating the peer and accepts one Queued byte as delivery. The impostor can therefore read addresses, amounts, labels and messages, then acknowledge requests that never reach the application. An inaccessible pre-created socket instead makes URI launches fail through the Failed branch. Both hand-off paths send before attempting the directory lock, and UserAccessOption protects only sockets this application creates. The pinned widgets PaymentServer has a similar limitation, but this introduces it into the QML path. Use a full endpoint path inside a verified per-user private directory, respecting the Unix socket path-length limit. This concerns request privacy and delivery, not funds or keys; Windows and macOS behavior is not established here.


Link

[minor] · Later payment links give no notice after backing out of wallet opening

After choosing Open wallet or Create wallet and backing out without loading one, later handed-off links only raise the window; their requests remain queued without another notice.

Location: qml/pages/MainWindow.qml:106 (head).

Details and suggested fix

The actions close the no-wallet notice without completing its request, leaving paymentUriAnnounced true. Returning from wallet creation retries delivery, but announcePendingPaymentUri() immediately returns. Later IPC batches append to the nonempty queue without emitting pendingRequestChanged, and requestsReceived only activates the window, so those arrivals cannot restore the notice either. Loading a wallet still delivers the requests. Add a queue-growth notification that clears the announcement flag and schedules delivery when a new batch arrives.


Link

[minor] · Incoming requests interrupt password entry and manual URI import

An IPC request can interrupt password or URI entry and change the draft used by the password continuation; the final transaction review still requires confirmation before sending.

Location: qml/pages/wallet/SendCreate.qml:145 (head).

Details and suggested fix

canAcceptPaymentRequest() does not check reviewPassphrasePopup.visible or sendUriImportPopup.visible, so an arriving request can open its focus-taking review while either dialog owns the form. For a locked wallet, applying that request and then submitting the password calls prepareTransactionWithPassphrase(), which rebuilds from the changed recipients rather than the draft that initiated Review. With the manual importer, its later Apply can overwrite the request just accepted. Hold incoming requests while either dialog is visible, and emit paymentRequestAcceptable() from their close handlers so queued delivery resumes. Add routing tests for both arrival states.


Link

[minor] · Wire limits abort startup even when no receiver exists

Source inspection shows that 65 short command-line URIs abort startup before checking for a receiver, even with no instance running; no current desktop handler producing such batches was found.

Location: qml/paymenturiserver.cpp:135 (head).

Details and suggested fix

ParsePaymentUriArgs() accepts the batch, but SendRequests() first calls EncodeRequest(), which rejects more than 64 URIs, individual URIs over 128 KiB, or batches over 2 MiB. It returns Failed before connecting, and PaymentUriHandOffExitCode() turns that into an initialization error and failure exit, bypassing local delivery. The error incorrectly refers to a running instance even when none exists. Check for a receiver before applying the wire limits, allowing the no-receiver path to continue with the locally queued requests.


Coverage details