Skip to content

Authorization bypass in express-jwt

High severity GitHub Reviewed Published Jun 29, 2020 in auth0/express-jwt • Updated Feb 2, 2023

Package

npm express-jwt (npm)

Affected versions

<= 5.3.3

Patched versions

6.0.0

Description

Overview

Versions before and including 5.3.3, we are not enforcing the algorithms entry to be specified in the configuration.
When algorithms is not specified in the configuration, with the combination of jwks-rsa, it may lead to authorization bypass.

Am I affected?

You are affected by this vulnerability if all of the following conditions apply:

You are using express-jwt
AND
You do not have algorithms configured in your express-jwt configuration.
AND
You are using libraries such as jwks-rsa as the secret.

How to fix that?

Specify algorithms in the express-jwt configuration. The following is an example of a proper configuration

const checkJwt = jwt({
  secret: jwksRsa.expressJwtSecret({
    rateLimit: true,
    jwksRequestsPerMinute: 5,
    jwksUri: `https://${DOMAIN}/.well-known/jwks.json`
  }),
  // Validate the audience and the issuer.
  audience: process.env.AUDIENCE,
  issuer: `https://${DOMAIN}/`,
  // restrict allowed algorithms
  algorithms: ['RS256']
}); 

Will this update impact my users?

The fix provided in patch will not affect your users if you specified the algorithms allowed. The patch now makes algorithms a required configuration.

Credit

IST Group

References

@gkwang gkwang published to auth0/express-jwt Jun 29, 2020
Reviewed Jun 30, 2020
Published to the GitHub Advisory Database Jun 30, 2020
Published by the National Vulnerability Database Jun 30, 2020
Last updated Feb 2, 2023

Severity

High
7.7
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N

CVE ID

CVE-2020-15084

GHSA ID

GHSA-6g6m-m6h5-w9gf

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.