CVE-2021-41246: Express openid connect Session Fixation Vulnerability

MODERATE
Advisory Identifier: GHSA-7rg2-qxmf-hhx9
CVSS 4.6
CWE-384
Published
Advisory Summary

CVE-2021-41246 is a MODERATE (CVSS 4.6) session fixation vulnerability (CWE-384: Session Fixation) affecting Express openid connect libraries in the npm ecosystem. The issue involves session fixation in express-openid-connect. Remediation is available by upgrading affected packages to version 2.5.2.

CVE-2021-41246 at a Glance

CVE Identifier CVE-2021-41246
GHSA Identifier GHSA-7rg2-qxmf-hhx9
Severity MODERATE
CVSS v3.1 Base Score 4.6
CWE Classification CWE-384: Session Fixation
Affected Product Express openid connect
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.6

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

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

How to Fix CVE-2021-41246

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.5.2
npm install express-openid-connect@2.5.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-2021-41246, 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.5.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-384: Session Fixation, where authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions. 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

### Overview Versions `2.3.0` up to and including `2.5.1` do not regenerate the session id and session cookie when user logs in. This behavior opens up the application to various session fixation vulnerabilities. ### Am I affected? You are affected by this vulnerability if you are using `express-openid-connect` version `2.3.0` up to and including `2.5.1` and use a custom session store. ### How to fix that? Upgrade to version `>= 2.5.2`. ### Will this update impact my users? The fix provided in patch will not affect your users.

CVE-2021-41246 Affected Express openid connect Versions

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

References

Frequently Asked Questions

What is CVE-2021-41246?
CVE-2021-41246 is a security vulnerability in Express openid connect involving Session fixation in express-openid-connect under CWE-384: Session Fixation.
Which Express openid connect versions are affected?
Affected versions include releases prior to 2.5.2 across affected packages: express-openid-connect.
What version fixes CVE-2021-41246?
Upgrading to 2.5.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.5.2. Upgrade your dependency to 2.5.2 or later.
What is the CVSS score of CVE-2021-41246?
CVE-2021-41246 has a CVSS v3.1 base score of 4.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2021-41246?
CVE-2021-41246 is classified under CWE-384: Session Fixation (Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions.).
How can I check npm dependencies for CVE-2021-41246?
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-7rg2-qxmf-hhx9",
  "modified" : "2021-12-15T15:28:49Z",
  "published" : "2021-12-09T19:08:58Z",
  "aliases" : [ "CVE-2021-41246" ],
  "summary" : "Session fixation in express-openid-connect",
  "details" : "### Overview\n\nVersions `2.3.0` up to and including `2.5.1` do not regenerate the session id and session cookie when user logs in.  This behavior opens up the application to various session fixation vulnerabilities.\n\n### Am I affected?\nYou are affected by this vulnerability if you are using `express-openid-connect` version `2.3.0` up to and including `2.5.1` and use a custom session store.\n\n\n### How to fix that?\nUpgrade to version `>= 2.5.2`.\n\n### Will this update impact my users?\nThe fix provided in patch will not affect your users.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "express-openid-connect"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.5.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/auth0/express-openid-connect/security/advisories/GHSA-7rg2-qxmf-hhx9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41246"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/auth0/express-openid-connect/commit/5ab67ff2bd84f76674066b5e129b43ab5f2f430f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/auth0/express-openid-connect"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/auth0/express-openid-connect/releases/tag/v2.5.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-384" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-12-09T18:09:56Z",
    "nvd_published_at" : "2021-12-09T16:15:00Z"
  }
}