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

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

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 8, 2026·6 min read·1 visit

Executive Summary (TL;DR)

Unauthenticated remote code execution via file upload validation bypass in CodeIgniter4 versions prior to v4.7.4.

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.

Vulnerability Overview

CodeIgniter4 is a widely used PHP full-stack web framework that implements validation rules for handling incoming HTTP requests. A critical vulnerability, designated as CVE-2026-63223, exists in versions prior to v4.7.4. The vulnerability involves the unrestricted upload of files with dangerous types (CWE-434), arising from a validation bypass in the default image and MIME-type verification routines.

Historically, web developers have relied on framework-provided helpers such as is_image and mime_in to guarantee that uploaded files are safe. However, in vulnerable configurations, these rules only verify the content headers or magic bytes of the file. They fail to cross-reference the actual client-supplied filename extension with the verified content type.

This gap in security verification exposes a significant attack surface when application logic preserves the original filename and writes uploads directly into a web-accessible, script-enabled directory. If an attacker uploads a polyglot file (a valid image file containing embedded executable code) with a .php extension, the framework accepts the upload, allowing the file to be executed on the server.

Root Cause Analysis

The root cause of CVE-2026-63223 is a structural disconnect in the validation library located at system/Validation/StrictRules/FileRules.php. Specifically, the is_image and mime_in rules execute validation based purely on the file content's characteristics rather than a unified check on both the extension and the content.

When a file is uploaded, the framework utilizes PHP's internal fileinfo extension to analyze the file's magic bytes. The is_image rule retrieves this content-derived extension using the $file->getExtension() method. For example, if a file starts with the binary sequence GIF89a, the framework identifies its mime type as image/gif and assumes the file is a standard GIF image.

Because the validator focuses entirely on the magic bytes, it does not confirm if the actual client-provided filename ends with an authorized extension like .gif or .png. Consequently, a file named shell.php containing a valid image header will successfully pass both the is_image and mime_in validation filters. This behavior violates the principle of complete mediation, where every access or input must be checked against all safety criteria before storage.

Code Analysis

An inspection of the codebase in version 4.7.3 reveals how the validation rules were structured prior to the patch. The vulnerable is_image function retrieves the derived extension directly and queries the Mimes helper without assessing the actual client-supplied name:

// Vulnerable Code Path (Pre-v4.7.4)
public function is_image(?string $blank, string $params): bool
{
    // ...
    // Retrieves extension strictly from content magic bytes
    $type = Mimes::guessTypeFromExtension($file->getExtension()) ?? '';
    
    if (mb_strpos($type, 'image') !== 0) {
        return false;
    }
    return true;
}

In the official security patch (b6e9a4fa1dca2df3d3f261bdf61532df8c6420aa), the CodeIgniter development team introduced explicit validation checks to reject files where the client-supplied extension does not match the content-derived type. The helper function hasInvalidImageClientExtension was added to verify the extension mismatch:

// Patched Code Path (v4.7.4)
public function is_image(?string $blank, string $params): bool
{
    // ...
    if (mb_strpos($type, 'image') !== 0) {
        return false;
    }
 
    // Reject file if the client-supplied extension is not an image type
    if ($this->hasInvalidImageClientExtension($file)) {
        return false;
    }
 
    return true;
}
 
private function hasInvalidImageClientExtension(UploadedFile $file): bool
{
    $clientExtension = trim(strtolower($file->getClientExtension()), '. ');
 
    if ($clientExtension === '') {
        return false;
    }
 
    $type = Mimes::guessTypeFromExtension($clientExtension) ?? '';
 
    return mb_strpos($type, 'image') !== 0;
}

Similarly, the mime_in rule was patched to invoke hasMismatchedClientExtension(), which compares the client extension against $file->guessExtension(). This ensures that even if a payload contains a valid image header, any mismatch with the client-supplied .php extension will result in immediate rejection.

Exploitation Mechanics

Exploitation of CVE-2026-63223 requires specific target environment properties. First, the application must configure file uploads using the weak is_image or mime_in rules without additional validations such as ext_in. Second, the controller must write the file to a public directory using the client-provided name (e.g., via $file->getClientName()). Third, the underlying web server must be configured to pass requests in that directory to a PHP interpreter.

To conduct the attack, an operator crafts an image-PHP polyglot file. This file begins with legitimate image signature headers to satisfy the magic-byte checks of the web server and PHP's fileinfo. Immediately following the header, the payload embeds PHP script instructions:

