{"id":"CVE-2025-54418","published":"2025-07-28T14:47:20Z","modified":"2025-07-28T17:19:14Z","title":"CodeIgniter4's ImageMagick Handler has Command Injection Vulnerability","vendor":"codeigniter4","product":"CodeIgniter4","tier":"tail","description":{"text":"CodeIgniter is a PHP full-stack web framework. A command injection vulnerability present in versions prior to 4.6.2 affects applications that use the ImageMagick handler for image processing (`imagick` as the image library) and either allow file uploads with user-controlled filenames and process uploaded images using the `resize()` method or use the `text()` method with user-controlled text content or options. An attacker can upload a file with a malicious filename containing shell metacharacters that get executed when the image is processed or provide malicious text content or options that get executed when adding text to images Users should upgrade to v4.6.2 or later to receive a patch. As a workaround, switch to the GD image handler (`gd`, the default handler), which is not affected by either vulnerability. For file upload scenarios, instead of using user-provided filenames, generate random names to eliminate the attack vector with `getRandomName()` when using the `move()` method, or use the `store()` method, which automatically generates safe filenames. For text operations, if one must use ImageMagick with user-controlled text, sanitize the input to only allow safe characters and validate/restrict text options.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.03,"percentile":0.88102,"provenance":"source"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"references":[{"url":"https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-9952-gv64-x94c","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/codeigniter4/CodeIgniter4/commit/e18120bff1da691e1d15ffc1bf553ae7411762c0","tags":["x_refsource_MISC"]},{"url":"https://cwe.mitre.org/data/definitions/78.html","tags":["x_refsource_MISC"]},{"url":"https://owasp.org/www-community/attacks/Command_Injection","tags":["x_refsource_MISC"]}],"priority":{"score":24.5,"factors":[{"name":"EPSS percentile","points":17.62},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"codeigniter4","affectedVersions":[{"vendor":"codeigniter4","product":"CodeIgniter4","versions":["< 4.6.2"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-07-28T17:19:03.230334Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"codeigniter4/framework","vulnerableRanges":["<4.6.2"],"patched":["4.6.2"],"from":["GHSA-9952-gv64-x94c"],"provenance":"source"}],"summary":{"text":"The command injection flaw lives in CodeIgniter4, a PHP web framework, within its ImageMagick image handler (the imagick library option) in versions prior to 4.6.2. An unauthenticated remote attacker can exploit it without user interaction when an application uses that handler and either accepts uploads with user-controlled filenames processed through resize(), or passes user-controlled text or options to text(), causing shell metacharacters to be executed on the server.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:44:06Z"},"euvd":{"id":"EUVD-2025-22914","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-46240","published":"2023-10-31","fixed":"4.4.3","kev":false},{"cve":"CVE-2024-29904","published":"2024-03-29","fixed":"4.4.7","kev":false},{"cve":"CVE-2025-24013","published":"2025-01-20","fixed":"4.5.8","kev":false,"link":{"from":"CVE-2025-24013","to":"CVE-2025-54418","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:codeigniter4/framework","fromFixed":"4.5.8","toFixed":"4.6.2","daysApart":189}]}},{"cve":"CVE-2025-54418","published":"2025-07-28","fixed":"4.6.2","kev":false},{"cve":"CVE-2026-48062","published":"2026-07-17","fixed":"4.7.3","kev":false,"link":{"from":"CVE-2025-54418","to":"CVE-2026-48062","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:codeigniter4/framework","fromFixed":"4.6.2","toFixed":"4.7.3","daysApart":354}]}},{"cve":"CVE-2026-63220","published":"2026-07-31","fixed":"4.7.4","kev":false},{"cve":"CVE-2026-63221","published":"2026-07-31","fixed":"4.7.4","kev":false}],"package":"Packagist:codeigniter4/framework"}}