Aug 8, 2026·6 min read·225 visits
Unsanitized client-provided filenames in CodeIgniter4's file-move component allow remote directory traversal, leading to arbitrary file writes and potential remote code execution.
CVE-2026-63222 details a high-severity path traversal vulnerability in CodeIgniter4 versions prior to 4.7.4. The flaw lies within the `UploadedFile::move()` handler, which falls back to unsanitized, client-provided file names from the HTTP multipart request when a target name is not explicitly passed. An unauthenticated remote attacker can exploit this flaw to traverse arbitrary server directories, write malicious PHP payloads to the public-facing web root, and execute arbitrary code on the target system.
File upload capabilities are a standard requirement in web application development, providing users with mechanisms to upload profile pictures, documents, and media assets. In the CodeIgniter4 framework, this capability is facilitated by the UploadedFile component, which abstracts the storage, management, and moving of uploaded files. This class handles multipart file data from HTTP POST operations, exposing utility functions such as move() to safely transfer temporary binary files into a designated storage structure.
When a developer invokes the move() method on an UploadedFile object without specifying an explicit secondary argument representing the destination filename, the framework defaults to adopting the original client-provided file name. This client-supplied value is extracted from the Content-Disposition HTTP header sent in the multipart payload. Because this input is retrieved directly from the client request stream without rigorous validation, it presents a substantial security risk to the web application hosting environment.
This architectural design exposes the application to a classic Path Traversal vulnerability classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). By modifying the filename parameter in the multipart header to incorporate relative directory traversal sequences, an attacker can manipulate the destination file path resolver. This allows the attacker to bypass intended boundary directories and write uploaded files to any location where the system user executing the PHP binary has write privileges.
The root cause of CVE-2026-63222 resides in the file management logic within the system/HTTP/Files/UploadedFile.php helper class. Specifically, the vulnerability manifests within the move() function signature: public function move(string $targetPath, ?string $name = null, bool $overwrite = false). Under default usage, if the second parameter $name is omitted or passed as null, the framework executes the logical null-coalescing assignment $name ??= $this->getName(); to resolve the final target filename.
The internal $this->getName() method retrieves the original client-provided filename from the multipart file array populated during initialization. Prior to version 4.7.4, this retrieval was performed with no sanitization filters or path cleanup procedures. As a result, characters such as directory delimiters (/ and \) and relative traversal sequences (../) remained unmodified within the resolved path variable.
During the path resolution step, the absolute file path is evaluated by combining the target destination path with the unsanitized filename via $destination = $overwrite ? $targetPath . $name : $this->getDestination($targetPath . $name);. Because $name contains traversal components, the underlying filesystem driver processes the dot-dot-slash sequence dynamically. This sequence escapes the intended $targetPath directory tree, causing the operating system to write the file payload into a target-specified directory.
An inspection of the codebase in system/HTTP/Files/UploadedFile.php reveals the exact differences introduced to patch the vulnerability. In vulnerable releases, the code assigns the name of the file directly without intermediate security filtering.
// Vulnerable Code Path (Pre-v4.7.4)
$name ??= $this->getName();
$destination = $overwrite ? $targetPath . $name : $this->getDestination($targetPath . $name);The patch intercepting this sequence forces automatic filename sanitization using the framework's internal security helper if the argument evaluates to null. The developers isolated the fallback logic specifically to apply safety sanitization exclusively when utilizing client-controlled parameters.
// Patched Code Path (v4.7.4)
if ($name === null) {
helper('security');
$name = sanitize_filename($this->getName());
}
$destination = $overwrite ? $targetPath . $name : $this->getDestination($targetPath . $name);Additionally, verification test suites were added to tests/system/HTTP/Files/FileMovingTest.php to prevent regression. The function testMoveSanitizesClientNameByDefault defines an explicit mock request where the name index contains the traversal string ../../public/shell.php. The test confirms that when the handler processes the file copy, the parsed output returns publicshell.php as the file name, effectively neutralizing any folder-climbing commands before they interact with physical IO APIs.
To exploit this vulnerability, an attacker must identify an active route on a CodeIgniter4 application that implements file uploads where the target filename is not hardcoded. The application must process the file through $file->move($path) without supplying a second parameter. No specific privileges or authenticated sessions are required if the target endpoint is exposed to public-facing traffic.
The attacker crafts a multipart HTTP POST request incorporating a PHP shell payload, modifying the metadata boundaries to inject a nested file name. This is visualized in the target execution path:
When the application processes this payload, the relative directory references bypass standard storage boundaries. The resulting physical output is written directly to the server's public web directory. Since the file is written within a directory designated to serve static assets and interpret backend PHP resources, the attacker can execute arbitrary commands by visiting the newly generated web address.
The impact of CVE-2026-63222 is categorized as High, characterized by a CVSS score of 7.5. Although the vulnerability does not directly expose read permissions for existing host configurations (Confidentiality: None), writing files to administrative-level system folders represents a significant escalation route. If an attacker succeeds in writing a web shell to an executed directory, they achieve complete Remote Code Execution (RCE).
Upon achieving command execution, the threat actor operates under the context of the underlying web process (such as www-data or nginx). Depending on local system configurations, the attacker may execute database queries, extract sensitive source code, read system configuration files, or attempt local privilege escalation to compromise the entire physical server hosting environment.
While the EPSS metrics currently indicate a low immediate exploitation prediction rate, path traversal vulnerabilities in web-accessible endpoints are highly attractive to scanning automated scripts. In environments running under insecure file permissions where the web root is globally writable, exploitation is straightforward and requires low technical investment from malicious actors.
The standard remediation pathway requires updating the CodeIgniter4 framework to version 4.7.4 or later. This is accomplished using Composer package managers by modifying version parameters and executing standard repository synchronization routines. Organizations should verify that all dependencies are thoroughly audited and updated across testing, staging, and production environments.
> [!WARNING]
> An architectural bypass remains in this library design. If a developer explicitly reads user-controlled input and provides it as the second parameter, the sanitization path is bypassed. For example, $file->move($path, $file->getName()) remains vulnerable even in version 4.7.4+.
Developers must perform static analysis across all custom controllers. Search the codebase for occurrences of ->move( where more than one parameter is supplied. If user metadata defines the destination parameter, ensure it is wrapped explicitly in the sanitize_filename() wrapper function. In addition, restrict write permissions for the web user inside source directories, and disable PHP script execution in upload directories through web server configurations (e.g., configuring .htaccess or server block options).
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
CodeIgniter4 CodeIgniter | < 4.7.4 | 4.7.4 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22 |
| Attack Vector | Network |
| CVSS Base Score | 7.5 |
| EPSS Score | 0.0045 |
| Impact | High Integrity Loss / Potential Remote Code Execution |
| Exploit Status | poc |
| KEV Status | Not Listed |
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.