codeigniter4/framework security advisory
CVE-2026-63221: CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions
CVE-2026-63221 is a critical-severity SQL injection vulnerability in the PHP package codeigniter4/framework (CVSS 9.4), published 31 July 2026. It is fixed in 4.7.4; earlier versions are affected. It can be exploited without an account.
critical 9.4 published 2026-07-31 · updated 2026-09-08
- Affected versions
- >= 4.3.0, < 4.7.4
- Fixed in
- 4.7.4
- Newest release
- 4.7.6
- Severity
- Critical · CVSS 9.4
- Type
- SQL injection
CWE-89 - Exploited in the wild
- Not on the CISA KEV list
checked 2026-11-04
Is your codeigniter4/framework version affected?
Who can exploit CVE-2026-63221
- Access: No account. Anyone who can send a request to an app that uses the affected code.
CVSS vector (scored by GitHub): CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
How to fix CVE-2026-63221 in codeigniter4/framework
- Find the installed version:
composer show codeigniter4/framework. If you never required it yourself,composer why codeigniter4/frameworkshows which package pulls it in. - Update it:
composer update codeigniter4/framework --with-all-dependencies. You need 4.7.4 or newer. - If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example
"codeigniter4/framework": "^4.7.4"if you can take that version), or upgrade the package that requires it. - Run
composer audit. It reads the same advisory data and should no longer list CVE-2026-63221. - Commit composer.lock and deploy it. On the server, run
composer install --no-devfrom the lock file, notcomposer update.
If you cannot upgrade yet
- Make sure user input never reaches the affected query builder or ORM method unvalidated; allow-list column and sort names.
- Give the app's database user only the permissions it needs.
- If your app does not use the affected feature, note that in your audit, but still plan the upgrade.
The CVE-2026-63221 advisory
CodeIgniter is a PHP full-stack web framework. From 4.3.0 through 4.7.3, Query Builder deleteBatch() substitutes bound values from where() conditions into generated SQL while ignoring their escape flags, allowing user-controlled condition values to be interpreted as SQL. This affects only the deleteBatch() code path. Regular delete() operations escape where() binds correctly. This issue is fixed in version 4.7.4.
References
- GitHub advisory GHSA-c9w5-rwh3-7pm9 github.com
- Fix commit f5e463b github.com
- Release v4.7.4 github.com
Other codeigniter4/framework advisories
- critical CVE-2026-63223: CodeIgniter: Uploaded file extension validation bypass in is_image and mime_in rules 2026-08-07
- high CVE-2026-63222: CodeIgniter: Path traversal in UploadedFile::move() when using client-provided filenames 2026-08-07
- medium CVE-2026-63220: CodeIgniter: Spoofable forwarded HTTPS headers in IncomingRequest::isSecure() 2026-08-07
- critical CVE-2026-48062: CodeIgniter4 has a validation bypass when uploading file extensions via ext_in rule 2026-06-11
- critical CVE-2025-54418: CodeIgniter4's ImageMagick Handler has Command Injection Vulnerability 2025-07-28
- medium CVE-2025-24013: Missing validation of header name and value in codeigniter4/framework 2025-01-21
Related
Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.
Ask about a fixWhere this data comes from
- Affected and fixed versions: the Packagist security advisories API (GitHub Advisory Database and FriendsOfPHP), the same data
composer audituses. Synced 2026-11-03. - Description, score, weakness and references: NIST National Vulnerability Database (NVD), checked 2026-11-04. This product uses data from the NVD API but is not endorsed or certified by the NVD.
- Exploited-in-the-wild status: the CISA Known Exploited Vulnerabilities catalog, checked 2026-11-04.
- Compiled by Daniel Lasek at Laskyr from the sources above. The summary, “who can exploit it”, “how to fix it” and hardening sections are our plain-English reading of the record and are generated from it. The quoted description is the record's own text. Spot an error? Tell us.