CVE-2023-29019: @fastify/passport Session Fixation Vulnerability
HIGHCVE-2023-29019 is a HIGH (CVSS 8.1) session fixation vulnerability (CWE-384: Session Fixation) affecting @fastify/passport libraries in the npm ecosystem. The issue involves session fixation in fastify-passport. Remediation is available by upgrading affected packages to version 1.1.0, 2.3.0.
CVE-2023-29019 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2023-29019
To remediate this vulnerability, upgrade all affected @fastify/passport 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 @fastify/passport@1.1.0
npm install @fastify/passport@2.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @fastify/passport
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-29019, inspect your project dependencies using npm:
npm ls @fastify/passport
Analyze the terminal output to locate any version of @fastify/passport in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.0), your application is affected.
Note: The npm ls @fastify/passport 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 @fastify/passport, 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-2023-29019 Affected @fastify/passport Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@fastify/passport
|
npm |
< 1.1.0
|
1.1.0
|
|
@fastify/passport
|
npm |
≥ 2.0.0
< 2.3.0
|
2.3.0
|
References
Frequently Asked Questions
What is CVE-2023-29019?
Which @fastify/passport versions are affected?
What version fixes CVE-2023-29019?
Is @fastify/passport affected?
What is the CVSS score of CVE-2023-29019?
What CWE is associated with CVE-2023-29019?
How can I check npm dependencies for CVE-2023-29019?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4m3m-ppvx-xgw9",
"modified" : "2023-04-24T15:56:25Z",
"published" : "2023-04-21T22:33:30Z",
"aliases" : [ "CVE-2023-29019" ],
"summary" : "Session fixation in fastify-passport",
"details" : "Applications using `@fastify/passport` for user authentication, in combination with `@fastify/session` as the underlying session management mechanism, are vulnerable to [session fixation attacks](https://owasp.org/www-community/attacks/Session_fixation) from network and same-site attackers.\n\n## Details\nfastify applications rely on the `@fastify/passport` library for user authentication. The login and user validation are performed by the `authenticate` function. When executing this function, the `sessionId` is preserved between the pre-login and the authenticated session. Network and [same-site attackers](https://canitakeyoursubdomain.name/) can hijack the victim's session by tossing a valid `sessionId` cookie in the victim's browser and waiting for the victim to log in on the website.\n\n## Fix\nAs a solution, newer versions of `@fastify/passport` regenerate `sessionId` upon login, preventing the attacker-controlled pre-session cookie from being upgraded to an authenticated session.\n\n## Credits\n* Pedro Adão (@pedromigueladao), [Instituto Superior Técnico, University of Lisbon](https://tecnico.ulisboa.pt/)\n* Marco Squarcina (@lavish), [Security & Privacy Research Unit, TU Wien](https://secpriv.wien/)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@fastify/passport"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "@fastify/passport"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.3.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-passport/security/advisories/GHSA-4m3m-ppvx-xgw9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-29019"
}, {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-passport/commit/43c82c321db58ea3e375dd475de60befbfcf2a11"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fastify/fastify-passport"
}, {
"type" : "WEB",
"url" : "https://owasp.org/www-community/attacks/Session_fixation"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-384" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-04-21T22:33:30Z",
"nvd_published_at" : "2023-04-21T23:15:20Z"
}
}