Skip to content

PayPro: Fix - verify every output against the signed invoice - #4236

Open
gabrielbazan7 wants to merge 1 commit into
bitpay:masterfrom
gabrielbazan7:fix/paypro-verify-all-outputs
Open

PayPro: Fix - verify every output against the signed invoice#4236
gabrielbazan7 wants to merge 1 commit into
bitpay:masterfrom
gabrielbazan7:fix/paypro-verify-all-outputs

Conversation

@gabrielbazan7

Copy link
Copy Markdown
Contributor

Description

Fixes RN-2876 by verifying every PayPro output against the signed invoice.

Changelog

  • Validate output count, addresses, amounts, and chain-specific fields.
  • Add regression tests.

Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It changes security-critical PayPro validation behavior across multiple chains and should receive final human review to confirm protocol/edge-case compatibility.

Pull request overview

This PR hardens PayPro transaction proposal verification in bitcore-wallet-client by validating that every output (and chain-specific fields) matches the signed PayPro invoice, closing a gap where a copayer/server could potentially slip unauthorized outputs into a proposal while still passing verification.

Changes:

  • Update Verifier.checkPaypro to validate output count, per-output address + amount equality, and additional chain-specific bindings (EVM calldata, XRP destinationTag/invoiceID, SOL memo).
  • Add regression tests covering UTXO multi-output matching, BCH encoding equivalence, EVM single/multi-step instructions, XRP bindings, and SOL memo binding.
File summaries
File Description
packages/bitcore-wallet-client/src/lib/verifier.ts Reworks PayPro verification to compare all expected outputs and enforce chain-specific invariants (EVM/XRP/SOL).
packages/bitcore-wallet-client/test/verifier.test.ts Adds a targeted checkPaypro test suite to prevent regressions across UTXO/EVM/XRP/SOL cases.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants