Signature-Agent parsers accept an http directory member

オープン
#162 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@KonstantinMirin がすでに取り組んでいます。

2026年10月18日 から。

  • #163 @KonstantinMirin による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
rust, typescript

調査の方向性

Read packages/web-bot-auth/src/registry.ts and crates/web-bot-auth/src/registry.rs, starting at validateDiscoveryURI and validate_discovery_uri; compare the directory handling with the existing jwks_uri and cimd checks. Review the open PR #163 and its tests for the dictionary, type=directory, and legacy String forms. Done means all discovery forms enforce the stated HTTPS rule and their tests pass.

索引モデルが issue の本文から書いたものです。

説明

parseSignatureAgentHeader in packages/web-bot-auth/src/registry.ts and parse_signature_agent_header in crates/web-bot-auth/src/registry.rs accept a directory member whose value uses the http scheme. Both parsers require https for jwks_uri and cimd. verify() passes the http member to the resolver as candidate.signatureAgent, and returns it as the verified signatureAgent.

draft-ietf-webbotauth-httpsig-protocol-00 requires https for every member:

  • Section 5.2.1: "Its member values MUST be String Items that contain a [URI], whose scheme MUST be https."
  • Section 5.5.1: "The directory MUST be served over HTTPS."

The editor's copy keeps the Section 5.2.1 sentence. The parsers landed in #92 in June 2026, and the https rule first appeared in draft-meunier-webbotauth-httpsig-protocol-01 in August, so the parsers may predate the rule rather than allow http on purpose.

Reproduction

With web-bot-auth 0.2.0 and http-message-sig 0.3.0 from npm:

import { component, createSignature } from "http-message-sig";
import { parseSignatureAgentHeader, verify } from "web-bot-auth";
import { signerFromJWK, verifierFromJWK } from "web-bot-auth/crypto";

parseSignatureAgentHeader('sig1="http://signature-agent.test"');
// {"kind":"current","entries":[{"label":"sig1","uri":"http://signature-agent.test","type":"directory"}]}

// RFC 9421 Appendix B.1.4 test key
const key = {
  kty: "OKP",
  crv: "Ed25519",
  d: "n4Ni-HpISpVObnQMW0wOhCKROaIKqKtW_2ZYb2p9KcU",
  x: "JrQLj5P_89iXES9-vFgrIy29clF9CC_oPPsw3c5D0bs",
};
const signer = await signerFromJWK(key);
const verifier = await verifierFromJWK(key);
const now = Math.floor(Date.now() / 1000);
const request = new Request("https://example.com/", {
  headers: { "Signature-Agent": 'sig1="http://signature-agent.test"' },
});
const fields = await createSignature(request, {
  label: "sig1",
  components: ["@authority", component("signature-agent", { key: "sig1" })],
  parameters: { created: now, expires: now + 300, keyid: signer.keyid, alg: "ed25519", tag: "web-bot-auth" },
  signer,
});
request.headers.set("Signature", fields.signature);
request.headers.set("Signature-Input", fields.signatureInput);
const result = await verify(request, { resolver: () => verifier });
result.signatureAgent.uri; // "http://signature-agent.test"

A resolver that fetches the directory named in candidate.signatureAgent fetches it over http. The verification worker example does this in fetchDirectory.

Proposed change

Apply the https check that the parsers make for jwks_uri and cimd to every discovery type. I have a PR ready that changes validateDiscoveryURI and validate_discovery_uri, and adds tests for the dictionary form, the type=directory form, and the legacy String form.

A caller that signs or verifies against a local http directory then gets an error from sign() and verify(). If local development needs http, an explicit option could cover it.

主要言語
Rust
スター
182
フォーク
49
平均マージ
1日 20分
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cloudflare/web-bot-auth のほかの issue

cloudflare/web-bot-auth の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。