CVE-2021-41246: Express openid connect Session Fixation Vulnerability
MODERATECVE-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
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).
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.
npm install express-openid-connect@2.5.2
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
CVE-2021-41246 Affected Express openid connect Versions
1 component(s)| 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?
Which Express openid connect versions are affected?
What version fixes CVE-2021-41246?
Is express-openid-connect affected?
What is the CVSS score of CVE-2021-41246?
What CWE is associated with CVE-2021-41246?
How can I check npm dependencies for CVE-2021-41246?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}