[Bug]: Merchant sample verifies checkout using embedded JWT without independent checkout-hash context
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 56/100
Direzione di ricerca
Read code/sdk/python/ap2/sdk/checkout_mandate_chain.py around lines 44–125 and the merchant sample at code/samples/python/src/roles/merchant_agent_mcp/server.py around lines 872–944. Trace how expected_*_hash is checked during verification and how the sample continues processing decoded JWT data. Review the schema at code/sdk/schemas/ap2/*_mandate.json to understand the hash binding; done means verification binds the closed mandate to an independently expected hash before the sample uses its data.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
Description
AP2 closed Checkout Mandates contain a merchant-signed checkout_jwt and a checkout_hash that binds the mandate to that checkout.
The Python SDK's CheckoutMandateChain.verify() accepts expected_checkout_hash as optional. If it is omitted, the SDK evaluates checkout constraints against the supplied checkout_jwt but does not check the closed mandate's checkout_hash against an independently expected checkout hash.
The Python Merchant MCP sample passes checkout_jwt=chain.closed_mandate.checkout_jwt but does not pass expected_checkout_hash. It then decodes that embedded JWT payload and continues checkout processing.
Impact
A merchant verifier can validate checkout constraints against checkout data carried inside the closed mandate, rather than binding the mandate to an independently created merchant checkout session.
This weakens the protection against manipulated or unrelated checkout data being used to complete an order.
Steps to Reproduce
-
Review
code/sdk/schemas/ap2/checkout_mandate.json:20-28.checkout_jwtis the merchant-signed checkout payload, andcheckout_hashuniquely identifies that JWT. -
Review
code/sdk/python/ap2/sdk/checkout_mandate_chain.py:44-100.expected_checkout_hashis optional andcheckout_hashis checked only when that value is provided. -
Review
code/sdk/python/ap2/sdk/checkout_mandate_chain.py:112-125. The SDK extracts checkout data by decoding the JWT payload. -
Review
code/samples/python/src/roles/merchant_agent_mcp/server.py:872-883. The Merchant sample verifies the checkout mandate usingcheckout_jwtfrom the closed mandate, without passingexpected_checkout_hash. -
Review
code/samples/python/src/roles/merchant_agent_mcp/server.py:900-944. The sample decodes the embedded checkout JWT payload and continues checkout processing from that data.
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
- Lingua principale
- Python
- Stelle
- 3.2k
- Fork
- 514
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google-agentic-commerce/AP2
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
google-agentic-commerce/AP2#388 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
google-agentic-commerce/AP2#374 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
google-agentic-commerce/AP2#320 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
google-agentic-commerce/AP2#294 · 1 commento ·
-
[Feat]: Revocation path for open Mandates — rescinding standing agent authority bound to a cnf keyAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
google-agentic-commerce/AP2#386 ·
Tutte le issue di google-agentic-commerce/AP2
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
pydot/pydot#601 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
letsencrypt/cp-cps#361 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declaresForse già presa @maykonmichel l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
linuxmint/mintupdate#1107 ·