CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions
Critical severity. Published 7 August 2026. Update codeigniter4/framework to 4.7.4 or later: composer update codeigniter4/framework.
Which versions are affected?
| Package | Affected versions | Fixed in |
|---|---|---|
| codeigniter4/framework (opens in a new tab) | >= 4.3.0, < 4.7.4 | 4.7.4 |
What should you do?
Update every affected package you use to its fixed version, then check that nothing else in your project matches an advisory. To see which version you run, and whether anything is still affected:
composer show codeigniter4/framework
composer auditAdvisory details
| Severity | CriticalCVSS 9.4 |
|---|---|
| Published | |
| Updated | |
| CVE | CVE-2026-63221 (opens in a new tab) |
| GHSA | GHSA-c9w5-rwh3-7pm9 (opens in a new tab) |
| Weakness | CWE-89 |
What the advisory says
Impact A 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.
This affects only the deleteBatch() code path. Regular delete() operations escape where() binds correctly.
Patches Upgrade to v4.7.4 or later.
Workarounds If you cannot upgrade immediately:
Source: GHSA-c9w5-rwh3-7pm9 (opens in a new tab) in the GitHub Advisory Database (CC BY 4.0). Data from GitHub (opens in a new tab) as of .
Other recent advisories for this package
- CodeIgniter: Uploaded file extension validation bypass in `is_image` and `mime_in` rules (critical, 7 August 2026)
- CodeIgniter: Path traversal in UploadedFile::move() when using client-provided filenames (high, 7 August 2026)
- CodeIgniter: Spoofable forwarded HTTPS headers in IncomingRequest::isSecure() (opens in a new tab) (medium, 7 August 2026)