{"id":"CVE-2026-41890","aliases":["CVE-2026-41890","GHSA-vgrf-pr28-vf98"],"related":[],"kind":"vulnerability","state":"published","title":"CI4MS: Arbitrary Database Table Drop via Theme deleteProcess","summary":"CI4MS is a CodeIgniter 4-based CMS skeleton that delivers a production-ready, modular architecture with RBAC authorization and theme support. From version 0.31.1.0 to before version 0.31.8.0, the deleteProcess() action accepts a POST parameter tables[] containing arbitrary table names. These are passed directly to $forge->dropTable() without validating that the tables belong to the theme being deleted. The deleteConfirm view correctly populates tables[] from the theme's own migration files, but the server-side deleteProcess does not verify the received values against those files. An authenticated admin can craft a POST request with arbitrary table names and drop any table in the database. This issue has been patched in version 0.31.8.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. From version 0.31.1.0 to before version 0.31.8.0, the deleteProcess() action accepts a POST parameter tables[] containing arbitrary table names. These are passed directly to $forge->dropTable() without validating that the tables belong to the theme being deleted. The deleteConfirm view correctly populates tables[] from the theme's own migration files, but the server-side deleteProcess does not verify the received values against those files. An authenticated admin can craft a POST request with arbitrary table names and drop any table in the database. This issue has been patched in version 0.31.8.0.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe `deleteProcess()` action accepts a POST parameter `tables[]` containing arbitrary table names. These are passed directly to `$forge->dropTable()` without validating that the tables belong to the theme being deleted.\n\nThe `deleteConfirm` view correctly populates `tables[]` from the theme's own migration files, but the server-side `deleteProcess` does not verify the received values against those files. An authenticated admin can craft a POST request with arbitrary table names and drop any table in the database.\n\nThis is a real bug even within the admin trust model: the action should be scoped to the theme's own tables. The permission grants  delete this theme's data\", not \"drop any table\".\n\n### Details\n\n### Location\n`modules/Theme/Controllers/Theme.php` :: `deleteProcess()` ~line 147\n\n### Vulnerable Code\n```php\npublic function deleteProcess(string $slug)\n{\n    $themeName = $slug;\n    $activeTheme = setting('App.siteTheme');\n    if ($activeTheme === $themeName) {\n        return redirect()->route('templateSettings')...;\n    }\n\n    $tablesToDrop = $this->request->getPost('tables');  // ← user-supplied, unvalidated\n    if (!empty($tablesToDrop) && is_array($tablesToDrop)) {\n        $forge = \\Config\\Database::forge();\n        $db    = \\Config\\Database::connect();\n        foreach ($tablesToDrop as $table) {\n            if ($db->tableExists($table)) {\n                $forge->dropTable($table, true);  // ← no whitelist check\n            }\n        }\n    }\n```\n\n### PoC\n1. Authenticate to the backend (any user with theme.delete permission)\n2. POST to `/backend/themes/delete-process/<any_non_active_theme_slug>`\n3. Include `tables[]=<any_table>` in POST body\n4. The named tables are dropped without validation\n\n### Impact\n- Dropped `ci4ms_blog` (confirmed in test)\n- Dropped `ci4ms_users` + `ci4ms_auth_identities` simultaneously — disables all authentication (confirmed)\n- Any table in the database can be targeted\n\n### Additional note\nQuick note on the design intent for deleteProcess — I noticed delete_confirm.php scopes the checkboxes to the theme's own migration files, and the CHANGELOG confirms the selective deletion was intentional (admins can choose which tables to keep). The server-side deleteProcess already has all the information it needs to validate the input — deleteConfirm derives the valid table set from the migration files, deleteProcess just needs to do the same before acting on the POST. Happy to clarify if useful.","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. Desde la versión 0.31.1.0 hasta antes de la versión 0.31.8.0, la acción deleteProcess() acepta un parámetro POST tables[] que contiene nombres de tablas arbitrarios. Estos se pasan directamente a $forge  ->  dropTable() sin validar que las tablas pertenezcan al tema que se está eliminando. La vista deleteConfirm rellena correctamente tables[] a partir de los propios archivos de migración del tema, pero el deleteProcess del lado del servidor no verifica los valores recibidos contra esos archivos. Un administrador autenticado puede crear una solicitud POST con nombres de tablas arbitrarios y eliminar cualquier tabla en la base de datos. Este problema ha sido parcheado en la versión 0.31.8.0.","source":"nvd"}],"published":"2026-05-04T20:50:10.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:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-20"],"affected":[{"ranges":[{"version":">= 0.31.1.0, < 0.31.8.0","status":"affected"}],"vendor":"ci4-cms-erp","product":"ci4ms","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.31.1.0","status":"affected","fixed":"0.31.8.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-vgrf-pr28-vf98","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ci4-cms-erp/ci4ms/releases/tag/0.31.8.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41890","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/ci4-cms-erp/ci4ms/commit/2f38284281ce6b435ea42003951f14109ac2cea7","tags":["web"],"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":"yes","technicalImpact":"partial","date":"2026-05-07T13:42:31.985Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41890","url":"https://www.cve.org/CVERecord?id=CVE-2026-41890","licence":"CVE Terms of Use","modified":"2026-05-07T13:42:35.440Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vgrf-pr28-vf98","url":"https://github.com/advisories/GHSA-vgrf-pr28-vf98","licence":"CC-BY-4.0","modified":"2026-05-08T20:33:36.536Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41890","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41890","licence":"Public domain","modified":"2026-10-26T19:10:00.163Z"}],"updatedAt":"2026-11-25T22:59:20.857Z","epss":{"score":0.00409,"percentile":0.3726,"date":"2026-12-01T12:00:22.000Z"}}