BuzzPHP
LightDarkSystem

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?

PackageAffected versionsFixed in
codeigniter4/framework (opens in a new tab)>= 4.3.0, < 4.7.44.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 audit

Advisory details

SeverityCriticalCVSS 9.4
Published
Updated
CVECVE-2026-63221 (opens in a new tab)
GHSAGHSA-c9w5-rwh3-7pm9 (opens in a new tab)
WeaknessCWE-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

All Composer security advisories