GHSA-hgxv-3497-3hhj: Duplicate Advisory @fastify/oauth2 Oauth2 State Parameter Reuse Vulnerability
MODERATEGHSA-hgxv-3497-3hhj is a MODERATE @fastify/oauth2 oauth2 state parameter reuse vulnerability (General Security Weakness) affecting Duplicate Advisory libraries in the npm ecosystem. The issue involves @fastify/oauth2 oauth2 state parameter reuse. Remediation is available by upgrading affected packages to version 7.2.0.
GHSA-hgxv-3497-3hhj at a Glance
How to Fix GHSA-hgxv-3497-3hhj
To remediate this vulnerability, upgrade all affected Duplicate Advisory 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/oauth2@7.2.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @fastify/oauth2
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-hgxv-3497-3hhj, inspect your project dependencies using npm:
npm ls @fastify/oauth2
Analyze the terminal output to locate any version of Duplicate Advisory in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.2.0), your application is affected.
Note: The npm ls @fastify/oauth2 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 General Security Weakness. In Duplicate Advisory, 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
GHSA-hgxv-3497-3hhj Affected Duplicate Advisory Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@fastify/oauth2
|
npm |
< 7.2.0
|
7.2.0
|
References
Frequently Asked Questions
What is GHSA-hgxv-3497-3hhj?
Which Duplicate Advisory versions are affected?
What version fixes GHSA-hgxv-3497-3hhj?
Is @fastify/oauth2 affected?
What CWE is associated with GHSA-hgxv-3497-3hhj?
How can I check npm dependencies for GHSA-hgxv-3497-3hhj?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hgxv-3497-3hhj",
"modified" : "2023-07-06T20:39:13Z",
"published" : "2023-07-04T18:30:58Z",
"withdrawn" : "2023-07-06T20:38:21Z",
"aliases" : [ ],
"summary" : "Duplicate Advisory: @fastify/oauth2 Oauth2 state parameter reuse",
"details" : "## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-g8x5-p9qc-cf95. This link is maintained to preserve external references.\n\n## Original Description\nAll versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all requests for all users. The purpose of the Oauth2 state parameter is to prevent Cross-Site-Request-Forgery attacks. As such, it should be unique per user and should be connected to the user's session in some way that will allow the server to validate it.\n\nv7.2.0 changes the default behavior to store the state in a cookie with the http-only and same-site=lax attributes set. The state is now by default generated for every user. Note that this contains a breaking change in the checkStateFunction function, which now accepts the full Request object.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@fastify/oauth2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-31999"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/2020418"
}, {
"type" : "WEB",
"url" : "https://auth0.com/docs/secure/attack-protection/state-parameters"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fastify/fastify-oauth2"
}, {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-oauth2/releases/tag/v7.2.0"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-07-06T20:38:21Z",
"nvd_published_at" : "2023-07-04T17:15:10Z"
}
}