CVE-2025-32442: Fastify vulnerable to invalid content-type parsing, which could lead to validation bypass

Published Apr 18, 2025
·
Updated

Impact

In applications that specify different validation strategies for different content types, it's possible to bypass the validation by providing a slightly altered content type such as with different casing or altered whitespacing before ;.

Users using the the following pattern are affected:

js fastify.post('/', { handler(request, reply) { reply.code(200).send(request.body) }, schema: { body: { content: { 'application/json': { schema: { type: 'object', properties: { 'foo': { type: 'string', } }, required: ['foo'] } }, } } } })

User using the following pattern are not affected:

js fastify.post('/', { handler(request, reply) { reply.code(200).send(request.body) }, schema: { body: { type: 'object', properties: { 'foo': { type: 'string', } }, required: ['foo'] } } })

Patches

This was patched in v5.3.1, but unfortunately it did not cover all problems. This has been fully patched in v5.3.2. Version v4.9.0 was also affected by this issue. This has been fully patched in v4.9.1.

Workarounds

Do not specify multiple content types in the schema.

References Are there any links users can visit to find out more?

https://hackerone.com/reports/3087928

Other sources

Fastify is a fast and low overhead web framework, for Node.js. In versions 5.0.0 to 5.3.0 as well as version 4.29.0, applications that specify different validation strategies for different content types have a possibility to bypass validation by providing a slightly altered content type such as with different casing or altered whitespacing before ;. This was patched in v5.3.1, but the initial patch did not cover all problems. This has been fully patched in v5.3.2 and v4.29.1. A workaround involves not specifying individual content types in the schema.

MITRE

Affected Software

4 affected componentsFixes available
npm/fastify=4.29.0
4.29.1
npm/fastify>=5.0.0<=5.3.1
5.3.2
fastify Fastify Node.js>=5.0.0<5.3.2
fastify Fastify Node.js=4.29.0

Event History

Apr 18, 2025
Advisory Published
via GitHub·03:02 PM
CVE Published
via MITRE·03:59 PM
Data Sourced
via MITRE·03:59 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-32442?

CVE-2025-32442 is classified as a moderate severity vulnerability due to its potential for content validation bypass.

2

How do I fix CVE-2025-32442?

To fix CVE-2025-32442, upgrade to fastify version 5.3.1 or later.

3

What type of applications are affected by CVE-2025-32442?

Applications using fastify with varying content validation strategies for different content types are affected by CVE-2025-32442.

4

Can CVE-2025-32442 be exploited remotely?

Yes, CVE-2025-32442 can potentially be exploited remotely by altering content type headers.

5

What specific fastify versions are vulnerable to CVE-2025-32442?

Fastify versions between 5.0.0 and 5.3.0 are vulnerable to CVE-2025-32442.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203