Skip to content

test(verification-workers): replay draft Ed25519 Signature-Agent vectors - #206

Merged
thibmeu merged 2 commits into
cloudflare:mainfrom
frostyhand:test/demo-draft-signature-agent-vectors
Nov 25, 2026
Merged

thibmeu merged 2 commits into
cloudflare:mainfrom
frostyhand:test/demo-draft-signature-agent-vectors

Conversation

@frostyhand

Copy link
Copy Markdown
Contributor

Refs #199

I looked into why the demo rejects the dictionary form. main is fine: the library and the worker both verify the draft -01 E.2.1 and E.2.2 vectors. The deployed demo is older than main. Its landing page still cites draft-meunier-web-bot-auth-architecture and it has no /signature-agent-card route, so it looks like a build from around 26 May (04979c4).

I confirmed the cause against /v0/api/verify. For "signature-agent";key="sig1" the deployed verifier builds the base line from the whole field value (sig1="https://..."), not the member value ("https://...") that RFC 9421 section 2.1.2 requires. A request signed over the whole field value comes back valid, and the draft-shaped request comes back invalid: invalid signature.

So the fix for #199 is a redeploy, which I can't do. This PR adds the test that would have caught it:

  • Two /v0/api/verify cases that replay the fixed E.2.1 (dictionary) and E.2.2 (legacy) Ed25519 vectors from the draft. Every existing case signs with this repo's own sign(), so if sign() and verify() build the same wrong base, those cases still pass. I checked this: with whole-field extraction put back into http-message-sig, all 33 existing worker tests still pass and the new E.2.1 case fails.
  • The landing page now links the IETF draft and says it accepts the dictionary form, plus the legacy string for migration, which is the note the reporter asked for.

npm run lint and npm test pass locally.

Every existing /v0/api/verify test signs with this repo's own sign(), so
a signature base that sign() and verify() build the same wrong way still
passes. The deployed demo shows this today: it builds the base line for
"signature-agent";key="sig1" from the whole field value instead of the
member value, and rejects draft -01 clients (cloudflare#199).

Replay the fixed E.2.1 (dictionary) and E.2.2 (legacy) vectors from
draft-ietf-webbotauth-httpsig-protocol-01 through the worker. Both pass
on main. Reintroducing whole-field extraction in http-message-sig makes
the E.2.1 case fail while all 33 existing tests still pass.

Also point the landing page at the IETF draft and say which
Signature-Agent forms it accepts.

Refs cloudflare#199
@clanky-the-clanker

Copy link
Copy Markdown
Contributor

This pull request was not reviewed automatically because its author does not have write access to this repository. A maintainer with write access can start a review by commenting clanky review (or clanker review or @clanky-the-clanker review), optionally followed by instructions (e.g. clanky review focus on the retry logic).

@frostyhand

Copy link
Copy Markdown
Contributor Author

@thibmeu could you take a look when you have a moment, or start a clanky review? It's tests plus a two-line landing page note, no library changes.

One data point since I opened it: Cloudflare's production verifier at crawltest.com/cdn-cgi/web-bot-auth treats the draft's dictionary Signature-Agent as well formed (401 for my unregistered key, 400 when unsigned). So only the demo deployment looks behind, and redeploying it from main should close #199.

@thibmeu
thibmeu merged commit 4f88b9c into cloudflare:main Nov 25, 2026
5 checks passed
@thibmeu

thibmeu commented Nov 25, 2026

Copy link
Copy Markdown
Member

thanks for the change @frostyhand . there are a few PRs and publication to handle before the demo redeployment. that should arrive in the near future though

@frostyhand

Copy link
Copy Markdown
Contributor Author

Thanks for merging, @thibmeu, and no rush on the demo. Once it's redeployed, I'll recheck #199 against it with the same draft vectors and close the loop there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants