CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-63222

CVE-2026-63222: Remote Code Execution via Path Traversal in CodeIgniter4 File Upload Handler

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 8, 2026·6 min read·4 visits

Executive Summary (TL;DR)

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.

Vulnerability Overview

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.

Root Cause Analysis

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.

Code Analysis

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.

Exploitation Mechanics

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.

Impact Assessment

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.

Remediation & Detection Guidance

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).

Official Patches

CodeIgniterCodeIgniter 4.7.4 release notes containing fix logs.
GitHubSecurity Advisory containing patch specifications and architectural bypass warnings.

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
EPSS Probability
0.45%
Top 63% most exploited

Affected Systems

CodeIgniter4 full-stack PHP framework

Affected Versions Detail

Product
Affected Versions
Fixed Version
CodeIgniter4
CodeIgniter
< 4.7.44.7.4
AttributeDetail
CWE IDCWE-22
Attack VectorNetwork
CVSS Base Score7.5
EPSS Score0.0045
ImpactHigh Integrity Loss / Potential Remote Code Execution
Exploit Statuspoc
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
CWE-22
Path Traversal

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Vulnerability Timeline

Initial preparation of upgrade guidelines and documentation for the upcoming 4.7.4 release tag.
2026-05-22
Official fix commit integrated into development branches of CodeIgniter4 codebase.
2026-06-30
CVE-2026-63222 and related Security Advisory published alongside the CodeIgniter 4.7.4 release.
2026-07-31

References & Sources

  • [1]National Vulnerability Database record for CVE-2026-63222
  • [2]Official GitHub Patch Commit

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•9 minutes ago•CVE-2026-63221
9.4

CVE-2026-63221: SQL Injection in CodeIgniter4 Query Builder deleteBatch()

An SQL injection vulnerability exists in the Query Builder component of the CodeIgniter4 full-stack PHP framework. The vulnerability is located within the compilation logic of the batch delete operation, deleteBatch(). When an application chains where() conditions prior to calling deleteBatch(), the Query Builder fails to enforce or respect the escaping flags of the parameters bound to the WHERE clauses. Instead of passing these parameters through the database driver standard escaping logic, the compilation engine interpolates the raw, unescaped bound values directly into the compiled SQL string, allowing remote attackers to execute arbitrary SQL commands.

Amit Schendel
Amit Schendel
0 views•8 min read
•about 2 hours ago•CVE-2026-63223
9.8

CVE-2026-63223: Unrestricted File Upload leading to Remote Code Execution in CodeIgniter4

A critical unrestricted file upload vulnerability (CWE-434) in CodeIgniter4 allows unauthenticated remote attackers to execute arbitrary code. By bypassing weak validation filters in the `is_image` and `mime_in` rules, an attacker can upload a malicious PHP payload disguised as a valid image file.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 3 hours ago•CVE-2026-67422
7.5

CVE-2026-67422: Regular Expression Denial of Service in pymdown-extensions

A high-severity Regular Expression Denial of Service (ReDoS) vulnerability in pymdown-extensions versions prior to 11.0.1 affects the Caret, Tilde, BetterEm, and MagicLink inline processors. When parsing user-supplied Markdown content containing malicious sequences of formatting delimiters, the regular expression engine is forced into catastrophic backtracking, resulting in CPU exhaustion and application denial of service.

Alon Barad
Alon Barad
3 views•5 min read
•about 4 hours ago•CVE-2026-71847
8.7

CVE-2026-71847: Use-After-Free in Ruby JSON Gem ResumableParser

A technical analysis of the use-after-free (UAF) vulnerability in the Ruby JSON gem (CVE-2026-71847) that impacts versions 2.20.0 through 2.21.1. This vulnerability occurs when parsing incomplete stream data containing duplicate keys.

Alon Barad
Alon Barad
3 views•6 min read
•about 5 hours ago•CVE-2026-71848
5.3

CVE-2026-71848: Algorithmic Complexity Denial of Service in Hono languageDetector Middleware

An Algorithmic Complexity Denial of Service (DoS) vulnerability exists in the Hono web application framework within its languageDetector middleware. From version 4.12.0 to 4.12.33, the progressive language-tag truncation routine (normalizeLanguage) performs string operations with a quadratic time complexity O(N^2) relative to the number of hyphen-separated subtags in the user-supplied language tag. This allows an unauthenticated remote attacker to cause resource exhaustion and CPU spikes, resulting in a full denial of service of the single-threaded JavaScript runtime.

Alon Barad
Alon Barad
4 views•5 min read
•about 6 hours ago•CVE-2026-71849
3.7

CVE-2026-71849: Information Exposure via Hop-by-Hop Header Leakage in Hono Proxy Helper

A vulnerability in the Hono framework's Proxy Helper allows the exposure of connection-scoped, internal, or session-specific metadata to unauthorized actors. The proxy helper fails to remove header fields dynamically listed in the response's Connection header, violating RFC 9110 Section 7.6.1.

Amit Schendel
Amit Schendel
4 views•6 min read