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

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N

EPSS score

0.197%
(58th percentile)

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.