Skip to content

Instantly share code, notes, and snippets.

@alon710
Created January 24, 2026 22:44
Show Gist options
  • Select an option

  • Save alon710/9435d5b883170f1ce3ee2302e8511300 to your computer and use it in GitHub Desktop.

Select an option

Save alon710/9435d5b883170f1ce3ee2302e8511300 to your computer and use it in GitHub Desktop.
CVE-2025-54418: Shells in Your Selfies: CodeIgniter 4 ImageMagick RCE - CVE Security Report

CVE-2025-54418: Shells in Your Selfies: CodeIgniter 4 ImageMagick RCE

CVSS Score: 9.8 Published: 2025-07-28 Full Report: https://cvereports.com/reports/CVE-2025-54418

Summary

A critical OS Command Injection vulnerability in CodeIgniter 4's ImageMagick handler allows unauthenticated attackers to achieve Remote Code Execution (RCE) via malicious filenames or text overlays.

TL;DR

CodeIgniter 4 versions before 4.6.2 failed to sanitize inputs when wrapping the ImageMagick CLI. By uploading an image with a carefully crafted filename or using the text overlay feature, an attacker can break out of the command string and execute arbitrary shell commands on the server.

Exploit Status: POC

Technical Details

  • CWE ID: CWE-78 (OS Command Injection)
  • CVSS v3.1: 9.8 (Critical)
  • Attack Vector: Network
  • Privileges Required: None
  • User Interaction: None
  • Impact: Remote Code Execution (RCE)

Affected Systems

  • CodeIgniter 4 Framework
  • CodeIgniter 4: < 4.6.2 (Fixed in: 4.6.2)

Mitigation

  • Upgrade to CodeIgniter 4.6.2 or later
  • Switch Image Handler from 'imagick' to 'gd'
  • Force random filenames for all uploads
  • Sanitize all user input passed to image processing text functions

Remediation Steps:

  1. Check app/Config/Images.php to see if $handler is set to imagick.
  2. If using imagick, run composer update to pull the latest framework version.
  3. Verify the update by checking system/Images/Handlers/ImageMagickHandler.php for escapeshellarg() usage.

References


Generated by CVEReports - Automated Vulnerability Intelligence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment