CVE-2026-124289 · Package
NO FIX YET · SEE WHAT TO DO
When @fastify/multipart runs with attachFieldsToBody, saveRequestFiles accepts any JSON object carrying file and buffer properties as an uploaded file. An unauthenticated client can use this to write attacker-chosen bytes under attacker-chosen relative paths, skipping upload hooks and limits.
first public Nov 16, 2026 · 1 source
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Applications that register @fastify/multipart with the attachFieldsToBody option and call saveRequestFiles, especially where the returned filename is used as a write destination, as the project README example does. Exposure requires no account, and a single crafted JSON request is enough. Apps that do not use attachFieldsToBody or saveRequestFiles can skip it.
Not affected if no-attachfieldstobody, no-saverequestfiles, versions-outside-7.4.0-to-10.1.8
Who cares fastify, file-uploads, node, self-hosted
npm ls @fastify/multipartattachFieldsToBody and saveRequestFiles usage, and check whether the returned filename is used as a write destination.@fastify/multipart 10.1.9@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.
This page as ·
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.