JSON Web Tokens, also known as JWTs, are URL-safe JSON-based security tokens that contain a set of claims that can be signed and/or encrypted. JWTs are being widely used and deployed as a simple security token format in numerous protocols and applications, both in the area of digital identity and in other application areas. This Best Current Practices document updates RFC 7519 to provide actionable guidance leading to secure implementation and deployment of JWTs.
JSON Web Tokens、またはJWTとしても知られるものは、URLセーフでJSONベースのセキュリティートークンであり、署名および/または暗号化された一連のクレームを含みます。JWTは、デジタルアイデンティティの領域および他のアプリケーション領域の両方で、多数のプロトコルおよびアプリケーションで単純なセキュリティートークンフォーマットとして広く使用され、展開されています。このBest Current Practices文書は、RFC 7519を更新し、JWTの安全な実装と展開につながる実行可能なガイダンスを提供します。
This memo documents an Internet Best Current Practice.
このメモは、インターネットの現在のベストプラクティスを文書化したものです。
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on BCPs is available in Section 2 of RFC 7841.
この文書は、インターネット技術の標準化を行う団体であるIETF(Internet Engineering Task Force)によって作成されたものであり、IETFコミュニティの合意に基づいています。公開レビューを受け、Internet Engineering Steering Group(IESG)によって公開が承認されました。BCPに関する詳細は、RFC 7841のセクション2に記載されています。
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8725.
この文書の現在のステータス、正誤表、およびフィードバックの提供方法に関する情報は、https://www.rfc-editor.org/info/rfc8725で入手できます。
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
この文書は、BCP 78およびIETFドキュメントに関するIETFトラストの法的規定(https://trustee.ietf.org/license-info)に従う必要があります。これらの文書をよく確認し、この文書に関するあなたの権利と制限を説明しています。この文書から抽出されたコードコンポーネントには、Trust Legal Provisionsのセクション4.eに記載されているSimplified BSD Licenseのテキストが含まれている必要があり、Simplified BSD Licenseに記載されているように保証なしで提供されます。
JSON Web Tokens, also known as JWTs [RFC7519], are URL-safe JSON-based security tokens that contain a set of claims that can be signed and/or encrypted. The JWT specification has seen rapid adoption because it encapsulates security-relevant information in one easy-to-protect location, and because it is easy to implement using widely available tools. One application area in which JWTs are commonly used is representing digital identity information, such as OpenID Connect ID Tokens [OpenID.Core] and OAuth 2.0 [RFC6749] access tokens and refresh tokens, the details of which are deployment-specific.
JSON Web Tokens(JWT)は、URLセーフでJSONベースのセキュリティートークンであり、署名および/または暗号化された一連のクレームを含みます。JWT仕様は、セキュリティーに関連する情報を1つの簡単に保護できる場所にカプセル化するため、および広く利用可能なツールを使用して簡単に実装できるため、急速に採用されています。JWTが一般的に使用されるアプリケーション領域の1つは、OpenID Connect IDトークンおよびOAuth 2.0アクセストークンおよびリフレッシュトークンなどのデジタルアイデンティティ情報を表すことです。これらの詳細は、展開に固有のものです。
Since the JWT specification was published, there have been several widely published attacks on implementations and deployments. Such attacks are the result of under-specified security mechanisms, as well as incomplete implementations and incorrect usage by applications.
JWT仕様が公開されて以来、実装および展開に対するいくつかの広く公開された攻撃がありました。このような攻撃は、不十分に指定されたセキュリティーメカニズム、不完全な実装、およびアプリケーションによる誤った使用の結果です。
The goal of this document is to facilitate secure implementation and deployment of JWTs. Many of the recommendations in this document are about implementation and use of the cryptographic mechanisms underlying JWTs that are defined by JSON Web Signature (JWS) [RFC7515], JSON Web Encryption (JWE) [RFC7516], and JSON Web Algorithms (JWA) [RFC7518]. Others are about use of the JWT claims themselves.
These are intended to be minimum recommendations for the use of JWTs in the vast majority of implementation and deployment scenarios. Other specifications that reference this document can have stricter requirements related to one or more aspects of the format, based on their particular circumstances; when that is the case, implementers are advised to adhere to those stricter requirements. Furthermore, this document provides a floor, not a ceiling, so stronger options are always allowed (e.g., depending on differing evaluations of the importance of cryptographic strength vs. computational load).
これらは、実装および展開シナリオのほとんどにおけるJWTの最小推奨事項であることを意図しています。この文書を参照する他の仕様は、その特定の状況に基づいて、フォーマットの1つ以上の側面に関連するより厳しい要件を持つ場合があります。その場合、実装者はそれらのより厳しい要件に従うことが推奨されます。さらに、この文書は床を提供するものであり、天井ではありません。したがって、より強力なオプションは常に許可されます(たとえば、暗号強度と計算負荷の重要性の評価の違いに応じて)。
Community knowledge about the strength of various algorithms and feasible attacks can change quickly, and experience shows that a Best Current Practice (BCP) document about security is a point-in-time statement. Readers are advised to seek out any errata or updates that apply to this document.
コミュニティによる、さまざまなアルゴリズムの強度や実行可能な攻撃に関する知識は、急速に変化することがあります。また、経験から、セキュリティーに関するベストプラクティス(BCP)文書は、時点での声明であることがわかっています。読者は、この文書に適用される正誤表や更新情報を探すことをお勧めします。
The intended audiences of this document are:
この文書の対象読者は以下の通りです:
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
キーワード「しなければなりません(MUST)」、「してはなりません(MUST NOT)」、 「要求されています(REQUIRED)」、 「することになります(SHALL)」、「することはありません(SHALL NOT)」、 「すべきです(SHOULD)」、「すべきではありません(SHOULD NOT)」、 「推奨されます(RECOMMENDED)」、「推奨されません(NOT RECOMMENDED)」、 「してもよいです(MAY)」、「選択できます(OPTIONAL)」は、 BCP 14 [RFC2119] [RFC8174]に記載されているとおりに解釈されるものとします。 ただし、ここに示すようにすべて大文字で表示される場合に限ります。
This section lists some known and possible problems with JWT implementations and deployments. Each problem description is followed by references to one or more mitigations to those problems.
このセクションでは、JWTの実装および展開に関する既知の問題と可能性がいくつかリストされています。各問題の説明には、それらの問題に対する1つ以上の緩和策への参照が続きます。
Signed JSON Web Tokens carry an explicit indication of the signing algorithm, in the form of the "alg" Header Parameter, to facilitate cryptographic agility. This, in conjunction with design flaws in some libraries and applications, has led to several attacks:
署名付きJSON Web Tokenは、暗号アジリティを容易にするために「alg」ヘッダーパラメーターの形式で署名アルゴリズムの明示的な指示を持っています。これは、一部のライブラリやアプリケーションの設計上の欠陥と組み合わせて、いくつかの攻撃につながっています:
In addition, some applications use a keyed Message Authentication Code (MAC) algorithm, such as "HS256", to sign tokens but supply a weak symmetric key with insufficient entropy (such as a human-memorable password). Such keys are vulnerable to offline brute-force or dictionary attacks once an attacker gets hold of such a token [Langkemper].
さらに、一部のアプリケーションでは、トークンに署名するために「HS256」などのキー付きメッセージ認証コード(MAC)アルゴリズムを使用しますが、十分なエントロピーを持たない弱い対称キー(人間が覚えやすいパスワードなど)を提供します。このようなキーは、攻撃者がそのようなトークンを手に入れた場合にオフラインのブルートフォースまたは辞書攻撃に対して脆弱です。[Langkemper]を参照してください。
For mitigations, see Section 3.5.
緩和策については、3.5を参照してください。
Some libraries that decrypt a JWE-encrypted JWT to obtain a JWS-signed object do not always validate the internal signature.
JWEで暗号化されたJWTを復号化してJWSで署名されたオブジェクトを取得する一部のライブラリは、内部署名を常に検証しません。
For mitigations, see Section 3.3.
緩和策については、3.3を参照してください。
Many encryption algorithms leak information about the length of the plaintext, with a varying amount of leakage depending on the algorithm and mode of operation. This problem is exacerbated when the plaintext is initially compressed, because the length of the compressed plaintext and, thus, the ciphertext depends not only on the length of the original plaintext but also on its content. Compression attacks are particularly powerful when there is attacker-controlled data in the same compression space as secret data, which is the case for some attacks on HTTPS.
多くの暗号化アルゴリズムは、アルゴリズムと操作モードによって異なる量の情報漏洩を引き起こし、平文の長さに関する情報を漏洩させます。平文が最初に圧縮された場合、この問題は悪化します。なぜなら、圧縮された平文の長さと、したがって暗号文の長さは、元の平文の長さだけでなく、その内容にも依存するためです。圧縮攻撃は、秘密データと同じ圧縮空間内に攻撃者が制御するデータがある場合にとくに強力です。これは、HTTPSへの攻撃の一部の場合に当てはまります。
See [Kelsey] for general background on compression and encryption and [Alawatugoda] for a specific example of attacks on HTTP cookies.
一般的な背景については[Kelsey]を、HTTPクッキーへの攻撃の具体例については[Alawatugoda]を参照してください。
For mitigations, see Section 3.6.
緩和策については、3.6を参照してください。
Per [Sanso], several Javascript Object Signing and Encryption (JOSE) libraries fail to validate their inputs correctly when performing elliptic curve key agreement (the "ECDH-ES" algorithm). An attacker that is able to send JWEs of its choosing that use invalid curve points and observe the cleartext outputs resulting from decryption with the invalid curve points can use this vulnerability to recover the recipient's private key.
[Sanso]によると、いくつかのJavascript Object Signing and Encryption(JOSE)ライブラリは、楕円曲線鍵共有(「ECDH-ES」アルゴリズム)を実行する際に、入力を正しく検証できない場合があります。無効な曲線点を使用するJWEを送信し、無効な曲線点での復号化によって生じるクリアテキスト出力を観察できる攻撃者は、この脆弱性を使用してaudienceの秘密鍵を回復できます。
For mitigations, see Section 3.4.
緩和策については、3.4を参照してください。
Previous versions of the JSON format, such as the obsoleted [RFC7159], allowed several different character encodings: UTF-8, UTF-16, and UTF-32. This is not the case anymore, with the latest standard [RFC8259] only allowing UTF-8 except for internal use within a "closed ecosystem". This ambiguity, where older implementations and those used within closed environments may generate non-standard encodings, may result in the JWT being misinterpreted by its recipient. This, in turn, could be used by a malicious sender to bypass the recipient's validation checks.
For mitigations, see Section 3.7.
緩和策については、3.7を参照してください。
There are attacks in which one recipient will be given a JWT that was intended for it and will attempt to use it at a different recipient for which that JWT was not intended. For instance, if an OAuth 2.0 [RFC6749] access token is legitimately presented to an OAuth 2.0 protected resource for which it is intended, that protected resource might then present that same access token to a different protected resource for which the access token is not intended, in an attempt to gain access. If such situations are not caught, this can result in the attacker gaining access to resources that it is not entitled to access.
攻撃者が、あるaudienceが意図されたJWTを受け取り、そのJWTを意図されていない別のaudienceで使用しようとする攻撃があります。たとえば、OAuth 2.0 [RFC6749]アクセストークンが、意図されたOAuth 2.0保護リソースに正当に提供された場合、その保護リソースは、アクセストークンが意図されていない別の保護リソースに対して同じアクセストークンを提供し、アクセスを取得しようとする場合があります。このような状況が検出されない場合、攻撃者はアクセス権がないリソースにアクセスできるようになる可能性があります。
As JWTs are being used by more different protocols in diverse application areas, it becomes increasingly important to prevent cases of JWT tokens that have been issued for one purpose being subverted and used for another. Note that this is a specific type of substitution attack. If the JWT could be used in an application context in which it could be confused with other kinds of JWTs, then mitigations MUST be employed to prevent these substitution attacks.
JWTが異なるプロトコルで多様なアプリケーション領域で使用されるようになるにつれて、1つの目的で発行されたJWTトークンが他の目的に悪用されることを防止することがますます重要になってきます。 これは、特定のタイプの代替攻撃です。 JWTが他の種類のJWTと混同されるアプリケーションコンテキストで使用される可能性がある場合、これらの代替攻撃を防止するために緩和策を使用しなければなりません(MUST)。
Various JWT claims are used by the recipient to perform lookup operations, such as database and Lightweight Directory Access Protocol (LDAP) searches. Others include URLs that are similarly looked up by the server. Any of these claims can be used by an attacker as vectors for injection attacks or server-side request forgery (SSRF) attacks.
audienceは、データベースやLightweight Directory Access Protocol(LDAP)検索などのルックアップ操作を実行するために、さまざまなJWTクレームを使用します。その他にも、同様にサーバーによって検索されるURLが含まれます。これらのクレームのいずれかは、攻撃者によってインジェクション攻撃やサーバーサイドリクエストフォージェリ(SSRF)攻撃のベクトルとして使用される可能性があります。
For mitigations, see Section 3.10.
緩和策については、Section 3.10を参照してください。
The best practices listed below should be applied by practitioners to mitigate the threats listed in the preceding section.
前節でリストされた脅威を緩和するために、以下に示すベストプラクティスを実践する必要があります。
Libraries MUST enable the caller to specify a supported set of algorithms and MUST NOT use any other algorithms when performing cryptographic operations. The library MUST ensure that the "alg" or "enc" header specifies the same algorithm that is used for the cryptographic operation. Moreover, each key MUST be used with exactly one algorithm, and this MUST be checked when the cryptographic operation is performed.
ライブラリは、呼び出し元がサポートされるアルゴリズムのセットを指定できるようにする必要があり、暗号操作を実行する際に他のアルゴリズムを使用してはなりません(MUST NOT)。 ライブラリは、"alg"または"enc"ヘッダーが暗号操作に使用されるアルゴリズムと同じアルゴリズムを指定していることを確認しなければなりません(MUST)。 さらに、各キーは正確に1つのアルゴリズムで使用される必要があり(MUST)、暗号操作が実行されるときにこれを確認しなければなりません(MUST)。
As Section 5.2 of [RFC7515] says, "it is an application decision which algorithms may be used in a given context. Even if a JWS can be successfully validated, unless the algorithm(s) used in the JWS are acceptable to the application, it SHOULD consider the JWS to be invalid."
[RFC7515]のSection 5.2によると、「特定のコンテキストで使用できるアルゴリズムは、アプリケーションの決定によるものです。JWSが正常に検証されたとしても、JWSで使用されるアルゴリズムがアプリケーションに適していない場合、JWSは無効とすべきです(SHOULD)」とされています。
Therefore, applications MUST only allow the use of cryptographically current algorithms that meet the security requirements of the application. This set will vary over time as new algorithms are introduced and existing algorithms are deprecated due to discovered cryptographic weaknesses. Applications MUST therefore be designed to enable cryptographic agility.
したがって、アプリケーションは、アプリケーションのセキュリティー要件を満たす現在の暗号アルゴリズムのみ使用を許可しなければなりません(MUST)。 このセットは、新しいアルゴリズムが導入され、既存のアルゴリズムが暗号的な弱点が発見されたために非推奨になるにつれて、時間の経過とともに変化します。 アプリケーションは、暗号的な俊敏性を可能にするように設計される必要があります(MUST)。
That said, if a JWT is cryptographically protected end-to-end by a transport layer, such as TLS using cryptographically current algorithms, there may be no need to apply another layer of cryptographic protections to the JWT. In such cases, the use of the "none" algorithm can be perfectly acceptable. The "none" algorithm should only be used when the JWT is cryptographically protected by other means. JWTs using "none" are often used in application contexts in which the content is optionally signed; then, the URL-safe claims representation and processing can be the same in both the signed and unsigned cases. JWT libraries SHOULD NOT generate JWTs using "none" unless explicitly requested to do so by the caller. Similarly, JWT libraries SHOULD NOT consume JWTs using "none" unless explicitly requested by the caller.
ただし、JWTがトランスポート層(TLSなど)によって暗号的に保護されている場合、アプリケーションは別の暗号保護層を適用する必要はありません。 このような場合、"none"アルゴリズムの使用は完全に許容されます。 "none"アルゴリズムは、JWTが他の手段で暗号的に保護されている場合にのみ使用する必要があります。 "none"を使用するJWTは、コンテンツがオプションで署名されるアプリケーションコンテキストでよく使用されます。 その場合、URLセーフなクレーム表現と処理は、署名された場合と署名されていない場合の両方で同じになる可能性があります。 JWTライブラリは、呼び出し元から明示的に要求された場合を除き、"none"を使用してJWTを生成すべきではありません(SHOULD NOT)。 同様に、JWTライブラリは、呼び出し元から明示的に要求された場合を除き、"none"を使用してJWTを消費すべきではありません(SHOULD NOT)。
Applications SHOULD follow these algorithm-specific recommendations:
アプリケーションは、以下のアルゴリズム固有の推奨事項にしたがうべきです(SHOULD):
All cryptographic operations used in the JWT MUST be validated and the entire JWT MUST be rejected if any of them fail to validate. This is true not only of JWTs with a single set of Header Parameters but also for Nested JWTs in which both outer and inner operations MUST be validated using the keys and algorithms supplied by the application.
JWTで使用されるすべての暗号操作は検証され、検証に失敗した場合はJWT全体を拒否しなければなりません(MUST)。 これは、単一のHeader Parametersセットを持つJWTだけでなく、アプリケーションが提供するキーとアルゴリズムを使用して外部および内部操作の両方を検証しなければならない(MUST)ネストされたJWTにも当てはまります。
Some cryptographic operations, such as Elliptic Curve Diffie-Hellman key agreement ("ECDH-ES"), take inputs that may contain invalid values. This includes points not on the specified elliptic curve or other invalid points (e.g., [Valenta], Section 7.1). The JWS/JWE library itself must validate these inputs before using them, or it must use underlying cryptographic libraries that do so (or both!).
楕円曲線Diffie-Hellman鍵共有("ECDH-ES")などの一部の暗号操作は、無効な値を含む入力を取得する場合があります。これには、指定された楕円曲線上にない点や他の無効な点(例:[Valenta]、セクション7.1)が含まれます。JWS/JWEライブラリ自体は、これらの入力を使用する前に検証する必要があります。または、それらを検証する基礎となる暗号ライブラリを使用する必要があります(または両方!)。
Elliptic Curve Diffie-Hellman Ephemeral Static (ECDH-ES) ephemeral public key (epk) inputs should be validated according to the recipient's chosen elliptic curve. For the NIST prime-order curves P-256, P-384, and P-521, validation MUST be performed according to Section 5.6.2.3.4 (ECC Partial Public-Key Validation Routine) of "Recommendation for Pair-Wise Key-Establishment Schemes Using Discrete Logarithm Cryptography" [nist-sp-800-56a-r3]. If the "X25519" or "X448" [RFC8037] algorithms are used, then the security considerations in [RFC8037] apply.
楕円曲線Diffie-Hellmanエフェメラルスタティック(ECDH-ES)エフェメラル公開鍵(epk)入力は、audienceが選択した楕円曲線に従って検証する必要があります。NISTの素数次元曲線P-256、P-384、およびP-521の場合、検証は、"Recommendation for Pair-Wise Key-Establishment Schemes Using Discrete Logarithm Cryptography" [nist-sp-800-56a-r3]のセクション5.6.2.3.4(ECC Partial Public-Key Validation Routine)に従って実行する必要があります。"X25519"または"X448" [RFC8037]アルゴリズムが使用される場合、[RFC8037]のセキュリティーに関する考慮事項が適用されます。
The Key Entropy and Random Values advice in Section 10.1 of [RFC7515] and the Password Considerations in Section 8.8 of [RFC7518] MUST be followed. In particular, human-memorizable passwords MUST NOT be directly used as the key to a keyed-MAC algorithm such as "HS256". Moreover, passwords should only be used to perform key encryption, rather than content encryption, as described in Section 4.8 of [RFC7518]. Note that even when used for key encryption, password-based encryption is still subject to brute-force attacks.
[RFC7515]のSection 10.1のキーエントロピーとランダム値のアドバイス、および[RFC7518]のSection 8.8のパスワードに関する考慮事項にしたがう必要があります(MUST)。 とくに、人間が覚えられるパスワードは、"HS256"のようなキー付きMACアルゴリズムのキーとして直接使用してはなりません(MUST NOT)。 さらに、パスワードは、コンテンツの暗号化ではなく、キーの暗号化を実行するためにのみ使用する必要があります。[RFC7518]のSection 4.8で説明されています。 キーの暗号化に使用される場合でも、パスワードベースの暗号化は、ブルートフォース攻撃の対象となる可能性があることに注意してください。
Compression of data SHOULD NOT be done before encryption, because such compressed data often reveals information about the plaintext.
暗号化の前にデータを圧縮すべきではありません(SHOULD NOT)。なぜなら、そのような圧縮されたデータはしばしば平文に関する情報を明らかにするからです。
[RFC7515], [RFC7516], and [RFC7519] all specify that UTF-8 be used for encoding and decoding JSON used in Header Parameters and JWT Claims Sets. This is also in line with the latest JSON specification [RFC8259]. Implementations and applications MUST do this and not use or admit the use of other Unicode encodings for these purposes.
When a JWT contains an "iss" (issuer) claim, the application MUST validate that the cryptographic keys used for the cryptographic operations in the JWT belong to the issuer. If they do not, the application MUST reject the JWT.
JWTに"iss"(issuer)クレームが含まれる場合、アプリケーションは、JWTの暗号操作に使用される暗号鍵がissuerに属していることを検証しなければなりません(MUST)。属していない場合、アプリケーションはJWTを拒否しなければなりません(MUST)。
The means of determining the keys owned by an issuer is application-specific. As one example, OpenID Connect [OpenID.Core] issuer values are "https" URLs that reference a JSON metadata document that contains a "jwks_uri" value that is an "https" URL from which the issuer's keys are retrieved as a JWK Set [RFC7517]. This same mechanism is used by [RFC8414]. Other applications may use different means of binding keys to issuers.
issuerが所有する鍵を決定する手段は、アプリケーションによって異なります。たとえば、OpenID Connect [OpenID.Core]のissuer値は、JSONメタデータドキュメントを参照する"https" URLであり、そのドキュメントにはissuerの鍵がJWKセットとして取得される"https" URLである"jwks_uri"値が含まれています。[RFC7517]。同じメカニズムは、[RFC8414]でも使用されます。他のアプリケーションは、issuerと鍵をバインドするために異なる手段を使用する場合があります。
Similarly, when the JWT contains a "sub" (subject) claim, the application MUST validate that the subject value corresponds to a valid subject and/or issuer-subject pair at the application. This may include confirming that the issuer is trusted by the application. If the issuer, subject, or the pair are invalid, the application MUST reject the JWT.
同様に、JWTに"sub"(subject)クレームが含まれる場合、アプリケーションは、subject値がアプリケーションで有効なsubjectおよび/またはissuer-subjectペアに対応していることを検証しなければなりません(MUST)。これには、issuerがアプリケーションによって信頼されていることを確認することが含まれる場合があります。issuer、subject、またはペアが無効な場合、アプリケーションはJWTを拒否しなければなりません(MUST)。
If the same issuer can issue JWTs that are intended for use by more than one relying party or application, the JWT MUST contain an "aud" (audience) claim that can be used to determine whether the JWT is being used by an intended party or was substituted by an attacker at an unintended party.
同じissuerが、複数の信頼するパーティまたはアプリケーションが使用することを意図したJWTを発行できる場合、JWTには"aud"(audience)クレームが含まれている必要があります(MUST)。これにより、JWTが意図されたパーティによって使用されているか、攻撃者によって意図しないパーティで置き換えられたかどうかを判断できます。
In such cases, the relying party or application MUST validate the audience value, and if the audience value is not present or not associated with the recipient, it MUST reject the JWT.
このような場合、信頼するパーティまたはアプリケーションは、audienceの値を検証しなければなりません(MUST)。audienceの値が存在しない場合、またはaudienceに関連付けられていない場合、JWTを拒否しなければなりません(MUST)。
The "kid" (key ID) header is used by the relying application to perform key lookup. Applications should ensure that this does not create SQL or LDAP injection vulnerabilities by validating and/or sanitizing the received value.
"kid"(キーID)ヘッダーは、信頼するアプリケーションがキーの検索を実行するために使用されます。アプリケーションは、受信した値を検証および/またはサニタイズすることにより、これがSQLまたはLDAPインジェクションの脆弱性を作成しないようにする必要があります。
Similarly, blindly following a "jku" (JWK set URL) or "x5u" (X.509 URL) header, which may contain an arbitrary URL, could result in server-side request forgery (SSRF) attacks. Applications SHOULD protect against such attacks, e.g., by matching the URL to a whitelist of allowed locations and ensuring no cookies are sent in the GET request.
同様に、任意のURLを含む可能性がある"jku"(JWKセットURL)または"x5u"(X.509 URL)ヘッダーを盲目的にフォローすることは、サーバーサイドリクエストフォージェリ(SSRF)攻撃につながる可能性があります。アプリケーションは、このような攻撃に対して保護すべきです(SHOULD)。たとえば、URLを許可された場所のホワイトリストに一致させ、GETリクエストでクッキーが送信されないようにすることが挙げられます。
Sometimes, one kind of JWT can be confused for another. If a particular kind of JWT is subject to such confusion, that JWT can include an explicit JWT type value, and the validation rules can specify checking the type. This mechanism can prevent such confusion. Explicit JWT typing is accomplished by using the "typ" Header Parameter. For instance, the [RFC8417] specification uses the "application/secevent+jwt" media type to perform explicit typing of Security Event Tokens (SETs).
場合によっては、ある種類のJWTが別のJWTと混同されることがあります。特定の種類のJWTがそのような混乱の対象になる場合、そのJWTには明示的なJWTタイプ値を含めることができ、検証ルールではタイプのチェックを指定することができます。このメカニズムにより、そのような混乱を防ぐことができます。 明示的なJWTタイプ指定は、"typ"ヘッダーパラメーターを使用して実行されます。たとえば、[RFC8417]仕様では、"application/secevent+jwt"メディアタイプを使用して、セキュリティーイベントトークン(SET)の明示的なタイプ指定を実行します。
Per the definition of "typ" in Section 4.1.9 of [RFC7515], it is RECOMMENDED that the "application/" prefix be omitted from the "typ" value. Therefore, for example, the "typ" value used to explicitly include a type for a SET SHOULD be "secevent+jwt". When explicit typing is employed for a JWT, it is RECOMMENDED that a media type name of the format "application/example+jwt" be used, where "example" is replaced by the identifier for the specific kind of JWT.
"typ"の定義によると、[RFC7515]のSection 4.1.9、"typ"値から"application/"接頭辞を省略することが推奨されます(RECOMMENDED)。したがって、たとえば、SETのタイプを明示的に含めるために使用される"typ"値は"secevent+jwt"であるべきです(SHOULD)。JWTに明示的なタイプ指定が使用される場合、特定のJWTの識別子で"application/example+jwt"形式のメディアタイプ名を使用することが推奨されます(RECOMMENDED)。
When applying explicit typing to a Nested JWT, the "typ" Header Parameter containing the explicit type value MUST be present in the inner JWT of the Nested JWT (the JWT whose payload is the JWT Claims Set). In some cases, the same "typ" Header Parameter value will be present in the outer JWT as well, to explicitly type the entire Nested JWT.
ネストされたJWTに明示的なタイプ指定を適用する場合、明示的なタイプ値を含む"typ"ヘッダーパラメーターは、ネストされたJWTの内部JWT(ペイロードがJWTクレームセットであるJWT)に存在しなければなりません(MUST)。場合によっては、同じ"typ"ヘッダーパラメーター値が外部JWTにも存在し、ネストされたJWT全体に明示的なタイプを指定するために使用されます。
Note that the use of explicit typing may not achieve disambiguation from existing kinds of JWTs, as the validation rules for existing kinds of JWTs often do not use the "typ" Header Parameter value. Explicit typing is RECOMMENDED for new uses of JWTs.
明示的なタイプ指定の使用は、既存のJWTの種類の検証ルールが"typ"ヘッダーパラメーター値を使用しない場合、既存のJWTの種類の曖昧さを解消することができない場合があります。新たにJWTを使用する場合は、タイプを明示することが推奨されます(RECOMMENDED)。
Each application of JWTs defines a profile specifying the required and optional JWT claims and the validation rules associated with them. If more than one kind of JWT can be issued by the same issuer, the validation rules for those JWTs MUST be written such that they are mutually exclusive, rejecting JWTs of the wrong kind. To prevent substitution of JWTs from one context into another, application developers may employ a number of strategies:
JWTの各アプリケーションは、必須およびオプションのJWTクレームと、それらに関連する検証ルールを指定するプロファイルを定義します。 同じissuerによって複数の種類のJWTが発行される場合、それらのJWTの検証ルールは相互に排他的であるように記述し、誤った種類のJWTを拒否しなければなりません(MUST)。 JWTのコンテキストから別のコンテキストにJWTが置き換えられることを防ぐために、アプリケーション開発者は、いくつかの戦略を使用できます。
Given the broad diversity of JWT usage and applications, the best combination of types, required claims, values, Header Parameters, key usages, and issuers to differentiate among different kinds of JWTs will, in general, be application-specific. As discussed in Section 3.11, for new JWT applications, the use of explicit typing is RECOMMENDED.
JWTの使用とアプリケーションの多様性を考慮すると、異なる種類のJWTを区別するための最適な組み合わせは、一般にアプリケーション固有のものになります。 新しいJWTアプリケーションについては、Section 3.11で説明されているように、明示的なタイプ指定推奨されます(RECOMMENDED)。
This entire document is about security considerations when implementing and deploying JSON Web Tokens.
JSON Web Tokensを実装および展開する際のセキュリティーに関する考慮事項について、この文書全体が説明しています。
This document has no IANA actions.
この文書にはIANAアクションはありません。
Thanks to Antonio Sanso for bringing the "ECDH-ES" invalid point attack to the attention of JWE and JWT implementers. Tim McLean published the RSA/HMAC confusion attack [McLean]. Thanks to Nat Sakimura for advocating the use of explicit typing. Thanks to Neil Madden for his numerous comments, and to Carsten Bormann, Brian Campbell, Brian Carpenter, Alissa Cooper, Roman Danyliw, Ben Kaduk, Mirja Kühlewind, Barry Leiba, Eric Rescorla, Adam Roach, Martin Vigoureux, and Éric Vyncke for their reviews.
Antonio Sanso氏による「ECDH-ES」無効なポイント攻撃をJWEおよびJWTの実装者の注目にもたらしたことに感謝します。Tim McLean氏はRSA/HMAC混乱攻撃を公開しました[McLean]。明示的な型指定の使用を提唱したNat Sakimura氏に感謝します。Neil Madden氏には多数のコメントをいただき、Carsten Bormann氏、Brian Campbell氏、Brian Carpenter氏、Alissa Cooper氏、Roman Danyliw氏、Ben Kaduk氏、Mirja Kühlewind氏、Barry Leiba氏、Eric Rescorla氏、Adam Roach氏、Martin Vigoureux氏、およびÉric Vyncke氏にはレビューいただきました。