CVE-2022-25896: Vulnerability in passport package before 0.6.0
Summary
CVE-2022-25896: Passport vulnerable to session regeneration when a users logs in or out. Affects passport versions < 0.6.0. Fixed in 0.6.0. How to fix ↓
Also tracked for
- passportjs · Debian:11
The same CVE-2022-25896 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The passport package is an npm module that provides user authentication for Node.js applications. It is widely used to handle user login and session management. However, versions before 0.6.0 are vulnerable to a session regeneration issue when a user logs in or logs out.
Vulnerability Detail
The vulnerability in the passport package allows an attacker to regenerate the session instead of closing it when a user logs in or logs out. This can lead to session fixation attacks, where an attacker can hijack a user's session and impersonate them. The impact of this vulnerability is considered moderate, with a CVSS score of 4.8. The Common Weakness Enumeration (CWE) ID associated with this vulnerability is CWE-384.
How To Fix
Minimum fixed version
0.6.0
This is the first release that contains the fix.
npm install passport@0.6.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to upgrade to the fixed version of the passport package.
Conclusion
The passport package before version 0.6.0 is vulnerable to a session regeneration issue. This can lead to session fixation attacks, allowing an attacker to hijack a user's session. It is recommended to upgrade to version 0.6.0 or later of the passport package to fix this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for passport →
FAQ
The passport package is an npm module that provides user authentication for Node.js applications. It is widely used to handle user login and session management.
Session fixation is an attack where an attacker sets the session ID of a user before they authenticate, allowing the attacker to hijack the user's session.
The vulnerability allows an attacker to regenerate the session instead of closing it when a user logs in or logs out. This can lead to session fixation attacks, where an attacker can hijack a user's session and impersonate them.
The CVSS score of this vulnerability is 4.8, which is considered moderate.
To fix this vulnerability, developers should upgrade to version 0.6.0 or later of the passport package.