Body
Summary
There's an inconsistency between the Rust http-signature-directory validator and the TypeScript directoryResponseHeaders function regarding the ;req component parameter on @authority.
The Issue
Rust validator (http-signature-directory) requires "@authority";req:
// crates/http-signature-directory/src/main.rs lines 72-83
CoveredComponent::Derived(DerivedComponent::Authority { req: true }) => {
vec![self.authority.clone()] // ✓ Returns value
}
CoveredComponent::Derived(DerivedComponent::Authority { req: false }) => {
error!("You are signing a plain `@authority` without the `req` component parameter...");
vec![] // ✗ Returns empty, causing verification failure
}
TypeScript library (directoryResponseHeaders) produces "@authority" without ;req:
// packages/http-message-sig/src/directory.ts
export const RESPONSE_COMPONENTS: Component[] = ["@authority"]; // No ;req
Cloudflare documentation also shows "@authority" without ;req:
https://developers.cloudflare.com/bots/reference/bot-verification/web-bot-auth/#2-host-a-key-directory
Signature-Input: sig1=("@authority");alg="ed25519";keyid="...";tag="http-message-signatures-directory"...
RFC 9421 Reference
Section 2.4 states:
"When a request message results in a signed response message, the signer can include portions of the request message in the signature base by adding the req parameter to the component identifier."
The RFC uses "can" (optional), not "MUST" (required).
Reproduction
- Use
directoryResponseHeaders to sign a directory response
- Validate with
http-signature-directory CLI
- Validation fails with:
"You are signing a plain @authority without the req component parameter"
Questions
- Should the TypeScript library be updated to use
"@authority";req in RESPONSE_COMPONENTS?
- Or should the Rust validator be relaxed to accept
"@authority" without ;req?
- Should the Cloudflare documentation be updated?
Environment
http-signature-directory v0.6.0
web-bot-auth v0.1.1
Body
Summary
There's an inconsistency between the Rust
http-signature-directoryvalidator and the TypeScriptdirectoryResponseHeadersfunction regarding the;reqcomponent parameter on@authority.The Issue
Rust validator (
http-signature-directory) requires"@authority";req:TypeScript library (
directoryResponseHeaders) produces"@authority"without;req:Cloudflare documentation also shows
"@authority"without;req:https://developers.cloudflare.com/bots/reference/bot-verification/web-bot-auth/#2-host-a-key-directory
RFC 9421 Reference
Section 2.4 states:
The RFC uses "can" (optional), not "MUST" (required).
Reproduction
directoryResponseHeadersto sign a directory responsehttp-signature-directoryCLI"You are signing a plain @authority without the req component parameter"Questions
"@authority";reqinRESPONSE_COMPONENTS?"@authority"without;req?Environment
http-signature-directoryv0.6.0web-bot-authv0.1.1