Vulnerabilities in pkg:npm/fastify-http-proxy
PACKAGECVE-2021-21322 is a LOW (CVSS 10.0) prefix escape vulnerability (CWE-20: Improper Input Validation) affecting Fastify http proxy libraries in the npm ecosystem. The issue involves prefix escape. Remediation is available by upgrading affected packages to version 4.3.1.
pkg:npm/fastify-http-proxy
Vulnerability advisories affecting package pkg:npm/fastify-http-proxy. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-c4qr-gmr9-v23w | CVE-2021-21322 | LOW | Prefix escape |
CVE-2021-21322 at a Glance
Security Impact
CVSS: 10.0
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:N/S:C/C:H/I:H/A:N).
How to Fix CVE-2021-21322
To remediate this vulnerability, upgrade all affected Fastify http proxy 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-http-proxy@4.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls fastify-http-proxy
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-21322, inspect your project dependencies using npm:
npm ls fastify-http-proxy
Analyze the terminal output to locate any version of Fastify http proxy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.3.1), your application is affected.
Note: The npm ls fastify-http-proxy 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Fastify http proxy, 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-21322 Affected Fastify http proxy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
fastify-http-proxy
|
npm |
< 4.3.1
|
4.3.1
|
References
Frequently Asked Questions
What is CVE-2021-21322?
Which Fastify http proxy versions are affected?
What version fixes CVE-2021-21322?
Is fastify-http-proxy affected?
What is the CVSS score of CVE-2021-21322?
What CWE is associated with CVE-2021-21322?
How can I check npm dependencies for CVE-2021-21322?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c4qr-gmr9-v23w",
"modified" : "2021-03-02T03:32:25Z",
"published" : "2021-03-03T02:18:08Z",
"aliases" : [ "CVE-2021-21322" ],
"summary" : "Prefix escape",
"details" : "### Impact\n\nBy crafting a specific URL, it is possible to escape the prefix of the proxied backend service.\nIf the base url of the proxied server is `/pub/`, a user expect that accessing `/priv` on the target service would not be possible. Unfortunately, it is.\n\n[CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N)\n\n### Patches\n\nAll releases after v4.3.1 include the fix.\n\n### Workarounds\n\nThere are no workaround available.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [fastify-reply-from](https://github.com/fastify/fastify-reply-from)\n* Email us at [hello@matteocollina.com](mailto:hello@matteocollina.com)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "fastify-http-proxy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-http-proxy/security/advisories/GHSA-c4qr-gmr9-v23w"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21322"
}, {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-http-proxy/commit/02d9b43c770aa16bc44470edecfaeb7c17985016"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/fastify-http-proxy"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2021-03-02T03:32:25Z",
"nvd_published_at" : "2021-03-02T04:15:00Z"
}
}