Security Digest · Vulnerability record
CVE-2025-54418: CodeIgniter4's ImageMagick Handler has Command Injection Vulnerability
CodeIgniter is a PHP full-stack web framework.
CVSS 9.8 Critical EPSS 1.5% · p75
Should you act?
Critical and remotely reachable
No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.
- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 1.5%, percentile 75: FIRST’s model estimates a 1.5% chance of exploitation activity in the next 30 days, higher than 75% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes
codeigniter4/framework(Composer (PHP)) < 4.6.2, fixed in 4.6.2. Check your lockfile, including transitive dependencies.
What it is
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.
From the GitHub advisory
Impact This vulnerability 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
Patches Upgrade to v4.6.2 or later.
Workarounds 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 you must use ImageMagick with user-controlled text, sanitize the input to only allow safe characters: pregreplace('/[^a-zA-Z0-9\s.,!?-]/', '', $text) and validate/restrict text options
References OWASP Command Injection Prevention CWE-78: OS Command Injection
Weakness type: CWE-78.
Product: codeigniter4/framework (Composer (PHP)) · Assigned by: GitHub_M · Published: 2025-07-28
Affected and fixed versions
| Ecosystem | Package | Vulnerable | First fixed |
|---|---|---|---|
| Composer (PHP) | codeigniter4/framework | < 4.6.2 | 4.6.2 |
| Vendor | Product | Affected versions (per CVE record) |
|---|---|---|
| codeigniter4 | CodeIgniter4 | < 4.6.2 |
Severity scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_M | 3.1 | 9.8 Critical | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
- Attack vector: network (remotely reachable)
- Attack complexity: low
- Privileges required: none (no login)
- User interaction: none
- Scope: unchanged
CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.
Exploitation and urgency
- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none, automatable no, technical impact total.
- FIRST EPSS (model of 2026-10-21): 1.53% probability of exploitation activity in the next 30 days; percentile 75.
Timeline
- — CVE record last updated
- — CVE record published by GitHub_M
- — GitHub-reviewed advisory GHSA-9952-gv64-x94c published (critical)
Sources and references
Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.
Vulnerability records
- GitHub Advisory GHSA-9952-gv64-x94c github.com
- CVE.org record CVE-2025-54418 cve.org
- NVD entry CVE-2025-54418 nvd.nist.gov
Other references from the CVE record and advisory
- github.com github.com
- github.com github.com
- cwe.mitre.org cwe.mitre.org
- owasp.org owasp.org
Critical Composer (PHP) advisories · Today’s Security Digest