CVE-2022-24794: Express openid connect URL Redirection To Untrusted Site Vulnerability

HIGH
Advisory Identifier: GHSA-7p99-3798-f85c
CVSS 7.5
CWE-601
Published
Advisory Summary

CVE-2022-24794 is a HIGH (CVSS 7.5) url redirection to untrusted site vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Express openid connect libraries in the npm ecosystem. The issue involves url redirection to untrusted site ('open redirect') in express-openid-connect. Remediation is available by upgrading affected packages to version 2.7.2.

CVE-2022-24794 at a Glance

CVE Identifier CVE-2022-24794
GHSA Identifier GHSA-7p99-3798-f85c
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Express openid connect
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2022-24794

To remediate this vulnerability, upgrade all affected Express openid connect dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

express-openid-connect fixed: 2.7.2
npm install express-openid-connect@2.7.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls express-openid-connect

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-24794, inspect your project dependencies using npm:

npm ls express-openid-connect

Analyze the terminal output to locate any version of Express openid connect in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.2), your application is affected.

Note: The npm ls express-openid-connect command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Express openid connect, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Users of the `requiresAuth` middleware, either directly or through the default `authRequired` option, are vulnerable to an Open Redirect when the middleware is applied to a catch all route. If all routes under `example.com` are protected with the `requiresAuth` middleware, a visit to `http://example.com//google.com` will be redirected to `google.com` after login because the original url reported by the Express framework is not properly sanitised. ### Am I affected? You are affected by this vulnerability if you are using the `requiresAuth` middleware on a catch all route or the default `authRequired` option and `express-openid-connect` version `<=2.7.1`. ### How to fix that? Upgrade to version `>=2.7.2` ### Will this update impact my users? The fix provided in the patch will not affect your users.

CVE-2022-24794 Affected Express openid connect Versions

1 component(s)
Fixed Versions:
2.7.2
Product / Package Ecosystem Affected Versions Fixed Version
express-openid-connect
npm
< 2.7.2
2.7.2

References

Frequently Asked Questions

What is CVE-2022-24794?
CVE-2022-24794 is a security vulnerability in Express openid connect involving URL Redirection to Untrusted Site ('Open Redirect') in express-openid-connect under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Express openid connect versions are affected?
Affected versions include releases prior to 2.7.2 across affected packages: express-openid-connect.
What version fixes CVE-2022-24794?
Upgrading to 2.7.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is express-openid-connect affected?
Yes, express-openid-connect is affected in releases prior to 2.7.2. Upgrade your dependency to 2.7.2 or later.
What is the CVSS score of CVE-2022-24794?
CVE-2022-24794 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N.
What CWE is associated with CVE-2022-24794?
CVE-2022-24794 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check npm dependencies for CVE-2022-24794?
Run the dependency tree command: 'npm ls express-openid-connect'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7p99-3798-f85c",
  "modified" : "2022-03-31T22:44:47Z",
  "published" : "2022-03-31T22:44:47Z",
  "aliases" : [ "CVE-2022-24794" ],
  "summary" : "URL Redirection to Untrusted Site ('Open Redirect') in express-openid-connect",
  "details" : "### Impact\nUsers of the `requiresAuth` middleware, either directly or through the default `authRequired` option, are vulnerable to an Open Redirect when the middleware is applied to a catch all route.\n\nIf all routes under `example.com` are protected with the `requiresAuth` middleware, a visit to `http://example.com//google.com` will be redirected to `google.com` after login because the original url reported by the Express framework is not properly sanitised.\n\n### Am I affected?\nYou are affected by this vulnerability if you are using the `requiresAuth` middleware on a catch all route or the default `authRequired` option and `express-openid-connect` version `<=2.7.1`.\n\n### How to fix that?\nUpgrade to version `>=2.7.2`\n\n### Will this update impact my users?\nThe fix provided in the patch will not affect your users.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "express-openid-connect"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.7.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/auth0/express-openid-connect/security/advisories/GHSA-7p99-3798-f85c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24794"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/auth0/express-openid-connect/commit/0947b92164a2c5f661ebcc183d37e7f21de719ad"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/auth0/express-openid-connect"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-31T22:44:47Z",
    "nvd_published_at" : "2022-03-31T23:15:00Z"
  }
}