fix(signatures): cover ucp-agent and signature-agent when signing - #785
Open
sakinaroufid wants to merge 1 commit into
Open
Conversation
The REST request signing pseudocode builds a component list that leaves out two components the verification pseudocode requires, so a signer written from it produces signatures the spec's own verifier rejects with coverage_insufficient. Three problems in the same block: * `ucp_agent` is tested on the component line but is not a parameter of `sign_rest_request`, and `ucp-agent` is missing from the headers passed to `build_signature_base`. UCP-Agent is required on every request, so verification always demands `ucp-agent` coverage. * `signature-agent` is never added, although the component table, WBA Interop step 3 and the verification routine all require it whenever the Signature-Agent header is present. * the body check reads `body`, but the parameter is `body_bytes`. Add the two parameters, append `signature-agent` with the `;key` label used by the worked example above, and pass both headers through to the signature base. No normative requirement changes here; this only makes the example agree with the component table, the WBA Interop rules and the verification routine. The conformance suite currently skips grading `ucp-agent` coverage because of the same class of inconsistency elsewhere in the spec (Universal-Commerce-Protocol#659).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The REST request signing pseudocode in
signatures.mdbuilds a component list that omits two components the verification pseudocode in the same document requires, so a signer written from it produces signatures the spec's own verifier rejects withcoverage_insufficient.Transcribing both routines and running the published signer against the published verifier:
Three problems in the same block:
ucp_agentis tested on the component line but is not a parameter ofsign_rest_request, anducp-agentis missing from the headers dict passed tobuild_signature_base. Either way the component cannot be produced.UCP-Agentisrequired: truein bothshopping/rest.openapi.jsonandcommon/rest.openapi.json, so verification demandsucp-agentcoverage on every request, not just in an edge case.signature-agentis never added at all, although the signed-component table (footnote***), WBA Interop step 3 ("MUST sign thesignature-agentcomponent with;key="<label>"") and the verification routine all require it whenever theSignature-Agentheader is present. Since that header designates the WBA key source, a signer following this pseudocode leaves the key source unbound.body, but the parameter isbody_bytes(used correctly a few lines above).Worth being clear about the severity: the verification pseudocode is correct, so anyone implementing both halves from this document fails on the first round trip rather than shipping a signature gap silently. The cost is implementer time and conformance grading, not production insecurity.
This is also not a hypothetical class of problem.
conformance/webhook_structure_test.pyalready had to stop gradingucp-agentcoverage for the same reason:#659 fixes the webhook example in
shopping/order/index.md. It does not touchsignatures.md, and it does not cover thesignature-agentomission, so the request signing algorithm is still wrong after it lands.No normative requirement changes here. The component table, the WBA Interop rules and the verification routine already agree on what must be covered; only the pseudocode disagreed with all three.
signature-agentis ordered ahead ofucp-agentto match the workedSignature-Inputexample earlier in the same section, since that is the artifact implementers copy. RFC 9421 leaves component order to the signer, so the table's differing order is not wrong and is left alone.Category (Required)
Please select one or more categories that apply to this change.
ucp-schematool (resolver, linter, validator). (Requires Maintainer approval)Categorised as Documentation because the change is confined to an illustrative code block and alters no normative requirement, no JSON schema and no operation behaviour. Happy to recategorise if maintainers read a correction to the reference signing algorithm as Core Protocol.
Related Issues
Related to #659, which fixes the same class of inconsistency in the order webhook example.
Checklist
!for breaking changes).Notes on the unchecked boxes: there is no test surface for a pseudocode block in this repository, so no test was added. No JSON schema changed, so no model regeneration was needed.
Screenshots / Logs (if applicable)
pre-commit run --files docs/specification/signatures.md:Full corpus example validation and link checking: