Vulnerability in fastify (CVE-2025-32442)
Summary
Vulnerability in fastify (CVE-2025-32442). Data can be tampered with by attackers. Mitigation: upgrade to 5.3.1 or later.
Original description
The description as published by the source.
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:
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:
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?
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2025-32442 has been found in fastify.
Data can be tampered with by attackers.
What to do: upgrade fastify to 5.3.1 or later.
If unsure, ask your IT team or search "fastify CVE-2025-32442" on the vendor's site.
CVE-2025-32442 (fastify) — CWE-1287
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Patched: 5.3.1 — apply immediately
Workaround: Do not specify multiple content types in the schema.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-1287) exists in fastify.
Check the vendor advisory for the affected versions of fastify.
Severity: ?. Data can be tampered with by attackers.
Update to 5.3.1.
Workaround: Do not specify multiple content types in the schema.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'fastify' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'fastify' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
fastifyを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
Do not specify multiple content types in the schema.パッチが適用されるまでの応急処置として、Do not specify multiple content types in the schema. を実施。回避策の副作用 (機能低下) を確認した上で。
-
3Apply patch patch
Upgrade fastify to 5.3.1ステージング環境で 5.3.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web cna.openjsf.org
- web github.com
- web github.com
- web hackerone.com