Title: Canonicalization accepts five malformed authority shapes the spec requires be rejected; request_target_uri_malformed unimplemented · Issue #978 · adcontextprotocol/adcp-client-python · GitHub
Open Graph Title: Canonicalization accepts five malformed authority shapes the spec requires be rejected; request_target_uri_malformed unimplemented · Issue #978 · adcontextprotocol/adcp-client-python
X Title: Canonicalization accepts five malformed authority shapes the spec requires be rejected; request_target_uri_malformed unimplemented · Issue #978 · adcontextprotocol/adcp-client-python
Description: Found while vendoring the complete AdCP 3.1.1 request-signing vector set (#975). Reproductions are canonicalization.json cases, currently strict-xfail in tests/conformance/signing/test_canonicalization.py. Problem The spec requires signe...
Open Graph Description: Found while vendoring the complete AdCP 3.1.1 request-signing vector set (#975). Reproductions are canonicalization.json cases, currently strict-xfail in tests/conformance/signing/test_canonicaliza...
X Description: Found while vendoring the complete AdCP 3.1.1 request-signing vector set (#975). Reproductions are canonicalization.json cases, currently strict-xfail in tests/conformance/signing/test_canonicaliza...
Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/978
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Canonicalization accepts five malformed authority shapes the spec requires be rejected; request_target_uri_malformed unimplemented","articleBody":"Found while vendoring the complete AdCP 3.1.1 request-signing vector set (#975). Reproductions are `canonicalization.json` cases, currently strict-xfail in `tests/conformance/signing/test_canonicalization.py`.\n\n## Problem\n\nThe spec requires signers to refuse to sign, and verifiers to reject, URLs whose authority is syntactically malformed:\n\n> If the authority has userinfo but no host (`https://user@/p`), no host at all (`https://:443/p` or `https:///p`), a bracketed host missing a closing bracket (`https://[::1/p`), or a bare IPv6 address outside brackets (`https://fe80::1/p`), the URL is malformed; signers MUST NOT sign it and verifiers MUST reject with `request_target_uri_malformed`.\n> — `security.mdx`, `@target-uri` canonicalization step 3\n\n> **IPv6 zone identifiers (RFC 6874) MUST be rejected.** ... verifiers MUST reject `@target-uri` values containing `%25` inside `[...]` with `request_target_uri_malformed`.\n> — ibid., step 2\n\n`canonicalize_target_uri()` rejects only one of the six shapes. The rest are canonicalized into a well-formed-looking result and signed.\n\n## Failing cases\n\n| case | input | expected | actual |\n|---|---|---|---|\n| `malformed-port-without-host` | `https://:443/p` | reject | accepted as `https:///p` |\n| `malformed-userinfo-without-host` | `https://user@/p` | reject | accepted as `https:///p` |\n| `malformed-empty-authority` | `https:///p` | reject | accepted as `https:///p` |\n| `malformed-bare-ipv6` | `https://fe80::1/p` | reject | accepted as `https://fe80::1/p` |\n| `malformed-ipv6-zone-identifier` | `https://[fe80::1%25eth0]/p` | reject | accepted unchanged |\n| `malformed-ipv6-missing-closing-bracket` | `https://[::1/p` | reject | ✅ rejected (`ValueError`) |\n\nThe first three collapse to an **empty authority**, so `@authority` enters the signature base as the empty string and `@target-uri` as `https:///p`. Two different malformed inputs (`https://:443/p` and `https://user@/p`) canonicalize to the identical base — signatures become transferable between them.\n\n`malformed-bare-ipv6` is a distinct hazard: `_canon_authority()` splits `fe80::1` on the last colon, yielding host `fe80:` and port `1`, then reassembles it as `fe80::1`. The round-trip masks the malformation.\n\n## `request_target_uri_malformed` is not implemented\n\nThe spec's error code for all of these does not exist anywhere in the SDK — `src/adcp/signing/errors.py` has no such constant, and `grep -rn request_target_uri_malformed src/` is empty. It has its own row in the transport error taxonomy:\n\n> | Request `@target-uri` is syntactically malformed (e.g., empty authority, bare IPv6, IPv6 zone identifier, raw non-ASCII host), OR canonicalized `@authority` does not byte-match the authority component of the canonical `@target-uri` (cross-vhost replay) | No | `request_target_uri_malformed` |\n\nBecause the code is missing, the vendored test asserts only that canonicalization refuses (`pytest.raises(ValueError)`) rather than grading the code. That assertion should be tightened to the spec code once it exists.\n\n## Note on the taxonomy row\n\nThat same row also covers a second obligation the SDK does not appear to implement: canonicalized `@authority` must byte-match the authority component of the canonical `@target-uri`, and verifiers must derive `@authority` from `:authority`/`Host` rather than proxy state. The spec flags it as a cross-vhost replay defense. No vector in the 3.1.1 set exercises it, so it is not covered by the strict-xfail ledger — flagging it here rather than filing separately, since the fix lands in the same place.\n\n## Suggested direction\n\nReject the five shapes in `_canon_authority()`, add `request_target_uri_malformed` to the error taxonomy, and map the canonicalization refusal onto it at the verifier boundary.\n","author":{"url":"https://github.com/KonstantinMirin","@type":"Person","name":"KonstantinMirin"},"datePublished":"2026-07-28T20:33:40Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/978"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:efbb4030-3940-9ebe-9aca-4a7aef5989bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9F2:4BB79:BC4FF7:F19AD8:6B00FDA4 |
| html-safe-nonce | aa0b4dc63602f0fe6bd563cad4d03462aaf944a6a47de895a69d13bd645e36ff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUYyOjRCQjc5OkJDNEZGNzpGMTlBRDg6NkIwMEZEQTQiLCJ2aXNpdG9yX2lkIjoiODg5NjkyOTk4MTY4ODA0NzcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5ab75e95bccae38deffc4a5ac02f70add56aaae383279bf25e83428d148713fd |
| hovercard-subject-tag | issue:5002752584 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/adcontextprotocol/adcp-client-python/978/issue_layout |
| twitter:image | https://opengraph.githubassets.com/839dc952c72a5e7736384b3960add0ef326f7e6c5203886555953fc08c6a6325/adcontextprotocol/adcp-client-python/issues/978 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/839dc952c72a5e7736384b3960add0ef326f7e6c5203886555953fc08c6a6325/adcontextprotocol/adcp-client-python/issues/978 |
| og:image:alt | Found while vendoring the complete AdCP 3.1.1 request-signing vector set (#975). Reproductions are canonicalization.json cases, currently strict-xfail in tests/conformance/signing/test_canonicaliza... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | KonstantinMirin |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| turbo-cache-control | no-preview |
| go-import | github.com/adcontextprotocol/adcp-client-python git https://github.com/adcontextprotocol/adcp-client-python.git |
| octolytics-dimension-user_id | 221690821 |
| octolytics-dimension-user_login | adcontextprotocol |
| octolytics-dimension-repository_id | 1090305973 |
| octolytics-dimension-repository_nwo | adcontextprotocol/adcp-client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1090305973 |
| octolytics-dimension-repository_network_root_nwo | adcontextprotocol/adcp-client-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width