Skip to content

Bind qbit-qt P2MR proof verification to an expected signer #77

Closed

Description

@kiwidream

Summary

On P2MR-only chains, qbit-qt's Verify Proof flow hides the verifier address field and obtains the signer exclusively from the proof JSON's address field.

Text and hash modes independently bind the entered data to message_hash, but they do not bind verification to the signer the user intended to authenticate. Consequently, a valid proof produced by any P2MR key for the same data receives a green success state.

The success message displays the proof's embedded address, which lets a careful user compare it manually. This is therefore an expected-identity binding problem, not a cryptographic false acceptance: the proof was genuinely signed by the address shown.

This behavior is present on both main and 0.1.x and was introduced with #63.

Impact

A user who interprets the green result as "the expected party signed this data" can be misled by a substituted proof signed with another valid P2MR key.

An attacker can sign the same visible text with their own key and supply that proof. qbit-qt verifies the internally consistent signature and shows green success without accepting or enforcing the expected signer address.

Steps to reproduce

  1. Create two independent P2MR wallets or addresses: one for the expected signer and one for another signer.
  2. Sign the same visible text using the other signer's P2MR key and export the proof JSON.
  3. Open qbit-qt Sign/Verify -> Verify Proof in Text + proof mode.
  4. Enter the text and paste the other signer's valid proof.
  5. Observe that there is no expected-signer field.
  6. Click Verify Proof.
  7. Observe a green result for the address embedded in the supplied proof.
  8. Repeat in Proof only mode and observe the same green state without any externally supplied data or identity.

Relevant code

In src/qt/signverifymessagedialog.cpp:

  • updateP2MRDataModeUi() hides addressIn_VM and its address-book button in P2MR mode.
  • ParseP2MRProofJson() derives proof.output from the untrusted proof's address field.
  • on_verifyMessageButton_VM_clicked() optionally compares the entered message hash, but never compares an externally supplied expected signer with proof.output.
  • Any internally valid proof receives the green success style.

The Qt wallet test in src/qt/test/wallettests.cpp currently asserts that the verifier address control is hidden.

Desired behavior

  • Show an Expected signer address field in P2MR verification mode.
  • Validate that address for the active network and require an exact match with the signer embedded in the proof before presenting an authenticated green result.
  • Reject a valid proof from a different signer with a clear red mismatch error.
  • When no expected signer is supplied, report only that the proof is cryptographically valid for its embedded signer, using a neutral state rather than an authenticated green state.
  • Treat proof-only verification as neutral because neither the data nor signer came from an independent source.
  • Always display the embedded signer address and signed message hash.

Suggested tests

Add Qt click-path coverage for:

  • correct expected signer and matching text;
  • a different valid signer;
  • an expected address for the wrong network;
  • mismatched text or message hash;
  • valid proof with no expected signer;
  • proof-only mode;
  • continued display of the embedded signer and message hash.

These changes should affect only qbit-qt's presentation and expected-identity binding; the shared P2MR proof verifier and RPC verification semantics do not need to change.

Activity

  1. added
    bug
    on Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions