{"id":"CVE-2026-124289","kind":"vulnerability","aliases":["CVE-2026-124289"],"related":[],"title":"Fastify multipart plugin: forged upload objects let a request write arbitrary files","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.","summary":"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.","severity":"high","cvss":7.5,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["fastify","file-uploads","node","package","self-hosted"],"not_affected_if":["no-attachfieldstobody","no-saverequestfiles","versions-outside-7.4.0-to-10.1.8"],"how_to_check":"- Check the installed version: `npm ls @fastify/multipart`\n- Search the code for `attachFieldsToBody` and `saveRequestFiles` usage, and check whether the returned filename is used as a write destination.","fix":"- `@fastify/multipart` `10.1.9`\n- Workaround from the advisory: call saveRequestFiles only after confirming the request is multipart, and reduce each returned filename to its basename or validate it against an allowlist.","status":"open","published_at":"2026-11-16T14:17:05+00:00","first_seen_at":"2026-11-16T14:36:59+00:00","triaged_at":"2026-11-16T14:37:16+00:00","updated_at":"2026-11-16T14:37:16+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-16T14:37:16Z","model":"claude-haiku-5-5","output":{"fix":"- `@fastify/multipart` `10.1.9`\n- Workaround from the advisory: call saveRequestFiles only after confirming the request is multipart, and reduce each returned filename to its basename or validate it against an allowlist.","reach":"internet","title":"Fastify multipart plugin: forged upload objects let a request write arbitrary files","impact":"high","summary":"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.","audience":"developers","category":"package","nicknames":[],"who_cares":["fastify","node","self-hosted","file-uploads"],"confidence":0.8,"fix_status":"available","needs_auth":"no","worst_case":"unauthenticated requests write arbitrary files to relative paths on the server","analyst_note":"","how_to_check":"- Check the installed version: `npm ls @fastify/multipart`\n- Search the code for `attachFieldsToBody` and `saveRequestFiles` usage, and check whether the returned filename is used as a write destination.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["no-attachFieldsToBody","no-saveRequestFiles","versions-outside-7.4.0-to-10.1.8"],"who_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.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.000818,"input_tokens":4835,"output_tokens":668,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-124289':15A,18A '-2026':14A,17A '10.1.8':84C '10.1.9':218C,224C '7.4.0':82C 'accept':34B 'allowlist':252C 'applic':184C 'arbitrari':11A,202C 'attachfieldstobodi':32B,92C 'attack':56B,61B,138C,165C 'attacker-chosen':55B,60B,137C 'basenam':175C,246C 'bodi':104C 'buffer':41B,110C 'byte':58B,140C 'call':230C 'carri':38B,106C 'chosen':57B,62B,139C 'client':49B,118C 'confirm':234C 'contain':180C 'count':153C 'cve':13A,16A 'destin':191C,258C 'directori':146C,182C 'entri':162C 'exampl':196C 'expos':199C 'fastifi':1A,19B,74C 'fastify/multipart':29B,70C,217C 'field':135C 'file':12A,21B,39B,46B,108C,115C,152C,206C 'file-upload':20B 'filenam':167C,178C,243C 'fix':215C 'forg':4A,120C 'handl':77C 'helper':96C 'hook':67B,149C 'host':27B 'instead':169C 'issu':213C 'json':36B,127C,132C 'json-typ':131C 'keep':163C 'later':226C 'let':7A 'limit':69B,156C 'multipart':2A,134C,238C 'multipart/form-data':78C 'node':23B 'object':6A,37B,99C,123C 'offici':73C 'option':93C 'packag':24B 'parent':181C 'pars':102C 'path':64B,205C 'plain':126C 'plugin':3A,75C,87C 'project':194C 'properti':42B,111C 'readm':195C 'reduc':172C,240C 'regist':89C 'relat':63B,204C 'relative-path':203C 'request':9A,103C,128C,211C,236C 'return':242C 'run':30B 'save':161C 'saverequestfil':33B,95C,231C 'segment':183C 'self':26B 'self-host':25B 'singl':210C 'size':155C 'skip':65B,158C 'temporari':145C 'treat':97C 'truthi':107C 'type':133C 'unauthent':48B,117C 'upgrad':222C 'upload':5A,22B,45B,66B,79C,114C,148C 'use':51B,186C,254C 'user':220C 'valid':248C 'verbatim':168C 'version':81C 'workaround':229C 'write':10A,54B,190C,207C 'written':142C","nicknames":[],"mitigations":[],"who_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.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":[],"ptokens":[],"labels":["fastify","fileuploads","high","node","package","selfhosted"],"campaign_type":null,"search_a":"'-124289':15A,18A '-2026':14A,17A 'arbitrari':11A 'cve':13A,16A 'fastifi':1A 'file':12A 'forg':4A 'let':7A 'multipart':2A 'object':6A 'plugin':3A 'request':9A 'upload':5A 'write':10A","search_b":"'accept':34B 'attachfieldstobodi':32B 'attack':56B,61B 'attacker-chosen':55B,60B 'buffer':41B 'byte':58B 'carri':38B 'chosen':57B,62B 'client':49B 'fastifi':19B 'fastify/multipart':29B 'file':21B,39B,46B 'file-upload':20B 'hook':67B 'host':27B 'json':36B 'limit':69B 'node':23B 'object':37B 'packag':24B 'path':64B 'properti':42B 'relat':63B 'run':30B 'saverequestfil':33B 'self':26B 'self-host':25B 'skip':65B 'unauthent':48B 'upload':22B,45B,66B 'use':51B 'write':54B","search_c":"'10.1.8':84C '10.1.9':218C,224C '7.4.0':82C 'allowlist':252C 'applic':184C 'arbitrari':202C 'attachfieldstobodi':92C 'attack':138C,165C 'attacker-chosen':137C 'basenam':175C,246C 'bodi':104C 'buffer':110C 'byte':140C 'call':230C 'carri':106C 'chosen':139C 'client':118C 'confirm':234C 'contain':180C 'count':153C 'destin':191C,258C 'directori':146C,182C 'entri':162C 'exampl':196C 'expos':199C 'fastifi':74C 'fastify/multipart':70C,217C 'field':135C 'file':108C,115C,152C,206C 'filenam':167C,178C,243C 'fix':215C 'forg':120C 'handl':77C 'helper':96C 'hook':149C 'instead':169C 'issu':213C 'json':127C,132C 'json-typ':131C 'keep':163C 'later':226C 'limit':156C 'multipart':134C,238C 'multipart/form-data':78C 'object':99C,123C 'offici':73C 'option':93C 'parent':181C 'pars':102C 'path':205C 'plain':126C 'plugin':75C,87C 'project':194C 'properti':111C 'readm':195C 'reduc':172C,240C 'regist':89C 'relat':204C 'relative-path':203C 'request':103C,128C,211C,236C 'return':242C 'save':161C 'saverequestfil':95C,231C 'segment':183C 'singl':210C 'size':155C 'skip':158C 'temporari':145C 'treat':97C 'truthi':107C 'type':133C 'unauthent':117C 'upgrad':222C 'upload':79C,114C,148C 'use':186C,254C 'user':220C 'valid':248C 'verbatim':168C 'version':81C 'workaround':229C 'write':190C,207C 'written':142C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-16T11:10:34+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","cvss_by":"ce714d77-add3-4f53-aff5-83d477b104bb","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-124289","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-124289","severity":null,"published_at":"2026-11-16T14:17:05+00:00","modified_at":"2026-11-16T14:17:05+00:00","first_seen_at":"2026-11-16T14:36:59+00:00","fetched_at":"2026-11-16T14:36:59+00:00","note":null}],"documents":[{"id":169981,"url":"https://github.com/fastify/fastify-multipart/security/advisories/GHSA-gmhr-r4mc-w935","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-11-16T11:10:34+00:00","relation":"advisory","confidence":null,"note":"Vendor advisory: github.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}