You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Critical Vulnerability in JSON Web Encryption
136
140
Valenta:
137
141
author:
138
142
- ins: L. Valenta
@@ -280,7 +284,7 @@ For mitigations, see {{algorithm-verification}} and {{appropriate-algorithms}}.
280
284
"HS256", to sign tokens but supply a weak symmetric key with
281
285
insufficient entropy (such as a human-memorable password). Such keys
282
286
are vulnerable to offline brute-force or dictionary attacks once an
283
-
attacker gets hold of such a token {{Langkemper}}.
287
+
attacker gets hold of such a token {{Langkemper}}{{JWT-Cracker}}.
284
288
285
289
For mitigations, see {{key-entropy}}.
286
290
@@ -610,18 +614,13 @@ If the issuer, subject, or the pair are invalid, the application
610
614
611
615
612
616
If the same issuer can issue JWTs that are intended for use by more
613
-
than one relying party or application,
617
+
than one relying party or application, or may do so in the future,
614
618
the JWT MUST contain an "aud" (audience) claim that can be used
615
619
to determine whether the JWT
616
620
is being used by an intended party or was substituted by an attacker.
617
621
618
-
In such cases, the relying party or application MUST
619
-
validate the audience value,
620
-
and if the audience value is not present or not associated with the recipient,
621
-
it MUST reject the JWT.
622
-
623
-
624
-
622
+
In such cases, the relying party or application MUST validate the audience value, and if no audience
623
+
value is present or none of the values are associated with the recipient, it MUST reject the JWT.
625
624
626
625
## Do Not Trust Received Claims {#do-not-trust-claims}
627
626
@@ -652,13 +651,13 @@ For instance, the {{RFC8417}} specification uses
652
651
the "application/secevent+jwt" media type
653
652
to perform explicit typing of Security Event Tokens (SETs).
654
653
655
-
Per the definition of "typ" in Section 4.1.9 of {{RFC7515}},
656
-
it is RECOMMENDED that the "application/" prefix be omitted from the "typ" value.
654
+
Per the definition of "typ" in Section 4.1.9 of [RFC7515], it is RECOMMENDED that the "application/" prefix
655
+
be omitted from the "typ" Header Parameter value, compared to the associated media type.
657
656
Therefore, for example, the "typ" value used to explicitly include a type for a SET SHOULD be "secevent+jwt".
658
-
When explicit typing is employed for a JWT, it is RECOMMENDED
659
-
that a media type name of the format
660
-
"application/example+jwt"be used, where "example" is replaced by the
661
-
identifier for the specific kind of JWT.
657
+
658
+
When explicit typing is employed for a JWT, it is RECOMMENDED that a media type name of the
659
+
format "application/example+jwt" be used, where "example" is replaced by the identifier for the
660
+
specific kind of JWT. Therefore, for example, the media type name for a SET SHOULD be "application/secevent+jwt".
662
661
663
662
When applying explicit typing to a Nested JWT, the "typ" Header
664
663
Parameter containing the explicit type value MUST be present in the inner JWT of the Nested JWT (the JWT
@@ -684,6 +683,7 @@ If more than one kind of JWT can be issued by the same issuer,
684
683
the validation rules for those JWTs MUST be written such that
685
684
they are mutually exclusive,
686
685
rejecting JWTs of the wrong kind.
686
+
687
687
To prevent substitution of JWTs from one context into another,
688
688
application developers may employ a number of strategies:
689
689
@@ -727,12 +727,16 @@ the number of hash iterations that can be performed
727
727
when validating encrypted content using PBES2 encryption algorithms,
728
728
so as to prevent attackers from imposing
729
729
an unreasonable computational burden on recipients.
730
-
{{OWASP-Password-Storage}} states that an iteration count of 600,000 is required when using HMAC-SHA-256 to achieve FIPS-140 compliance.
731
-
Thus, rejecting inputs with a `p2c` (PBES2 Count) value over 1,200,000 (double that) is RECOMMENDED.
730
+
{{OWASP-Password-Storage}} states a specific iteration count (600,000 at time of publishing)
731
+
is required when using HMAC-SHA-256 to achieve FIPS-140 compliance. Rejecting inputs with a `p2c`
732
+
(PBES2 Count) value larger than double the recommended OWASP value is RECOMMENDED.
732
733
733
734
## Check JWT Format Type {#token-format}
734
735
735
-
Implementations MUST confirm the JWT is in a legal format while parsing it. Legal JWTs contain only the ASCII characters for letters, numbers, dash, underscore, and period. Content with any other characters - especially braces and quotation marks - is not a JWT and MUST be rejected.
736
+
Implementations MUST confirm the JWT is in a legal format while parsing it. Legal JWTs,
737
+
being dot-concatenated base64url strings, contain only the ASCII characters for letters, numbers, dash,
738
+
underscore, and period. Content with any other characters - especially braces and quotation
0 commit comments