GHSA-2GR4-PPC7-7MHX
Vulnerability from github – Published: 2026-06-11 17:16 – Updated: 2026-06-11 17:16Impact
The ext_in upload validation rule 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: $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. The default application does not expose such an upload endpoint.
Patches
Upgrade to v4.7.3 or later.
Workarounds
- Save uploads outside the public web root, preferably under
writable/uploads - Use
$file->store()or$file->move($path, $file->getRandomName())instead of preserving the original filename - Disable script execution in any public upload directory
- Manually verify the client filename extension before moving the file
- Reject files when
$file->getClientExtension()is not in the allowed list or does not match$file->guessExtension()
Resources
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c 4.7.2"
},
"package": {
"ecosystem": "Packagist",
"name": "codeigniter4/framework"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.7.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-48062"
],
"database_specific": {
"cwe_ids": [
"CWE-434"
],
"github_reviewed": true,
"github_reviewed_at": "2026-06-11T17:16:09Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "### Impact\nThe `ext_in` upload validation rule 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:\n```\nuploaded[avatar]|is_image[avatar]|mime_in[avatar,image/gif]|ext_in[avatar,gif]\n```\nbecause the detected MIME type maps to `gif`, even though the uploaded filename extension is `php`.\n\nApplications are impacted if they:\n- accept user-controlled uploads,\n- rely on `ext_in` to validate the uploaded filename extension,\n- save uploaded files using the original client filename: `$file-\u003emove($path)`,\n- store uploads in a web-accessible directory,\n- and allow PHP or other executable files to run from that directory.\n\nIn those conditions, this may lead to arbitrary code execution. The default application does not expose such an upload endpoint.\n\n### Patches\nUpgrade to v4.7.3 or later.\n\n### Workarounds\n- Save uploads outside the public web root, preferably under `writable/uploads`\n- Use `$file-\u003estore()` or `$file-\u003emove($path, $file-\u003egetRandomName())` instead of preserving the original filename\n- Disable script execution in any public upload directory\n- Manually verify the client filename extension before moving the file\n- Reject files when `$file-\u003egetClientExtension()` is not in the allowed list or does not match `$file-\u003eguessExtension()`\n\n### Resources\n- [CodeIgniter4 uploaded files documentation](https://codeigniter.com/user_guide/libraries/uploaded_files.html#moving-files)\n- [CodeIgniter4 file upload validation documentation](https://codeigniter.com/user_guide/libraries/validation.html#rules-for-file-uploads)\n- [CWE-434: Unrestricted Upload of File with Dangerous Type](https://cwe.mitre.org/data/definitions/434.html)\n- [OWASP File Upload Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html)",
"id": "GHSA-2gr4-ppc7-7mhx",
"modified": "2026-06-11T17:16:09Z",
"published": "2026-06-11T17:16:09Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-2gr4-ppc7-7mhx"
},
{
"type": "WEB",
"url": "https://github.com/codeigniter4/CodeIgniter4/commit/29299349e7d232e9532767c7cefaed30957309be"
},
{
"type": "WEB",
"url": "https://codeigniter.com/user_guide/libraries/uploaded_files.html#moving-files"
},
{
"type": "WEB",
"url": "https://codeigniter.com/user_guide/libraries/validation.html#rules-for-file-uploads"
},
{
"type": "PACKAGE",
"url": "https://github.com/codeigniter4/CodeIgniter4"
},
{
"type": "WEB",
"url": "https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "CodeIgniter4 has a validation bypass when uploading file extensions via `ext_in` rule"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.