Read the docs

Type confusion in @fastify/multipart enables arbitrary file write

Priority MEDIUM 48CWE-22Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
None · High · None
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA.

Summary

@fastify/multipart from 7.4.0 before 10.1.9 is affected when registered with the attachFieldsToBody option. The saveRequestFiles helper treats any object in the parsed request body with truthy file and buffer properties as an uploaded file, a type confusion flaw (CWE-843). An unauthenticated remote attacker can forge such an object through a plain JSON request, so attacker-chosen bytes are written to the temporary directory without upload hooks or file limits. The saved filename is kept verbatim, so parent directory segments can cause an arbitrary relative-path file write in applications that use it as a destination (CWE-22).

Written with Claude Haiku 5.5 from the sources below · 2026-11-16

Description from the CNA

@fastify/multipart is the official Fastify plugin for handling multipart/form-data uploads. In versions 7.4.0 through 10.1.8, when the plugin is registered with the attachFieldsToBody option, the saveRequestFiles helper treats any object in the parsed request body that carries truthy file and buffer properties as an uploaded file. An unauthenticated client can forge such an object through a plain JSON request or a JSON-typed multipart field, so attacker-chosen bytes are written to the temporary directory while upload hooks and the file count and size limits are skipped, and the saved entry keeps the attacker's filename verbatim instead of being reduced to its basename. Because that filename can contain parent directory segments, applications that use it as a write destination, as the project README example does, are exposed to an arbitrary relative-path file write from a single request. The issue is fixed in @fastify/multipart 10.1.9, and users should upgrade to 10.1.9 or later. As a workaround, call saveRequestFiles only after confirming the request is multipart, and reduce each returned filename to its basename or validate it against an allowlist before using it as a destination.

Why it matters now

Fix Fixed @fastify/multipart (@fastify/multipart): 10.1.9

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
@fastify/multipart@fastify/multipart7.4.0 to before 10.1.910.1.9Patch availableCNA
  • @fastify/multipart Vendor@fastify/multipart Affected 7.4.0 to before 10.1.9 Fixed in 10.1.9 Patch available CNA

Remediation

Upgrade @fastify/multipart to 10.1.9 or later, which fixes the issue. Until then, call saveRequestFiles only after confirming the request is multipart, and reduce each returned filename to its basename or validate it against an allowlist before use.

Written with Claude Haiku 5.5 from the sources below · 2026-11-16

  • Fix · CNA @fastify/multipart (@fastify/multipart) Fixed in 10.1.9

Timeline

  1. 2026-11-16 Threatist record created from CVE-2026-124289

References

  • TI-2026-92115 Temporary file leak in @fastify/multipart enables denial of service CVSS 3.1HIGH 7.5
  • TI-2026-83783 Denial of service in @fastify/multipart from malformed file uploads CVSS 3.1MEDIUM 5.9

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences