CVE-2026-21440: @adonisjs/bodyparser Path Traversal Vulnerability

CRITICAL
Advisory Identifier: GHSA-gvq6-hvvp-h34h
CWE-22
Published
Advisory Summary

CVE-2026-21440 is a CRITICAL path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting @adonisjs/bodyparser libraries in the npm ecosystem. The issue involves adonisjs path traversal in multipart file handling. Remediation is available by upgrading affected packages to version 10.1.2, 11.0.0-next.6.

CVE-2026-21440 at a Glance

CVE Identifier CVE-2026-21440
GHSA Identifier GHSA-gvq6-hvvp-h34h
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product @adonisjs/bodyparser
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-21440

To remediate this vulnerability, upgrade all affected @adonisjs/bodyparser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@adonisjs/bodyparser fixed: 10.1.2
npm install @adonisjs/bodyparser@10.1.2
@adonisjs/bodyparser fixed: 11.0.0-next.6
npm install @adonisjs/bodyparser@11.0.0-next.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @adonisjs/bodyparser

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-21440, inspect your project dependencies using npm:

npm ls @adonisjs/bodyparser

Analyze the terminal output to locate any version of @adonisjs/bodyparser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.1.2), your application is affected.

Note: The npm ls @adonisjs/bodyparser command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In @adonisjs/bodyparser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary **Description** A Path Traversal (CWE-22) vulnerability in AdonisJS multipart file handling may allow a remote attacker to write arbitrary files to arbitrary locations on the server filesystem. This impacts @adonisjs/bodyparser through version 10.1.1 and 11.x prerelease versions prior to 11.0.0-next.6. This issue has been patched in @adonisjs/bodyparser versions 10.1.2 and 11.0.0-next.6. ### Details AdonisJS parses `multipart/form-data` via `BodyParser` and exposes uploads as `MultipartFile`. The issue is in the `MultipartFile.move(location, options)` default options. If `options.name` isn't provided, it defaults to the unsanitized client filename and builds the destination with `path.join(location, name)`, allowing a traversal to escape the default or intended directory chosen by the developer. If `options.overwrite` isn't provided, it defaults to true, allowing file overwrites. The documentation previously demonstrated examples leading developers to this vulnerable code path. ### Impact Exploitation requires a reachable upload endpoint. If a developer uses `MultipartFile.move()` without the second `options` argument or without explicitly sanitizing the filename, an attacker can supply a crafted `filename` value containing traversal sequences, writing to a destination path outside the intended upload directory. This can lead to arbitrary file write on the server. If the attacker can overwrite application code, startup scripts, or configuration files that are later executed/loaded, RCE is possible. RCE is not guaranteed and depends on filesystem permissions, deployment layout, and application/runtime behavior. ### Patches Fixes targeting v6 and v7 have been published below. - https://github.com/adonisjs/bodyparser/releases/tag/v10.1.2 - https://github.com/adonisjs/bodyparser/releases/tag/v11.0.0-next.6

CVE-2026-21440 Affected @adonisjs/bodyparser Versions

2 component(s)
Fixed Versions:
10.1.211.0.0-next.6
Product / Package Ecosystem Affected Versions Fixed Version
@adonisjs/bodyparser
npm
< 10.1.2
10.1.2
@adonisjs/bodyparser
npm
≥ 11.0.0-next.0
< 11.0.0-next.6
11.0.0-next.6

References

Frequently Asked Questions

What is CVE-2026-21440?
CVE-2026-21440 is a security vulnerability in @adonisjs/bodyparser involving AdonisJS Path Traversal in Multipart File Handling under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which @adonisjs/bodyparser versions are affected?
Affected versions include releases prior to 10.1.2, 11.0.0-next.6 across affected packages: @adonisjs/bodyparser.
What version fixes CVE-2026-21440?
Upgrading to 10.1.2, 11.0.0-next.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @adonisjs/bodyparser affected?
Yes, @adonisjs/bodyparser is affected in releases prior to 10.1.2, 11.0.0-next.6. Upgrade your dependency to 10.1.2, 11.0.0-next.6 or later.
What CWE is associated with CVE-2026-21440?
CVE-2026-21440 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2026-21440?
Run the dependency tree command: 'npm ls @adonisjs/bodyparser'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gvq6-hvvp-h34h",
  "modified" : "2026-01-03T00:32:09Z",
  "published" : "2026-01-02T18:58:32Z",
  "aliases" : [ "CVE-2026-21440" ],
  "summary" : "AdonisJS Path Traversal in Multipart File Handling",
  "details" : "### Summary\n\n**Description**\nA Path Traversal (CWE-22) vulnerability in AdonisJS multipart file handling may allow a remote attacker to write arbitrary files to arbitrary locations on the server filesystem. This impacts @adonisjs/bodyparser through version 10.1.1 and 11.x prerelease versions prior to 11.0.0-next.6. This issue has been patched in @adonisjs/bodyparser versions 10.1.2 and 11.0.0-next.6.\n\n### Details\nAdonisJS parses `multipart/form-data` via `BodyParser` and exposes uploads as `MultipartFile`. The issue is in the `MultipartFile.move(location, options)` default options. If `options.name` isn't provided, it defaults to the unsanitized client filename and builds the destination with `path.join(location, name)`, allowing a traversal to escape the default or intended directory chosen by the developer. If `options.overwrite` isn't provided, it defaults to true, allowing file overwrites. The documentation previously demonstrated examples leading developers to this vulnerable code path.\n### Impact\n\nExploitation requires a reachable upload endpoint. If a developer uses `MultipartFile.move()` without the second `options` argument or without explicitly sanitizing the filename, an attacker can supply a crafted `filename` value containing traversal sequences, writing to a destination path outside the intended upload directory. This can lead to arbitrary file write on the server.\n\nIf the attacker can overwrite application code, startup scripts, or configuration files that are later executed/loaded, RCE is possible. RCE is not guaranteed and depends on filesystem permissions, deployment layout, and application/runtime behavior.\n\n### Patches\nFixes targeting v6 and v7 have been published below.\n- https://github.com/adonisjs/bodyparser/releases/tag/v10.1.2\n- https://github.com/adonisjs/bodyparser/releases/tag/v11.0.0-next.6",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@adonisjs/bodyparser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "10.1.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@adonisjs/bodyparser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.0.0-next.0"
      }, {
        "fixed" : "11.0.0-next.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/adonisjs/core/security/advisories/GHSA-gvq6-hvvp-h34h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-21440"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/adonisjs/bodyparser/commit/143a16f35602be8561215611582211dec280cae6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/adonisjs/bodyparser/commit/6795c0e3fa824ae275bbd992aae60609e96f0f03"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/adonisjs/bodyparser/releases/tag/v10.1.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/adonisjs/bodyparser/releases/tag/v11.0.0-next.6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/adonisjs/core"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-02T18:58:32Z",
    "nvd_published_at" : "2026-01-02T19:15:48Z"
  }
}