Subject: [OAUTH-WG] [Technical Errata Reported] RFC7519 (5906)

From: RFC Errata System <[email-masked]>
Date: Wed, 13 Nov 2019 14:28:01 -0800 (PST)

The following errata report has been submitted for RFC7519,
"JSON Web Token (JWT)".

--------------------------------------
You may review the report below and at:
https://www.rfc-editor.org/errata/eid5906

--------------------------------------
Type: Technical
Reported by: Erdem Memisyazici <[email-masked]>

Section: 7.2

Original Text
-------------
   Finally, note that it is an application decision which algorithms may
   be used in a given context.  Even if a JWT can be successfully
   validated, unless the algorithms used in the JWT are acceptable to
   the application, it SHOULD reject the JWT.

Corrected Text
--------------
   Finally, note that it is an application decision which algorithms may
   be used in a given context.  Even if a JWT can be successfully
   validated, unless the algorithms used in the JWT are acceptable to
   the application, it MUST reject the JWT.

Notes
-----
A vulnerability exists in certain implementations in the wild where applications simply look for valid JWT tokens which includes the "none" algorithm (https://medium.com/swlh/hacking-json-web-tokens-jwts-9122efe91e4a).  A fairly popular library is auth0's java-jwt and at verification (https://github.com/auth0/java-jwt/blob/master/lib/src/main/java/com/auth0/jwt/JWTVerifier.java) quite reasonably you cannot initialize the class without an algorithm.  Given all capital SHOULD may be interpreted as a recommendation and as this RFC dictates the algorithm "none" MUST be implemented as a default algorithm under Section 8, one could argue JWTVerifier in the example doesn't have to verifyAlgorithm leading to the vulnerability pointed out in the first article while still complying by the specification.  There is no good reason why an algorithm unacceptable to the application must not be rejected as it does more harm than good and all popular library implementations interpret it as such.

Instructions:
-------------
This erratum is currently posted as "Reported". If necessary, please
use "Reply All" to discuss whether it should be verified or
rejected. When a decision is reached, the verifying party  
can log in to change the status and edit the report, if necessary. 

--------------------------------------
RFC7519 (draft-ietf-oauth-json-web-token-32)
--------------------------------------
Title               : JSON Web Token (JWT)
Publication Date    : May 2015
Author(s)           : M. Jones, J. Bradley, N. Sakimura
Category            : PROPOSED STANDARD
Source              : Web Authorization Protocol
Area                : Security
Stream              : IETF
Verifying Party     : IESG