CVE-2026-21440: @adonisjs/bodyparser Path Traversal Vulnerability
CRITICALCVE-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
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.
npm install @adonisjs/bodyparser@10.1.2
npm install @adonisjs/bodyparser@11.0.0-next.6
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
CVE-2026-21440 Affected @adonisjs/bodyparser Versions
2 component(s)| 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?
Which @adonisjs/bodyparser versions are affected?
What version fixes CVE-2026-21440?
Is @adonisjs/bodyparser affected?
What CWE is associated with CVE-2026-21440?
How can I check npm dependencies for CVE-2026-21440?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}