Briefing · Article · source · published · Boston Identity
A valid RFC 9421 signature does not prove who signed; key and algorithm checks are left to each profile
RFC 9421, published in February 2024 and edited by Annabelle Backman and Justin Richer with Manu Sporny, is the IETF standard for signing chosen parts of an HTTP message so integrity holds past the TLS connection that ends at a proxy. It leaves which keys to trust, which parts must be signed and how fresh a signature must be to each application, and it warns that a valid signature alone does not show the right party signed. With a shared HMAC key, the verifier itself could produce the signer's signature.
RFC Editor · Annabelle Backman, Justin Richer, Manu Sporny · February 1, 2024 · read
What's happening
Finding3RFC 9421 lets a verifier check that named parts of an HTTP message were signed with a given key, and leaves who holds it, and trust in it, to the application.
RFC 9421 lets a verifier check that named parts of an HTTP message were signed with a given key, and leaves who holds that key, and whether to trust it, to the application. The RFC says an application or profile MUST specify which message components must be covered, how to retrieve the key material, which algorithms are allowed and what errors to return; the keyid parameter names a key, and the application defines how to resolve it. A verifier MUST fail when the key is one it does not know or trust for the request, and the security considerations say to accept only signatures from expected signers, "regardless of the cryptographic validity of the signature itself." A valid signature is "not sufficient to prove that the message has been signed by the appropriate party": the verifier needs to check that the key and algorithm are right for the message, or an attacker can swap in a signature made with their own key or downgrade the algorithm, for example to an HMAC keyed with the public RSA key. With symmetric algorithms such as HMAC, the verifier holds the same key and can generate a valid signature itself, so the RFC says asymmetric methods should be used where possible.
flag a problem with BI-FIND-2024-0054
Figure steps
- The client signs its request as sig1, covering the method, authority, path and content digest with its own key.
- The reverse proxy validates sig1, then changes the Host and adds a Forwarded field before passing the request on.
- The proxy adds proxy_sig, made with its own key over the message it forwards, and passes sig1 along unchanged.
- The proxy's signature does not cover sig1's value. The RFC marks signing a signature NOT RECOMMENDED, because it gives no transitive coverage.
The proxy vouches for the message it forwards with its own key; the client's signature rides along, and the proxy's signature does not cover it.
Drawn from the RFC's own reverse-proxy example (Section 4.3)Source dated February 1, 2024Passage: Section 3
Swipe for the full figure →
An RFC 9421 signature protects only the parts of a message the signer chose to cover, and the RFC leaves two gaps, the body and freshness, to the profile.
An RFC 9421 signature protects only the parts of the message the signer chose to cover, and the RFC leaves two gaps to the profile. The body is not signed directly: it is covered through a Content-Digest field (RFC 9530), and the RFC says it is important that the verifier also checks that digest against the content it received, because "checking only the signature is not sufficient protection against such a substitution attack." Freshness is optional too. The created timestamp is RECOMMENDED rather than required, expires is only a hint from the signer, and replay defence rests on covering enough of the message plus an optional nonce.
flag a problem with BI-FIND-2024-0055
In the RFC's worked example, a reverse proxy signs the forwarded message with its own key, and the proxy's signature does not cover the client's.
Several signatures can sit on one message under different labels, and the RFC's worked example has a reverse proxy validate the client's signature, change the Host, add a Forwarded field and then sign the forwarded message with its own key and a short expiry. The proxy's signature does not cover the client's. Section 4.3 opens by mentioning a proxy signing over the client's original signature values, but the RFC then marks that practice NOT RECOMMENDED, because a signature over a signature does not transitively cover what the first signer signed (it cites Jackson et al., 2019). An application that needs to signal that a signature was validated "would need to carefully specify alternative mechanisms", and a verifier facing several signatures has to account for every signer.
flag a problem with BI-FIND-2024-0056
Section by section
5showing 5 of 5
[1]Why TLS is not enough, and what an application must specify
Standards
Why TLS is not enough, and what an application must specify
The RFC argues that TLS protects integrity only over a single connection, so end-to-end integrity across gateways, proxies and libraries needs a detached signature over chosen message components. It lists what an application profile MUST specify, from covered components and key lookup to allowed algorithms and errors. It calls itself only part of a security system and leaves message content to the Digest fields.
technical artifactfrom published text
[2]Message components and the signature base
Standards
Message components and the signature base
The RFC defines component identifiers: lowercased field names plus derived components such as @method, @authority, @path, @query-param and @status. Parameters (sf, key, bs, tr, req) adjust how a value is read, and the canonical signature base ends in @signature-params. The req parameter binds a response to its request, and the requester then has to keep the request values until it checks the response.
technical artifactfrom published text
[3]Creating and verifying signatures, carrying them, requesting them
Standards
Creating and verifying signatures, carrying them, requesting them
The signing and verifying steps come with six algorithms (RSA-PSS, RSA v1.5, HMAC, ECDSA P-256 and P-384, Ed25519) plus JWS algorithms, never none. Signatures travel in the Signature-Input and Signature fields under labels, so one message can carry several, as in the example of a client and a reverse proxy. Accept-Signature lets one side ask the other to sign.
technical artifactfrom published text
[4]IANA registries (algorithms, parameters, component names)
Standards
IANA registries (algorithms, parameters, component names)
The RFC registers Signature-Input, Signature and Accept-Signature as HTTP fields and creates four registries: signature algorithms, metadata parameters, derived component names and component parameters. New entries need Specification Required, and the six algorithms from section 3.3 start out Active.
technical artifactfrom published text
[5]Security and privacy considerations
Standards
Security and privacy considerations
The security section walks through skipped verification, thin coverage, replay, confusion between several signatures, an unchecked Content-Digest, key theft, impersonation with a shared symmetric key, algorithm downgrade, canonicalization tricks and signing signature values, citing a 2019 attack study by Jackson et al. On privacy, it warns that a reused key lets verifiers track a signer, and that signatures give no confidentiality.
technical artifactfrom published text