CVE-2026-124289: @fastify/multipart vulnerable to arbitrary file write via type confusion in saveRequestFiles()

Published Nov 16, 2026
·
Updated

@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.

Affected Software

1 affected component
npm/@fastify/multipart>=7.4.0<=10.1.8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 10.1.9
  2. Compensating control

    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.

Event History

Nov 16, 2026
CVE Published
via MITRE·01:09 PM
Data Sourced
via MITRE·01:09 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to arbitrary file writes?

Applications using @fastify/multipart versions 7.4.0 through 10.1.8 are exposed when they register the plugin with attachFieldsToBody and use saveRequestFiles. The arbitrary relative-path write occurs when the application uses a returned filename as a write destination without reducing it to a basename or validating it.

2

Does exploitation require authentication or a real file upload?

No. An unauthenticated client can send a plain JSON request or a JSON-typed multipart field containing an object with truthy file and buffer properties; it does not need to be a genuine uploaded file.

3

What security controls can be bypassed?

Forged objects handled by saveRequestFiles bypass upload hooks and the configured file count and size limits. The attacker's filename is retained verbatim, including parent-directory segments.

4

What can be done before upgrading?

Call saveRequestFiles only after confirming that the request is multipart. Before using returned filenames as destinations, reduce each filename to its basename or validate it against an allowlist.

5

What version fixes the issue?

Upgrade @fastify/multipart to version 10.1.9 or later.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203