Skip to content

fix: Bind request status queries to the signed message in send; release 0.5.9 - #292

Open
lwshang wants to merge 3 commits into
masterfrom
fix/bind-request-status
Open

lwshang wants to merge 3 commits into
masterfrom
fix/bind-request-status

Conversation

@lwshang

@lwshang lwshang commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

A signed message file pairs each signed ingress with a separately signed request status query. The JSON wrapper is not signed, and quill send polled whatever request_status accompanied the ingress without checking that it belongs to it. Pairing a message with the genuine status query of another message signed by the same key (within the expiry window) made send display the other request's outcome, e.g. a successful transfer's block index for a transfer that actually failed.

Changes

  • IngressWithRequestId::validate_request_status recomputes the request ID from the signed ingress content and requires all of these to match it:
    • the plaintext ingress.request_id, if present
    • request_status.request_id
    • the request_status/<id> path in the signed read_state envelope
    • request_status.canister_id, which must equal the ingress canister
  • send validates every message in a file (including the existing role/call_type checks) before sending any of them. Errors name the failing message index.
  • Regression tests cover a crossed status query, a relabeled request_id, a canister mismatch and an ingress request_id mismatch. A CLI test checks that send rejects a file with a crossed second message before sending the first.
  • Release 0.5.9.

The existing output tests pipe real signed bundles (secp256k1 and Ed25519) through send --dry-run, so they also exercise the check on honest files.

🤖 Generated with Claude Code

A signed message file pairs each signed ingress with a separately signed
request status query. The JSON wrapper is not signed, and `send` polled
whatever `request_status` accompanied the ingress. Pairing a message with
the genuine status query of another message signed by the same key made
`send` print the other request's outcome, e.g. a successful transfer's
block index for a transfer that failed.

- Recompute the request ID from the signed ingress content and require
  the plaintext `request_id`s, the read_state path signed in the status
  query, and the status query's canister to match it.
- Check every message in a file before sending any of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The tests do not verify whole-file preflight ordering, leaving a regression unguarded where a valid first transfer could be submitted before a tampered second message is rejected.

1 open issue
What changed in this PR

This PR hardens quill send against mismatched signed message bundles that could make it report another request’s outcome.

Changes:

  • Recomputes the ingress request ID and checks it against the status query’s identifiers, canister, and signed path.
  • Validates every paired message before submitting any, with indexed errors for invalid entries.
  • Adds validation regression tests and documents the security fix.
File Description
src/​lib/​signing.rs Adds request-status binding validation and regression tests.
src/​commands/​send.rs Enforces validation before submission, including whole-batch preflight checks.
CHANGELOG.md Documents the protection against mismatched status queries.

Review effort: Balanced

Comment thread src/commands/send.rs Resolved
lwshang and others added 2 commits November 30, 2026 11:11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lwshang lwshang changed the title fix: Bind request status queries to the signed message in send fix: Bind request status queries to the signed message in send; release 0.5.9 Nov 30, 2026
@lwshang
lwshang marked this pull request as ready for review December 1, 2026 08:12
@lwshang
lwshang requested a review from a team as a code owner December 1, 2026 08:12
Copilot AI balanced review requested due to automatic review settings December 1, 2026 08:12
@zeropath-ai

zeropath-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed 3 of 6 changed files (3 skipped) up to b985bc5.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► src/commands/send.rs
     Check every message before sending and validate request status for tampering
► src/lib/signing.rs
     Add IngressWithRequestId::validate_request_status method implementing tamper checks and validations
► tests (embedded in src/lib/signing.rs) (no separate file changes)
     Add tests for request status validation scenarios
Bug Fix ► src/commands/send.rs
     Invoke validate_request_status before sending each message in batch processing
Refactor ► src/commands/send.rs
     Import Context from anyhow and use in error handling
Other relevant categories ► CHANGELOG.md
     Document version 0.5.9 entry and behavior change

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the request-status binding and bundle-validation changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants