cyber security

Critical AdonisJS Vulnerability Allows Remote Attackers to Write Files on Server

A critical path traversal vulnerability has been discovered in AdonisJS’s multipart file handling, potentially allowing remote attackers to write arbitrary files to server locations outside the intended upload directory.

The vulnerability, tracked as CVE-2026-21440, affects @adonisjs/bodyparser versions through 10.1.1 and all 11.x prerelease versions prior to 11.0.0-next.6, with patches now available in versions 10.1.2 and 11.0.0-next.6.

The vulnerability resides in how AdonisJS handles the MultipartFile.move(location, options) function during multipart/form-data processing through the BodyParser middleware.

When the options parameter is omitted or doesn’t explicitly provide a sanitized filename, the system defaults to using the unsanitized client-supplied filename.

The vulnerable code constructs the destination path using path.join(location, name), which fails to validate traversal sequences embedded in the filename parameter properly.

Additionally, if developers don’t explicitly set the options, overwrite parameter, it defaults to true, permitting file overwrites at the calculated destination.

This combination creates a two-stage vulnerability: attackers can supply crafted filenames containing directory traversal sequences (such as “../../../”) to escape the intended upload directory and write files to arbitrary locations on the filesystem.

AdonisJS documentation previously demonstrated code examples that inadvertently guided developers toward this vulnerable implementation pattern, increasing the real-world attack surface.

Impact and Exploitation Requirements

Successful exploitation requires a reachable upload endpoint within the target application. Any developer who implements MultipartFile.move() without properly sanitizing the filename parameter or without explicitly providing the options argument exposes their application to this vulnerability.

Once an attacker gains the ability to write files outside the intended directory, multiple attack chains become feasible.

The most severe consequence involves remote code execution (RCE), which can be achieved if attackers overwrite application code, startup scripts, or configuration files that are subsequently executed or loaded by the runtime.

However, RCE is contingent on several factors, including filesystem permissions, deployment architecture, and application runtime behavior.

In restricted environments with proper permission segmentation, the vulnerability may be limited to file write capabilities without achieving code execution.

CVSS Severity Assessment

The vulnerability receives a critical CVSS v4.0 base score with the vector string 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.

The metrics indicate a network-based attack vector with low complexity and no authentication requirements, though successful exploitation requires specific conditions to be present.

High impacts across confidentiality, integrity, and availability make this a critical security concern for organizations running vulnerable AdonisJS versions.

Organizations should immediately upgrade to @adonisjs/bodyparser version 10.1.2 or later for the stable branch, or version 11.0.0-next.6 for early adopters on the prerelease track.

Development teams should audit existing upload handlers to ensure proper filename sanitization and explicit options configuration.

The AdonisJS security team recommends implementing strict input validation on all client-supplied filenames and explicitly setting the overwrite parameter to false unless overwriting is expressly required and validated.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Mayura Kathir

Mayura Kathir is a cybersecurity reporter at GBHackers News, covering daily incidents including data breaches, malware attacks, cybercrime, vulnerabilities, zero-day exploits, and more.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

1 day ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

1 day ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

1 day ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

1 day ago