Loading...
Skip to main content

CVE-2026-21440 — AdonisJS Path Traversal in @adonisjs/bodyparser —...

CRITICAL

AdonisJS Path Traversal in Multipart File Handling

Published January 2, 2026Updated February 3, 2026Source: osv

Summary

### 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

Advisory Timeline

  • First published January 2, 2026 (283 days ago).
  • Last revised February 3, 2026 — 31 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update @adonisjs/bodyparser to 10.1.2 or later
npm install @adonisjs/bodyparser@10.1.2
npm
Update @adonisjs/bodyparser to 11.0.0-next.6 or later
npm install @adonisjs/bodyparser@11.0.0-next.6

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: npm (1).

PackageEcosystemAffectedFixed In
@adonisjs/bodyparser
npm
All versions10.1.2
@adonisjs/bodyparser
npm
All versions11.0.0-next.6

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

Frequently Asked Questions

What is CVE-2026-21440?
AdonisJS Path Traversal in Multipart File Handling This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.3/10).
How do I check if my project is affected by CVE-2026-21440?
CVE-2026-21440 affects @adonisjs/bodyparser. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-21440 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.3

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-gvq6-hvvp-h34h

Related CVEs

  • CVE-2026-107722
    CRITICAL

    fast-jwt: Incomplete patch of CVE-2026-34950: Non-whitespace key-prefix re-enables RSA→HS256 algorithm confusion

  • CVE-2026-108261
    CRITICAL

    TinaCMS admin preview iframe loads an attacker-controlled origin from the URL fragment

  • CVE-2026-48795
    HIGH

    @adonisjs/bodyparser has an incomplete fix for CVE-2026-25754

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies