CVE-2022-39288: Fastify denial of service via malicious Content-Type

CVE-2022-39288 · Severity: low · CVSS 3.1 · Published 2022-10-11

Fastify is a popular Node.js web framework used to build fast and low-overhead web applications. An attacker can craft a malicious Content-Type HTTP header that causes the application to crash, leading to a denial of service attack that renders the web service unavailable. No authentication or user interaction is required; the attack can be initiated directly over the network.

Technologies: fastify (npm). Vendors: npm.

Quick answers

Is CVE-2022-39288 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-39288 being exploited in the wild.
How severe is CVE-2022-39288?
Low severity, with a CVSS score of 3.1, published 11 October 2022.
Which products and versions are affected?
fastify (npm) SEMVER:introduced=4.0.0,fixed=4.8.1.
Is there a fix for CVE-2022-39288?
Yes. fastify (npm): upgrade to 4.8.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2022-39288 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2022-39288?
Check whether you run fastify (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • fastify (npm): upgrade to 4.8.1 or later
    npm install fastify@4.8.1

Technical details

The vulnerability is an improper exception handling flaw (CWE-754) in Fastify's content type parser. The root cause lies in insufficient validation of Content-Type header values before they are processed by the body parser. An attacker can supply a malicious Content-Type header containing prototype pollution-related keywords (such as __proto__ or constructor properties) that trigger an unhandled exception when the parser attempts to process the value, crashing the entire application. The attack vector is network-based, requires no authentication or user interaction, and affects only the 4.x version branch (v3.x is not affected). The issue was patched in version 4.8.1 by adding safeguards against malicious content types in the content type parser logic.

Affected products

  • Fastify fastify >=4.0.0, <4.8.1

Identifiers

  • CVE-2022-39288
  • GHSA-455w-c45v-86rg

Timeline

  • 2022-10-11: disclosed
  • 2022-10-10: patched: fix committed on 2022-10-10; patch released in version 4.8.1

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.