Categories
CVE-2025-32442

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?

https://hackerone.com/reports/3087928

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.

❓ What is the problem

A vulnerability (CWE-1287) exists in fastify.

📍 Affected scope

Check the vendor advisory for the affected versions of fastify.

🔥 Severity

Severity: ?. Data can be tampered with by attackers.

🔧 How to fix

Update to 5.3.1.

🛡️ Workaround

Workaround: Do not specify multiple content types in the schema.

🔍 Detection

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

  1. 1
    Identify exposure identify
    grep -r 'fastify' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で fastify を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply temporary workaround mitigate
    Do not specify multiple content types in the schema.

    パッチが適用されるまでの応急処置として、Do not specify multiple content types in the schema. を実施。回避策の副作用 (機能低下) を確認した上で。

  3. 3
    Apply patch patch
    Upgrade fastify to 5.3.1

    ステージング環境で 5.3.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  4. 4
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

npm fastify
[{"type":"SEMVER","events":[{"introduced":"4.29.0"},{"fixed":"4.29.1"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details