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

- Severity: High 7.5 (CVSS:3.1, scored by openjs) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.46%, higher than 32% of CVEs (2026-11-30)
- Published: 2026-11-16T13:09:49.790Z
- Modified: 2026-11-17T19:17:48.787Z
- Weaknesses: CWE-22, CWE-843
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: openjs

## Description

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

(As written by CVE List.)

## Affected

- @fastify/multipart @fastify/multipart: from 7.4.0 before 10.1.9 (not affected: 10.1.9)

## References

- <https://github.com/fastify/fastify-multipart/security/advisories/GHSA-gmhr-r4mc-w935>
- <https://cna.openjsf.org/security-advisories.html>

## Sources

- CVE List: [CVE-2026-124289](https://www.cve.org/CVERecord?id=CVE-2026-124289), CVE Terms of Use, modified 2026-11-17
- NVD: [CVE-2026-124289](https://nvd.nist.gov/vuln/detail/CVE-2026-124289), Public domain, modified 2026-11-17

---

Page: https://cve.day/CVE-2026-124289 · Whole record: https://cve.day/CVE-2026-124289.json · Rebuilt by cve.day 2026-11-25T22:59:50.874Z
