You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(signing): align brand-authz with ADCP #3690 security profile
Stage 4 spec research surfaced two conformance gaps in the just-landed
brand_authz code. Both are fix-now-before-review issues, not stage-4
scope; landing on this PR keeps the security-relevant deltas in one
review pass instead of shipping a known-divergent impl behind a
"spec-conformant" label.
1. **PSL PRIVATE section must be in scope** (security)
Per security.mdx §"Origin binding": "ICANN+PRIVATE sections both in
scope so platforms like vercel.app, pages.dev, github.io are treated
as suffixes". Without include_psl_private_domains=True, an attacker's
``attacker.vercel.app`` and a victim's ``victim.vercel.app`` would
share an eTLD+1 of ``vercel.app`` — and the attacker's deployment
would falsely satisfy the binding check against the victim's
vercel-hosted brand.json.
Fix: enable include_psl_private_domains on the singleton extractor.
Regression test covers vercel.app / pages.dev / github.io.
2. **agents[] match must be byte-equal, not canonicalized**
Per security.mdx §"Discovering an agent's signing keys": "Find the
entry in agents[] whose url byte-equals A (no canonicalization at
this step — the most common failure mode is a trailing-slash or
scheme mismatch)." Canonicalizing silently authorizes URLs that
drift from the operator's declaration.
Also per spec: multiple matches → ``request_signature_brand_json_ambiguous``.
Schema does not constrain agents[] to be unique-by-URL, so dupes
from operator misconfig must fail closed rather than silently picking
the first match.
Fix: _find_listed_agent → _find_listed_agents (plural, returns full
match list). Byte-equal comparison. New ``agent_ambiguous`` reason
on the BrandAuthorizationReason taxonomy (maps to the spec's
``request_signature_brand_json_ambiguous`` at the framework
boundary in stage 5). New tests cover trailing-slash mismatch,
case mismatch, and duplicate entries.
Removes the now-unused _canonicalize_agent_url helper and its imports.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments