demo/script.md · beat 6

Resolved: replay-no-key.sh

One line in the demo script calls a script. It didn’t exist. Now it does, and it’s been run live against a real mandate and a real PDS.

Beat 6 is called “Stolen token is useless.” It shows an attacker with a copied JWT, but no private key, failing to call the bank’s tool.

Written and live-verified 2026-10-02 (poc-code/demo/replay-no-key.sh + replay-no-key.mjs). Real mandate minted by a real running platform stub, real PDS running the isolated /mcp/** filter — the script returned exactly 403 pop_key_mismatch.

step 1 DPoP header? step 7 proof signature valid? step 8 key thumbprint matches? step 19 tool allowed → ALLOW real Outil Local · real agent key 200 balance returned stolen token · no DPoP header 401 missing_dpop stolen token · forged DPoP, attacker's own key 403 pop_key_mismatch reproduced live ✓
All three requests hit the same 19-step check. The real client clears every step. A bare stolen token dies at step 1. A forged DPoP proof — built with the attacker’s own throwaway key — clears step 1 and step 7, then dies at step 8, the thumbprint match. That third row is the point of beat 6, and replay-no-key.sh now reproduces it on demand.
AttemptHeader? (1)Sig valid? (7)Thumbprint? (8)Result
Real Outil Local, real keyyesyesyes200
Stolen token, no headerno——401 missing_dpop
Stolen token, forged proof (own key)yesyesno403 pop_key_mismatch
resolved 2026-10-02

What the script does

A bare missing header only proves step 1. To land on step 8 — the one that makes the demo’s point — the script builds a real, validly-signed DPoP proof with a key that isn’t the real agent’s.

1. generate a throwaway Ed25519 keypair (jose)
2. build a DPoP proof JWT, signed with THAT key:
     header: { typ: "dpop+jwt", alg: "EdDSA", jwk: <throwaway pubkey> }
     payload: { htm: "POST", htu: "<canonical mcp uri>",
                iat, jti, bsha: sha256(body) }
3. POST to /mcp with:
     Authorization: DPoP <stolen AGENT_DELEGATION_TOKEN>
     DPoP: <the forged proof from step 2>
4. expect back: 403 pop_key_mismatch

Every field above was already pinned in contracts.md §2 — nothing to design, only to write.

Built

poc-code/demo/replay-no-key.sh + replay-no-key.mjs, self-contained (own package.json, npm install on first run), reusing the same jose library pattern already in the stub and the Outil Local’s dpop.ts.

Verified

Not just unit-reasoned: a real platform stub + real PDS were booted, a real mandate minted end to end, and the script run against it — 403 pop_key_mismatch, exactly as designed.