@fastify/multipart@10.1.8

Multipart plugin for Fastify

  • latest version

    10.1.9

  • latest non vulnerable version

  • first published

    4 years ago

  • latest version published

    9 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the @fastify/multipart package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Directory Traversal

    @fastify/multipart is a Multipart plugin for Fastify

    Affected versions of this package are vulnerable to Directory Traversal via type confusion in saveRequestFiles() when the plugin is registered with the attachFieldsToBody option. An unauthenticated client can forge a file upload object by sending a plain JSON request or a JSON-typed multipart field carrying truthy file and _buf properties, which saveRequestFiles() previously accepted as a genuine uploaded file. This bypasses the onFile hook and the files and fileSize limits, writes attacker-chosen bytes to the temporary directory, and preserves the attacker-supplied filename verbatim rather than reducing it to its basename. Because the filename can contain parent directory traversal segments such as ../../../../package.json, any application that uses the returned filename as a write destination is exposed to an arbitrary relative-path file write from a single request.

    How to fix Directory Traversal?

    Upgrade @fastify/multipart to version 10.1.9 or higher.

    >=7.4.0 <10.1.9