Cybersecurity research · Tokyo

ba-cybersecurity.comResearch by Nobuo Otoi

Security review of widely used software · http-message-signatures

Signature verification bypass in http-message-signatures (npm, RFC 9421): a sender holding only key B could pass a message as signed by key A

Status · FixedReported · 15 Nov 2026 (PR #279)Fixed and released · 16 Nov 2026 (1.0.7)

Signature verification bypass (sender impersonation). The library could be made to accept a forged HTTP message signature. With all: true, documented as "verify every signature in the request", version 1.0.6 used only the result of the last signature whose key could be found. A sender holding only key B could send a forged signature for key A followed by a valid one of their own, and the message was accepted as signed by both.

The problem

httpbis.verifyMessage walked the signatures with a reducer. Whenever a key was found, it returned that signature's result and dropped what came before, including an earlier false or an error. With all: true, the order of the signatures decided the outcome; with the default (one valid signature is enough), a valid signature followed by an invalid one was rejected.

An application that uses all: true and treats every key ID it looked up as a verified signer could be made to accept a key ID the sender does not hold. The sender only needs one registered key of their own. Four public applications that combine all: true with verifyMessage were checked; all of them limit requests to a single signature, so none was affected.

// two registered keys A and B; signatures in the order sent
invalid A, valid B   all: true  => true    expected false
valid B, invalid A   all: true  => false
valid B, invalid A   default    => false   expected true

Measured on 1.0.6 and on commit 10d062c with a standalone script (HMAC keys, no network).

How it was shown

The behaviour was reproduced on the published 1.0.6 package and on the current source, then sent as a pull request with the fix, six regression tests covering both orders and both modes, and the reproduction script.

Response

The maintainer thanked the report for "the clear reproduction and tests", and while reviewing it found four more cases where the result still depended on the order of the signatures. The fix was then extended so that each signature is checked on its own and the results are combined once, the rules were documented, and the pull request was merged on 16 Nov 2026 and released the same day in 1.0.7.

Cite as

Nobuo Otoi (ba-cybersecurity.com). http-message-signatures: signature verification bypass with all: true (report and fix). 2026. https://ba-cybersecurity.com/research/http-message-signatures-all/.

@misc{otoi2026httpsig,
  author       = {Otoi, Nobuo},
  title        = {http-message-signatures: signature verification bypass with all: true (report and fix)},
  year         = {2026},
  howpublished = {\url{https://ba-cybersecurity.com/research/http-message-signatures-all/}},
  note         = {Fix: https://github.com/dhensby/node-http-message-signatures/pull/279}
}

Reported 15 Nov 2026 - Fixed and released 16 Nov 2026 (1.0.7) · This page: updated 17 Nov 2026 · Permanent address: https://ba-cybersecurity.com/research/http-message-signatures-all/