Skip to content

fix(compliance): give request-signing vectors bodies a seller can parse - #7583

Merged
bokelley merged 1 commit into
adcontextprotocol:mainfrom
KonstantinMirin:fix/request-signing-vector-bodies
Sep 18, 2026
Merged

bokelley merged 1 commit into
adcontextprotocol:mainfrom
KonstantinMirin:fix/request-signing-vector-bodies

Conversation

@KonstantinMirin

Copy link
Copy Markdown
Collaborator

Fixes the fixture half of #7567. Corrects request.body in 35 request-signing vectors and nothing else.

The problem

Every request-signing vector ships a stub body — {"plan_id":"plan_001"} for create_media_buy, similar for the other two operations. create-media-buy-request.json requires idempotency_key, account, brand, start_time and end_time; plan_id is not among them.

A seller that validates the payload before it authenticates the caller answers that stub with INVALID_REQUEST, and the RFC 9421 checklist never runs. The vector grades the schema validator instead of the verifier.

Measured against a seller whose verifier is independently known good — its own enforcement suite passes, and it returns 401 with WWW-Authenticate: Signature error="request_signature_required" on a real payload — every graded signed_requests check failed, each one with got 200 (error="(none)"). That is a JSON-RPC INVALID_REQUEST inside an HTTP 200, which the runner records as the agent having accepted an unsigned request.

With the bodies corrected and nothing else changed:

before after
signed_requests failures, mcp 27 4
whole card, mcp 35 passed / 48 failed 58 passed / 25 failed

With the runner-side fixes described at the end applied — neither of them in this PR — the same card reads 59 passed and zero signed_requests failures, on both the mcp and the a2a card, with identical failure sets.

Those runs used all 37 correctable bodies. This PR ships 35 of them; the two held back are named below.

What this changes

request.body, and nothing else. Not a header, not a URL, not a verifier_capability, not an expected_outcome. 35 files, one line each, under static/compliance/source/. dist/compliance/3.1.1/ is a published immutable artifact, so the correction reaches consumers on the next compliance release rather than in this diff.

Each new body validates against the request schema for the operation the vector's URL already names — its final path segment, which is what extractOperationFromVectorUrl in @adcp/sdk's testing/storyboard/request-signing/builder.mjs turns into params.name of the tools/call envelope. So negative/011 gets a sync_creatives body, negative/027 an update_media_buy one, and the other 33 create_media_buy.

The faults the vectors exist to test are preserved

The fair first question is whether a body rewrite quietly repaired the faults being graded. None of them live in the body:

vector the fault after this PR
002-wrong-tag tag="example-org/signing/v1" header untouched
005-alg-not-allowed alg="rsa-pss-sha512" header untouched
010-content-digest-mismatch Content-Digest of 32 zero bytes, which is not the body's hash not recomputed — still 32 zero bytes
015-signature-invalid Signature of 86 As not re-signed
017 / 020 placeholder signature as the step-ordering canary headers untouched
023-multi-valued-content-digest duplicate RFC 9530 algorithm header untouched
007 / 018 covers_content_digest required / forbidden verifier_capability untouched

Three checks behind that table, all runnable against this branch:

  1. Only the body moved. For each changed file: parse the before and after objects, substitute the new body into the before object, compare. Equal for 35/35.
  2. The bodies are valid, and the ones they replace were not. Validating each body against the schema for its URL's operation: 35/35 corrected bodies valid, 35/35 stubs invalid.
  3. No shipped signature changed verdict. Ten changed vectors carry both a real Signature and an expected_signature_base. Verified against keys.json before and after: nine verified before and still verify, and negative/015 did not verify before and still does not, which is its point. Zero verdicts moved.

(3) holds because no signature in the changed set covers a body-derived component except negative/010's, and 010 covers the deliberately false digest rather than the body. The runner reaches the same place from both directions: re-signing mutations sign the request they are about to send, after stripSignatureHeaders has dropped the fixture's Signature, Signature-Input and Content-Digest; passthrough mutations (021–027) ship the fixture bytes and are graded before any byte of the body is read.

010 is the one row where a body edit could have repaired the fault, and it is also the clearest evidence the correction does what it should. Its builder injects the zero digest programmatically — Buffer.alloc(32) in headersWithBadDigest — rather than reading it from the fixture, so the falsification survives a body change by construction. On the wire 010 now returns request_signature_digest_mismatch at step 11, a check reachable only by passing step 10. The fault both survived and moved to where it belongs.

Two vectors held back

positive/002-post-with-content-digest and negative/018-digest-covered-when-forbidden are the only vectors whose Content-Digest is a truthful hash of the current body. Correcting their bodies means recomputing that digest, and for 002 also rebuilding expected_signature_base and re-signing with the test-ed25519-2026 private key, which lives in .context/generate-test-vectors.mjs and not in this repo. tests/request-signing-body-integrity.test.cjs verifies 002 cryptographically, so a body-only edit there turns that test red.

#7567 proposed recomputing truthful digests; this is where I stopped short of it, because a body patch should not touch signing material. Both vectors stay exactly as they are and would need a regeneration pass from someone holding the vector key. 018 in particular is capability-gated rather than body-broken — it belongs to the 007/018 item at the end of this description, not to this patch.

Three more are untouched for their own reasons:

  • negative/028 — its body is a JSON-RPC tasks/cancel envelope, which is what puts it in the protocol-method namespace.
  • positive/007 (get_media_buy with a query string) and positive/008 (/adcp/resource/%e2%98%83/item) — their URLs name no operation this correction covers.

Determinism, and one question for maintainers

start_time / end_time are fixed literals (2027-01-04 … 2027-02-01) rather than now-relative, so the corpus reproduces from its own bytes.

A seller that refuses a flight starting in the past will, after 2027-01-04, answer these bodies on a business rule rather than on the signature. That does not change what any vector grades — grading is on the HTTP status and the WWW-Authenticate code, and an MCP seller returns a business rejection inside an HTTP 200 exactly as it returns a success — but a published corpus probably wants a convention here (a relative offset, or a per-release bump) rather than a literal. Happy to follow whatever you prefer.

Every name in the payloads is reserved or yours

No value in a corrected body can be registered or dialled by a third party: brand.example, acmeoutdoor.example and pinnacle-agency.example are RFC 2606 §2; the only .com is example.com, RFC 2606 §3; and format_id.agent_url in negative/011 is https://creative.adcontextprotocol.org/, which is the project's own.

