JWT::JWK::Set raises on an unknown `kty`, failing the whole set (RFC 7517 §5)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Read the JWT::JWK::Set construction path and its handling of unsupported key types, then add coverage for a JWKS containing both a recognized key and an unknown kty. Verify that the unknown member is ignored while the recognized key remains available for lookup and verification. The issue offers a reproduction harness, but does not name specific source or test files.
索引モデルが issue の本文から書いたものです。
説明
Summary
Building a JWT::JWK::Set from a JWKS that contains a key with an unrecognised kty raises JWT::JWKError: Key type AKP not supported, so the whole set fails. Per RFC 7517 section 5 an unrecognised key should be ignored, not fatal, so one post-quantum key in a published JWKS takes down verification of the classical keys with it.
Reproduction
require "jwt"
JWT::JWK::Set.new(mixed_jwks) # RSA + one {"kty" => "AKP", ...} (ML-DSA, RFC 9964)
# JWT::JWKError: Key type AKP not supported
Measured against ruby-jwt 3.2.0. The set builds fine once the AKP key is removed. Fixture and probe available on request.
Why this matters
RFC 7517 section 5: "Implementations SHOULD ignore JWKs within a JWK Set that use kty values that are not understood by them." ML-DSA (FIPS 204 / RFC 9964, kty: "AKP") is starting to appear in published key sets as post-quantum migration begins. When an issuer adds one to a JWKS that ruby-jwt consumers read, those consumers stop verifying every signature from that issuer, including classical RS256/ES256, on a spec-compliant key publication they do not control. In federated deployments that is an externally triggered outage.
Suggested fix
When constructing a JWT::JWK::Set, skip a member whose kty is unsupported (optionally surface it) rather than raising, so the recognised keys still load and remain usable for kid lookup. This implements the RFC section 5 SHOULD and leaves recognised keys unchanged.
Offer
Happy to share the reproduction harness (mixed classical + AKP JWKS plus a control) and to open a PR with the per-key skip and a test.
- 主要言語
- Ruby
- スター
- 3.7k
- フォーク
- 381
- 平均マージ
- 19時間 13分
- マージ済み PR(30日)
- 8
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jwt/ruby-jwt のほかの issue
-
JWT::EncodedToken raises TypeError for a non-object header対応中かも @anakinj が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jwt/ruby-jwt#780 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
JWT::EncodedToken calls key_finder before checking the token's algorithm対応中かも @anakinj が今日担当しました。 オープンenhancement
難易度 3/5 半日 初心者へのやさしさ 42/100
jwt/ruby-jwt#781 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
JWT::EncodedToken accepts tokens with more than three segments対応中かも @anakinj が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
jwt/ruby-jwt#779 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
feature
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
jwt/ruby-jwt#428 · コメント 7 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
akitaonrails/ai-book-2026#12 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openfoodfoundation/openfoodnetwork#14970 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pulibrary/pdc_describe#2502 ·
メンテナーはふだん 1 日以内に返信