Vulnerabilities in pkg:npm/fastify-static
PACKAGECVE-2021-22963 is a MODERATE (CVSS 6.1) url redirection to untrusted site vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Fastify static libraries in the npm ecosystem. The issue involves url redirection to untrusted site ('open redirect') in fastify-static. Remediation is available by upgrading affected packages to version 4.2.4.
pkg:npm/fastify-static
Vulnerability advisories affecting package pkg:npm/fastify-static. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-p6vg-p826-qp3v | CVE-2021-22963 | MODERATE | URL Redirection to Untrusted Site ('Open Redirect') in fastify-static |
| GHSA-pgh6-m65r-2rhq | CVE-2021-22964 | HIGH | DOS and Open Redirect with user input |
CVE-2021-22963 at a Glance
Security Impact
CVSS: 6.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:C/C:L/I:L/A:N).
How to Fix CVE-2021-22963
To remediate this vulnerability, upgrade all affected Fastify static 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-static@4.2.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls fastify-static
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-22963, inspect your project dependencies using npm:
npm ls fastify-static
Analyze the terminal output to locate any version of Fastify static in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.4), your application is affected.
Note: The npm ls fastify-static 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Fastify static, 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-22963 Affected Fastify static Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
fastify-static
|
npm |
< 4.2.4
|
4.2.4
|
References
Frequently Asked Questions
What is CVE-2021-22963?
Which Fastify static versions are affected?
What version fixes CVE-2021-22963?
Is fastify-static affected?
What is the CVSS score of CVE-2021-22963?
What CWE is associated with CVE-2021-22963?
How can I check npm dependencies for CVE-2021-22963?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-p6vg-p826-qp3v",
"modified" : "2021-10-21T15:01:19Z",
"published" : "2021-10-05T20:24:49Z",
"aliases" : [ "CVE-2021-22963" ],
"summary" : "URL Redirection to Untrusted Site ('Open Redirect') in fastify-static",
"details" : "### Impact\n\nA redirect vulnerability in the `fastify-static` module allows remote attackers to redirect Mozilla Firefox users to arbitrary websites via a double slash `//` followed by a domain: `http://localhost:3000//google.com/%2e%2e`.\n\nThe issue shows up on all the `fastify-static` applications that set `redirect: true` option. By default, it is `false`.\n\n### Patches\nThe issue has been patched in `fastify-static@4.2.4`\n\n### Workarounds\nIf updating is not an option, you can sanitize the input URLs using the [`rewriteUrl`](https://www.fastify.io/docs/latest/Server/#rewriteurl) server option.\n\n### References\n\n+ Bug founder: drstrnegth\n+ [hackerone Report](https://hackerone.com/reports/1354255)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [fastify-static](https://github.com/fastify/fastify-static)\n* Contact the [security team](https://github.com/fastify/fastify/blob/main/SECURITY.md#the-fastify-security-team)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "fastify-static"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.2.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-static/security/advisories/GHSA-p6vg-p826-qp3v"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-22963"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/1354255"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fastify/fastify-static"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-10-05T18:55:33Z",
"nvd_published_at" : "2021-10-14T15:15:00Z"
}
}