Fastify: @fastify/multipart arbitrary file write (CVE-2026-124289)
The @fastify/multipart plugin is vulnerable to arbitrary file write via path traversal in versions 7.4.0 through 10.1.8 due to improper validation of filenames in the saveRequestFiles helper when using the attachFieldsToBody option.
CVE search metadata
CVE search record: CVE-2026-124289. Severity: high. CVSS: 7.5. KEV: no. Product: @fastify/multipart. Brief: Fastify: @fastify/multipart arbitrary file write (CVE-2026-124289). Brief link: https://feed.craftedsignal.io/briefs/2026-11-fastify-multipart-path-traversal-cve-2026-124289/
Triage facts
Revision 1- Applicability
- @fastify/multipart
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 2 public sources
- Freshness
- Revision 1Nov 16, 16:58 UTC
- Vulnerabilities
- 1 CVE
- Source quality
- A1Likely
Overview
@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 attacker can forge such an object through a plain JSON request or a JSON-typed multipart field, bypassing upload hooks and file limits. The plugin uses the attacker-provided filename verbatim, allowing for path traversal if the filename contains directory segments. This exposes applications to arbitrary relative-path file writes, particularly if the filename is used as a write destination.
Impact
Successful exploitation allows an unauthenticated attacker to perform an arbitrary file write on the server's filesystem, potentially leading to remote code execution or unauthorized modification of system files.
Recommendation
- Upgrade @fastify/multipart to 10.1.9 or later.
- As a temporary workaround, verify that the request is indeed a multipart request before calling saveRequestFiles.
- Always validate or sanitize the filename returned by the plugin by reducing it to its basename or checking against an allowlist before using it as a file write destination.
Threat Hunt
Identify requests to Fastify applications that contain JSON bodies or multipart fields where the filename parameter contains path traversal sequences such as '..'.
Data: webserver logs, application request inspection logs
Mitigations
Upgrade @fastify/multipart to version 10.1.9 or later.