idempotency_key is vector-<vector-id>. Two properties matter and neither is the spelling: stable per vector (016 sends its request twice and the two submissions must be byte-identical), and distinct across vectors (a reused key can be served from a seller's at-most-once cache). Rename freely as long as both hold. Both values travel in the signed body, so changing them changes the Content-Digest and re-signs every re-signed vector over different bytes — the numbers above were re-measured after that change rather than assumed.

Checks run on this branch

test:transport-errors (which includes the body-integrity vector suite), test:functional-request-signing-contract, test:compliance-source-authority, test:compliance-packaged-refs, test:substitution-vector-names, test:error-codes, test:doc-compliance-drift, and test:compliance-snippets (which runs build:compliance --check) — all pass.

The companion runner-side item

Not a fixture problem and not in this PR, but it is what stands between the 58-passed column and the 59-passed/zero-failures run above.

negative/007 and negative/018 demand opposite values of covers_content_digest, which is a single scalar on an agent's request_signing capability, so at most one of them can apply to any agent. capabilityMismatch in grader.mjs would skip the inapplicable one, but the storyboard path never passes agentCapability, so both are sent and one always FAILS. Happy to file that as its own issue if useful.

(The other item that run needed — negative/025-jwk-alg-crv-mismatch graded in-library by gradeJwksOverrideNegative, which returns http_status: 0 while synthesizeNegativeStep validates http_status == 401 — was found independently and is already fixed upstream in adcontextprotocol/adcp-client#2955 / adcontextprotocol/adcp-client#2958.)

Related: #7567, #7577.

Every request-signing vector shipped a stub body ({"plan_id":"plan_001"})
that is invalid for the operation its URL names, so a seller that validates
the payload before authenticating the caller answers INVALID_REQUEST and the
RFC 9421 checklist never runs.

Replaces request.body, and nothing else, in 35 vectors. Headers, URLs,
verifier_capability and expected_outcome are byte-identical; every shipped
signature that verified before still verifies.

Refs adcontextprotocol#7567

@aao-secretariat aao-secretariat Bot 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.

Ladon verdict: Approve

Approve — tightly-scoped compliance fixture correction with a correct changeset.

What I checked:

  • 35 request-signing test-vector request.body payloads made schema-valid for the operation each URL names; reviewer confirmed only request.body changed (headers/URLs/verifier_capability/expected_outcome untouched).
  • Fault preservation verified for the tricky cases: negative/010 digest-mismatch (real signature over unchanged zero-digest header; step 10 verifies, step 11 mismatches) and negative/023 step-1 multi-valued fault remain intact.
  • New bodies validate against schema (budget:number, package required fields, 027 scheme→schemes + 32+char credential per push-notification-config.json).
  • Changeset present and correctly typed patch: no wire-shape change, editing source fixtures under static/compliance/source/** (not immutable dist/** artifacts), so release-immutability is not implicated.

Gate checks:

  • No critical/high/medium findings (row 1 N/A).
  • gated_paths: false — row 2 does not apply despite review_decision: REVIEW_REQUIRED.
  • high_risk: false, no deleted/modified high-risk entries (rows 3–5 N/A).
  • No prior decision (row 6 N/A). No no-auto-approve team match (row 7 N/A). Zero medium findings (row 8 N/A).

Falls through to row 9 → approve. The author's open question about fixed 2027 start/end literals is a WG convention matter, not a defect.

@bokelley
bokelley merged commit 1fdb7fc into adcontextprotocol:main Sep 18, 2026
49 checks passed
sujanchalla0510 pushed a commit to sujanchalla0510/adcp that referenced this pull request Oct 18, 2026
…main

Merge the published v3.1.29 maintenance release (tag v3.1.29,
f082c7a, the adcontextprotocol#8247 Version Packages
merge on 3.1.x) into main as a record-only merge. v3.1.29 descends from
v3.1.28 (f4d53b8, adcontextprotocol#8069), so both releases' records come in.

The merge keeps main's tree (ours strategy) and adds only:

- dist/schemas/3.1.28/, dist/schemas/3.1.29/, dist/compliance/3.1.28/,
  dist/compliance/3.1.29/ and the signed dist/protocol/3.1.28.tgz* and
  3.1.29.tgz* tuples, byte-identical to the tag.
- CHANGELOG.md: the 3.1.29 and 3.1.28 blocks, verbatim from the tag,
  above main's 3.1.27 block.
- dist/schemas/index.json: regenerated by build:schemas; v3.1 and
  latest_by_minor 3.1 now 3.1.29. latest.json is unchanged (3.2.5).

The 3.1.27..3.1.29 source changes (adcontextprotocol#7907, adcontextprotocol#8020, adcontextprotocol#8234, adcontextprotocol#8237, adcontextprotocol#8245)
are 3.1-line adaptations of fixes main already carries in its own form
(adcontextprotocol#7580, adcontextprotocol#7583, adcontextprotocol#7617, adcontextprotocol#8235; main's root request-signing vectors are
already unpadded base64url), so no 3.1.x source, tests or tooling are
taken. The second parent records that reconciliation so the next 3.1.x
forward merge starts from v3.1.29.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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