{"id":"CVE-2026-63221","aliases":["GHSA-c9w5-rwh3-7pm9"],"url":"https://o3.security/vulnerability/CVE-2026-63221","summary":"CodeIgniter: SQL injection is possible via Query Builder deleteBatch() when used with where() conditions","details":"### Impact\nA SQL injection vulnerability exists in the Query Builder's `deleteBatch()` method. When `deleteBatch()` is used together with `where()` conditions, the bound values from the `WHERE` clause are substituted directly into the generated SQL **with their escape flag ignored**, so they are never escaped or quoted. If an application passes user-controlled input to `where()` before calling `deleteBatch()`, that input is interpreted as SQL rather than as a value, allowing SQL injection.\n\nThis affects only the `deleteBatch()` code path. Regular `delete()` operations escape `where()` binds correctly.\n\n### Patches\nUpgrade to v4.7.4 or later.\n\n### Workarounds\nIf you cannot upgrade immediately:\n\n- Strictly validate and cast values (e.g. numeric IDs) before using them in conditions - though this does not fully protect string conditions.\n- Do not pass user-controlled input to `where()` when using `deleteBatch()`.\n- For user-controlled conditions, use a normal `delete()` with Query Builder binds instead of `deleteBatch(`).\n- Where possible, express required matching values through the batch data and `onConstraint()` rather than as separate user-controlled `where()` clauses.","published":"2026-07-31T04:03:34.352Z","modified":"2026-10-28T02:30:45.793577807Z","cvss":{"score":9.4,"severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H"},"epss":{"score":0.00372,"percentile":0.30951,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"codeigniter4/framework","fixedVersion":"4.7.4"}],"fix":{"url":"https://github.com/codeigniter4/CodeIgniter4/commit/f5e463b9a3e986389ce285963e51a7f1fab6559f","label":"codeigniter4/CodeIgniter4@f5e463b"},"references":[{"type":"WEB","url":"https://github.com/codeigniter4/CodeIgniter4/releases/tag/v4.7.4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/63xxx/CVE-2026-63221.json"},{"type":"ADVISORY","url":"https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-c9w5-rwh3-7pm9"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63221"},{"type":"FIX","url":"https://github.com/codeigniter4/CodeIgniter4/commit/f5e463b9a3e986389ce285963e51a7f1fab6559f"},{"type":"PACKAGE","url":"https://github.com/codeigniter4/CodeIgniter4"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:45.793577807Z"}}