dogfood: fix(cloudflare): refuse a call whose `dpop` differs from the Durable Object's #1202
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 373 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.354
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1202"
general
weight: 0.35
claude[bot]
Fixed
Sessions.durableObjectto throwAccounts.RequestErrorwithinvalid_dpop_proofwhen the instance'sdpopdiffers from thedpopof theconfigofDurableObject.sessions, or whenconfigholds none.Problem
The object signs each token request with the DPoP key of its own
config, since noCryptoKeycrosses RPC (DataCloneError). A Worker that setdpoponly onAccounts.create, as Bind DPoP keys shows, thus received Bearer tokens without an error. With another key in each place, the tokens were bound to the key of the object.Each call now names the thumbprint of the instance's DPoP key as
jkt, and the object compares it with the thumbprint of itsconfig. A Worker withoutdpop, and a Worker of an earlier release, send nojkt, so the object keeps its behavior for them. The object checks only the calls that issue or use tokens (start,complete,get,headers,issue,save,take).end,discard,endSid, and the index calls sign no proof, so a misconfigured Worker still revokes and deletes the sessions that it holds.API changes
backend.Sessions.Adapter.Optionsholds the instance'sdpop, so an adapter that signs in another process can check it.How to test
pnpm test src/cloudflare/Sessions.test.tsruns the instance'sstartin Miniflare with four pairs of keys. Onmain, all four returned/oauth2/authorize. With the fix, the first two (no key inconfig, another key inconfig) throwinvalid_dpop_proof, and the same key, or a key only inconfig, still starts the sign-in. A second test ends a session from an instance with another key: it threwinvalid_dpop_proofbefore this revision, and ends now.Validation:
pnpm check:types,pnpm check,pnpm test(1720 passed), and thetest/client/cloudflare/DurableObject.test.tsandtest/client/plugins/backend.test.tssuites of Tempo ID against this branch (40 passed).Numbers: no added request, RPC call, or round. Each call carries one thumbprint of 43 characters, and the object computes its own once.
curious-dog-key: durable-object-sessions-ignore-instance-dpop