[Bug]: Merchant sample verifies checkout using embedded JWT without independent checkout-hash context
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 56/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 3.2k
- Forks
- 514
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google-agentic-commerce/AP2
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
google-agentic-commerce/AP2#388 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
google-agentic-commerce/AP2#374 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
google-agentic-commerce/AP2#320 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
google-agentic-commerce/AP2#294 · 1 comentario ·
-
[Feat]: Revocation path for open Mandates — rescinding standing agent authority bound to a cnf keyAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
google-agentic-commerce/AP2#386 ·
Todos los issues de google-agentic-commerce/AP2
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
sylvainmetayer/homelab#851 ·
Los mantenedores suelen responder en 1 día
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Add `ty-pre-commit` hookAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
kubeflow/docs-agent#279 ·
Los mantenedores suelen responder en 3 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Qiskit/qiskit-ibm-runtime#3523 ·
Los mantenedores suelen responder en 1 día