/

CVE-2026-63223

Severity:

CRITICAL RISK

(9.8)

Unrestricted File Upload (CWE-434) in CodeIgniter

CVE-2026-63223

Received

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution via Uploaded Files

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CodeIgniter's upload validation rules is_image and mime_in can allow dangerous files to be uploaded when only MIME type or image checks are enforced without validating file extensions.

If an application preserves the client-supplied filename and stores uploads in a web-accessible, script-enabled directory, a remote attacker could upload executable content and potentially achieve remote code execution.

Affected context

This vulnerability manifests in CodeIgniter-based applications that rely solely on is_image or mime_in for upload validation while:

  • Accepting and trusting the client-supplied filename
  • Storing uploaded files under their original names
  • Writing uploads into web-accessible directories where PHP or other scripts can execute

It becomes particularly risky when no independent safe extension check (such as ext_in) is enforced and the web server is configured to execute files based on their extensions.

Exploit preconditions

  • Attack surface: Public or authenticated file upload endpoints built with CodeIgniter.
  • Required access: Ability to submit file uploads to an affected endpoint (no need for direct server access).
  • Trigger point: Upload handlers that validate files with is_image or mime_in only, then save the file using the client's filename into a script-executable directory.
  • Why exploitation is possible: MIME-type or content-based checks alone do not constrain the final file extension, so an attacker can supply a file with executable extension (e.g., .php) that passes validation and is later interpreted as code by the server.

Why this happens

The core issue is an unrestricted file upload pattern where trust is placed in MIME or image checks without enforcing a safe, whitelisted file extension.

The is_image and mime_in rules validate content characteristics but do not constrain or sanitize the resulting filename on disk, allowing client-controlled extensions to remain intact.

This maps to CWE-434: Unrestricted Upload of File with Dangerous Type, where user-controlled uploads can result in files being stored and executed in contexts that treat them as server-side code.

Potential impact

  • Remote code execution on the web server through uploaded scripts
  • Complete compromise of the affected application and its data
  • Use of the server as a pivot point for lateral movement in the network
  • Defacement or manipulation of served content via malicious uploads
  • Deployment of web shells or backdoors for persistent access

General mitigation guidance

Effective mitigation focuses on restricting what gets uploaded, where it is stored, and how the server interprets it:

  • Enforce strict whitelists of allowed file extensions independent of MIME checks, and reject any unexpected or executable types.
  • Normalize and regenerate filenames on the server side instead of using client-supplied names; avoid carrying over user-controlled extensions.
  • Store uploads in non-executable directories or on storage backends that are not mapped to script-capable web roots.
  • Configure the web server to treat upload locations as static-only, disabling PHP or other scripting engines there.
  • Apply least-privilege file and directory permissions so uploaded content cannot escalate its impact if mishandled.

How teams detect issues like this

Organizations can detect this class of issue through a combination of code and configuration review:

  • Static analysis: Look for upload handlers that rely on is_image or mime_in without additional extension whitelisting or filename normalization.
  • Code review signals: Patterns where $file->getClientName() or similar constructs are used directly when saving files, especially into web-accessible paths.
  • Configuration checks: Validate that upload directories are not configured as script-executable roots and that web server directives do not enable code execution there.
  • Security testing: Incorporate upload fuzzing in penetration tests to attempt uploading benign scripts with allowed MIME types to see if they are accepted and executable.

Sources

SourceLink
github.comgithub.com/codeigniter4/CodeIgniter4/commit/b6e9a4fa1dca2df3d3f261bdf61532df8c6420aa
github.comgithub.com/codeigniter4/CodeIgniter4/releases/tag/v4.7.4
github.comgithub.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-mmj4-63m4-r6h5

Frequently asked

questions

Yes. Any user who can access an affected upload endpoint, even over the internet, may be able to upload malicious executable files if the application and server configuration align with the vulnerable pattern.

The attacker generally only needs the ability to upload files through the application. In many cases this may be an unauthenticated endpoint; in others, it might require basic user-level authentication, depending on how uploads are exposed.

Combine strict extension whitelisting with server-side filename generation and store uploads in non-executable locations. Ensure that validation does not rely solely on MIME type or content inspection and that executable extensions are never accepted on upload paths.

Establish a consistent upload security policy: always validate both content and extension, treat client-controlled filenames as untrusted, segregate uploads from executable directories, and incorporate upload-related checks into code review, static analysis, and security testing practices.

Find out what's already
exploitable in your codebase.