Description
CodeIgniter is a PHP full-stack web framework. Prior to 4.7.3, the ext_in upload validation rule in system/Validation/StrictRules/FileRules.php checked the MIME-derived guessed extension instead of the client-provided filename extension. As a result, an uploaded file named shell.php containing GIF-like content could pass validation such as uploaded[avatar]|is_image[avatar]|mime_in[avatar,image/gif]|ext_in[avatar,gif] because the detected MIME type maps to gif, even though the uploaded filename extension is php. Applications are impacted if they accept user-controlled uploads, rely on ext_in to validate the uploaded filename extension, save uploaded files using the original client filename with $file->move($path), store uploads in a web-accessible directory, and allow PHP or other executable files to run from that directory. In those conditions, this may lead to arbitrary code execution. This issue is fixed in version 4.7.3.
Published: 2026-07-17
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The ext_in upload validation rule in CodeIgniter 4, before version 4.7.3, verified file extensions based on the MIME type guessed from file content rather than the actual filename. As a result, an attacker could upload a file named shell.php containing GIF‑like data; because the inferred MIME type maps to gif, the file passes the ext_in rule despite having a .php extension. If the application then saves the file with its original client name using $file->move($path) into a publicly accessible directory, the malicious PHP code can be executed by the web server, leading to arbitrary code execution. This vulnerability is a severe input‑validation flaw (CWE‑434).

Affected Systems

CodeIgniter4 is impacted in all releases prior to version 4.7.3. Applications that accept user‑controlled uploads, rely on ext_in for filename validation, move the file to a writable and web‑exposed directory using $file->move($path), and allow PHP or other executable scripts to run in that directory are at risk.

Risk and Exploitability

The CVSS score of 9.8 classifies this flaw as critical. The EPSS score of less than 1% indicates a very low probability of exploitation in the wild, and it is not listed in the CISA KEV catalog. However, the likely attack vector involves submitting a crafted file through an upload form; the problem is inferred from the described behavior of the ext_in rule. If the conditions above are met, an attacker could gain full control over the server by uploading and executing arbitrary code.

Generated by OpenCVE AI on July 30, 2026 at 23:27 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to CodeIgniter 4.7.3 or newer to apply the ext_in validation fix.
  • Store uploaded files in a directory that is not publicly accessible or configure the server to disallow execution of files in the upload directory.
  • Rename uploaded files or generate new filenames to eliminate executable extensions such as .php, and enforce strict MIME type checks to allow only safe file types.
  • Implement additional server‑side validation to ensure file content matches declared type and reject files that could be interpreted as scripts.

Generated by OpenCVE AI on July 30, 2026 at 23:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-2gr4-ppc7-7mhx CodeIgniter4 has a validation bypass when uploading file extensions via `ext_in` rule
History

Tue, 28 Jul 2026 20:45:00 +0000

Type Values Removed Values Added
First Time appeared Codeigniter
Codeigniter codeigniter
Vendors & Products Codeigniter
Codeigniter codeigniter

Mon, 20 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Fri, 17 Jul 2026 21:00:00 +0000

Type Values Removed Values Added
Description CodeIgniter is a PHP full-stack web framework. Prior to 4.7.3, the ext_in upload validation rule in system/Validation/StrictRules/FileRules.php checked the MIME-derived guessed extension instead of the client-provided filename extension. As a result, an uploaded file named shell.php containing GIF-like content could pass validation such as uploaded[avatar]|is_image[avatar]|mime_in[avatar,image/gif]|ext_in[avatar,gif] because the detected MIME type maps to gif, even though the uploaded filename extension is php. Applications are impacted if they accept user-controlled uploads, rely on ext_in to validate the uploaded filename extension, save uploaded files using the original client filename with $file->move($path), store uploads in a web-accessible directory, and allow PHP or other executable files to run from that directory. In those conditions, this may lead to arbitrary code execution. This issue is fixed in version 4.7.3.
Title CodeIgniter: Uploaded file extension validation bypass in `ext_in` rule
Weaknesses CWE-434
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

Codeigniter Codeigniter
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-20T13:47:15.742Z

Reserved: 2026-05-20T18:25:25.707Z

Link: CVE-2026-48062

cve-icon Vulnrichment

Updated: 2026-07-20T13:47:12.361Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-30T23:30:08Z

Weaknesses
  • CWE-434

    Unrestricted Upload of File with Dangerous Type