# Craft the Polyglot Web Shell Payload
python3 -c "import sys; php = b'<?php system(\\\$_GET[\"cmd\"]); ?>'; sys.stdout.buffer.write(b'GIF89a\\n' + php)" > evil.php

The operator then submits a multipart POST request with the file. Because the file starts with GIF89a, the framework validates it as an image. The target script is saved to disk as evil.php. When the operator sends an HTTP GET request to the uploaded file, the web server executes the embedded PHP code:

# Trigger execution of OS commands via web shell
curl http://target-domain.com/uploads/evil.php?cmd=id

Impact Assessment

The security impact of CVE-2026-63223 is rated Critical, with a CVSS v3.1 base score of 9.8. Because exploitation requires no prior authentication and minimum interaction, any external actor can achieve unauthenticated remote code execution. This level of compromise grants the attacker the execution privileges of the web server process (e.g., www-data or nginx).

Once code execution is obtained, the attacker can perform local reconnaissance, access application databases, read sensitive environment variables (such as API keys and database credentials), and escalate privileges. If the host container or server is poorly isolated, this access can serve as a pivot point for lateral movement into internal networks.

While this vulnerability is not currently listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, the release of public Proof-of-Concept tools significantly increases the risk of active exploitation. Organizations utilizing CodeIgniter4 must audit upload handlers immediately to mitigate potential damage.

Remediation & Workarounds

The primary remediation path is upgrading the CodeIgniter4 framework to version 4.7.4 or later. This version enforces strict client-extension matching within the is_image and mime_in validation rules, resolving the vulnerability's root cause.

If an immediate framework upgrade is not feasible, developers must configure a defense-in-depth workaround. This is accomplished by appending the ext_in validation rule to restrict accepted file suffixes:

// Remediated Validation Configuration Workaround
$rules = [
    'avatar' => 'is_image[avatar]|ext_in[avatar,png,jpg,jpeg,gif]'
];

In addition to validation controls, standard secure file storage practices should be enforced. Uploaded filenames should be randomized using $file->getRandomName() to prevent direct path mapping, and files must be saved outside the web root (e.g., in a private directory or remote cloud storage bucket). Finally, execute permissions should be explicitly disabled within the public upload directories using web server configuration files (such as .htaccess rules for Apache or directory-level execution blocks in Nginx).

Official Patches

CodeIgniter FoundationSecurity Advisory GHSA-mmj4-63m4-r6h5

Technical Appendix

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

Affected Systems

CodeIgniter4 installations utilizing standard upload validation rules

Affected Versions Detail

Product
Affected Versions
Fixed Version
CodeIgniter4
CodeIgniter Foundation
>= 4.4.8, < 4.7.4v4.7.4
AttributeDetail
CWE IDCWE-434
Attack VectorNetwork
CVSS Base Score9.8
EPSS Score0.00493 (Percentile: 39.74%)
ImpactRemote Code Execution (RCE)
Exploit StatusProof-of-Concept
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1505.003Server Software Component: Web Shell
Persistence
CWE-434
Unrestricted Upload of File with Dangerous Type

The product receives a class, type, or other specifier for a file or directory, but does not sufficiently restrict the type of file that can be uploaded or created.

Known Exploits & Detection

GitHubAutomated exploitation script and Proof-of-Concept
GitHubReproduction environment and proof of concept

Vulnerability Timeline

Vulnerability Discovered and Patched in v4.7.4
2026-03-01

References & Sources

  • [1]NVD - CVE-2026-63223
  • [2]CodeIgniter4 Release v4.7.4

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

•30 minutes ago•CVE-2026-63222
7.5

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

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.

Amit Schendel
Amit Schendel
1 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
2 views•5 min read
•about 3 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
2 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
3 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
3 views•6 min read
•about 7 hours ago•CVE-2026-71850
4.8

CVE-2026-71850: Server-Side Rendering Data Exposure in Hono JSX Memoization

A session data exposure vulnerability in the Hono web application framework (hono/jsx module) allows consecutive users to receive cached HTML outputs containing private data. When JSX components wrapped in `memo()` are rendered on the server, the caching mechanism utilizes a module-level closure that persists across independent HTTP requests. When subsequent requests occur with matching props, the components are not re-evaluated, and cached HTML is served. If these components read request-scoped or session-specific data via ambient APIs, the data of the first user is exposed to subsequent users.

Amit Schendel
Amit Schendel
3 views•6 min read