ReceiptVerifier::verify() only checked the Ed25519 signature over receipt_hash -- it never bound that hash to the amount_micros/operation/ operation_hash/sequence fields traveling unsigned alongside it in PaymentEvidence. check_settlement_evidence only cross-checks those fields against each other and the passport owner, never against independent ground truth. Since POST /v1/passports/:id/attest lets any passport owner submit evidence for a generation executed outside Identity Lock, and check_settlement_evidence trivially passes when payer_account == owner, an owner could take ANY genuine (receipt_hash, signature) pair from their own real, unrelated, arbitrarily small Mint settlement and replay it verbatim alongside a forged amount_micros describing a much larger payment -- written permanently into a GenerationRecord exposed via the "C2PA-aligned" public manifest endpoints. Same vulnerability class independently found and fixed in Ledgerline (531fabbc) the same day, but that fix's "redefine what the signature covers" approach does not apply here: Ledgerline had zero live producers signing its old contract, so redefining it was safe; Mint's receipt signature here is genuinely live (Ed25519 over the bare chain hash, mint-receipts::ReceiptBody::compute_hash), so redefining it would reject every real Mint receipt. Full ReceiptBody recompute is also not possible from PaymentEvidence's narrower wire fields (missing account_id/from/to/ balance_after_held_micros/ts/signer). Fixed by requiring and verifying Mint's own TransferAttestation/ HoldSettlementAttestation (mint-server::attestation) -- built exactly for this purpose, already returned in the JSON body of POST /v1/transfers and POST /v1/holds/:id/capture (data.attestation), so any legitimate external caller who settled payment directly against Mint already has it. Its signature binds amount_micros/operation/operation_hash/sequence/ receipt_hash together under one digest, so a genuine attestation for one claim can never be replayed onto a different one. Added SettlementAttestationProof to PaymentEvidence (passport-core) and ReceiptVerifier::verify_bound (passport-server/receipts.rs), which reimplements Mint's exact digest/domain-separation bytes with no mint-server dependency (mirrors how ledgerline::receipt_verify stays dependency-free too), then cross-checks the attested claims equal the submitted receipt. attest() now calls verify_bound instead of the unbound verify. generate() keeps calling plain verify unchanged: Relay's /v1/passport/generate transports only the legacy AITP-Receipt header today, not an attestation, and that path stays lower-risk while its evidence originates from the in-process RelayConditioningSink seam rather than an external caller. Added 6 unit tests (receipts.rs) and 1 integration test (tests/api.rs) proving a genuine receipt_hash+signature+attestation replayed onto a forged amount_micros is now rejected, plus updated 3 existing attest fixtures to include a valid attestation. cargo test --workspace: 65/65 passing (was 59/59 before these additions), including the live-Postgres integration test. cargo clippy --all-targets: zero new warnings in any changed file (one pre-existing too_many_arguments on attest() predates this change, confirmed via git stash on clean main). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
47 lines
1.5 KiB
TOML
47 lines
1.5 KiB
TOML
[package]
|
|
name = "passport-server"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "Identity Lock axum API + service: create/edit/lock/version and receipted Relay generation provenance."
|
|
|
|
[[bin]]
|
|
name = "identity-lock-server"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
passport-core = { workspace = true }
|
|
passport-resolve = { workspace = true }
|
|
passport-provenance = { workspace = true }
|
|
passport-store = { workspace = true }
|
|
passport-store-postgres = { workspace = true }
|
|
passport-relay-client = { workspace = true }
|
|
passport-mint-client = { workspace = true }
|
|
|
|
async-trait = { workspace = true }
|
|
axum = { workspace = true }
|
|
tower-http = { workspace = true }
|
|
subtle = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
chrono = { workspace = true }
|
|
tokio = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
# Mint receipt signature verification (Ed25519 over the receipt hash) and key
|
|
# discovery from the live Mint.
|
|
ed25519-dalek = "2"
|
|
hex = { workspace = true }
|
|
reqwest = { workspace = true }
|
|
# Attestation-digest verification (`receipts::ReceiptVerifier::verify_bound`),
|
|
# mirroring mint-server's `attestation::{attestation_digest,
|
|
# hold_attestation_digest}` byte-for-byte so Mint's signed
|
|
# `payload_base64url` verifies here without depending on mint-server.
|
|
sha2 = { workspace = true }
|
|
base64 = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
passport-testkit = { workspace = true }
|
|
tower = { workspace = true }
|