fastify vulnerable to denial of service via malicious Content-Type
Impact
An attacker can send an invalid Content-Type header that can cause the application to crash, leading to a possible Denial of Service attack. Only the v4.x line is affected.
(This was updated: upon a close inspection, v3.x is not affected after all).
Patches
Yes, update to > v4.8.0.
Workarounds
You can reject the malicious content types before the body parser enters in action.
const badNames = Object.getOwnPropertyNames({}.__proto__)
fastify.addHook('onRequest', async (req, reply) => {
for (const badName of badNames) {
if (req.headers['content-type'].indexOf(badName) > -1) {
reply.code(415)
throw new Error('Content type not supported')
}
}
})
References
See the HackerOne report #1715536
For more information
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| npm-Paket | fastify | >= 4.0.0, < 4.8.1 | 4.8.1 |
Verweise
- https://github.com/fastify/fastify/security/advisories/GHSA-455w-c45v-86rg
- https://nvd.nist.gov/vuln/detail/CVE-2022-39288
- https://github.com/fastify/fastify/commit/fbb07e8dfad74c69cd4cd2211aedab87194618e3
- https://github.com/fastify/fastify
- https://github.com/fastify/fastify/security/policy
- https://hackerone.com/bugs?report_id=1715536&subject=fastify
- CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H- Schwäche (CWE)
CWE-754- Plattform
- npm
- Paket
fastify- Veröffentlicht
- 11.10.2022
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-455w-c45v-86rg - CC BY 4.0
Schwachstellenhistorie: fastify
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
- Einträge insgesamt
- 16
- Erste → letzte
- 07.2018 09.2026
- Ohne Fix
- 0
- In Angriffen ausgenutzt
- 0
Verteilung nach Schweregrad
- Hoch 8
- Mittel 7
- Niedrig 1
Veröffentlichungen pro Jahr
- 2018: 1
- 2019: 0
- 2020: 1
- 2021: 0
- 2022: 2
- 2023: 0
- 2024: 0
- 2025: 1
- 2026: 11
-
fastify vulnerable to denial of service via malicious Content-Type dieser Eintrag
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.