CVE-2023-51701: @fastify/reply from @fastify/reply-from JSON Content-Type Parsing Confusion Vulnerability
MODERATECVE-2023-51701 is a MODERATE (CVSS 5.3) @fastify/reply-from json content-type parsing confusion vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting @fastify/reply from libraries in the npm ecosystem. The issue involves @fastify/reply-from json content-type parsing confusion. Remediation is available by upgrading affected packages to version 9.6.0.
CVE-2023-51701 at a Glance
Security Impact
CVSS: 5.3
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:U/C:L/I:N/A:N).
How to Fix CVE-2023-51701
To remediate this vulnerability, upgrade all affected @fastify/reply from 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/reply-from@9.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @fastify/reply-from
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-51701, inspect your project dependencies using npm:
npm ls @fastify/reply-from
Analyze the terminal output to locate any version of @fastify/reply from in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.6.0), your application is affected.
Note: The npm ls @fastify/reply-from 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-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. In @fastify/reply from, 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-51701 Affected @fastify/reply from Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@fastify/reply-from
|
npm |
< 9.6.0
|
9.6.0
|
References
Frequently Asked Questions
What is CVE-2023-51701?
Which @fastify/reply from versions are affected?
What version fixes CVE-2023-51701?
Is @fastify/reply-from affected?
What is the CVSS score of CVE-2023-51701?
What CWE is associated with CVE-2023-51701?
How can I check npm dependencies for CVE-2023-51701?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v2v2-hph8-q5xp",
"modified" : "2024-01-08T15:55:16Z",
"published" : "2024-01-08T15:22:40Z",
"aliases" : [ "CVE-2023-51701" ],
"summary" : "@fastify/reply-from JSON Content-Type parsing confusion",
"details" : "### Impact\n\nThe main repo of fastify use [fast-content-type-parse](https://github.com/fastify/fast-content-type-parse) to parse request Content-Type, which will [trim after split](https://github.com/fastify/fast-content-type-parse/blob/2776d054dd48e9ce40b8d5e5ff9b46fee82b95f1/index.js#L59).\n\nThe [fastify-reply-from](https://github.com/fastify/fastify-reply-from/blob/b79a22d6eb9a0b52cfbe8eb2cb22ad65f5a39e64/index.js#L118C14-L118C14) have not use this repo to unify the parse of Content-Type, which [won't trim](https://github.com/fastify/fastify-reply-from/blob/b79a22d6eb9a0b52cfbe8eb2cb22ad65f5a39e64/index.js#L118C14-L118C14).\n\nAs a result, a reverse proxy server built with `@fastify/reply-from` could misinterpret the incoming body by passing an header `ContentType: application/json ; charset=utf-8`. This can lead to bypass of security checks.\n\n### Patches\n\n`@fastify/reply-from` v9.6.0 include the fix. \n\n### Workarounds\n\nThere are no known workarounds.\n\n### References\n\nHackerone Report: https://hackerone.com/reports/2295770.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@fastify/reply-from"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-reply-from/security/advisories/GHSA-v2v2-hph8-q5xp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-51701"
}, {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-reply-from/commit/cbd7c17c09e6476268e34f5e499a6b923e8acc18"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fastify/fastify-reply-from"
}, {
"type" : "WEB",
"url" : "https://github.com/fastify/fastify-reply-from/releases/tag/v9.6.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-444" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-08T15:22:40Z",
"nvd_published_at" : "2024-01-08T14:15:46Z"
}
}