Skip to content
Laskyr

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

Fixed in codeigniter4/framework 4.7.4

This SQL injection issue affects codeigniter4/framework versions >= 4.3.0, < 4.7.4. Upgrade to the fixed version for your release line (4.7.4). The newest release, 4.7.6, is not affected.

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?

Run composer show codeigniter4/framework in your project, then enter the version. We check it against this and every other known codeigniter4/framework advisory.

Who can exploit CVE-2026-63221

CVSS vector (scored by GitHub): CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H

Your app is only exposed if it uses the affected part of codeigniter4/framework. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-63221 in codeigniter4/framework

  1. Find the installed version: composer show codeigniter4/framework. If you never required it yourself, composer why codeigniter4/framework shows which package pulls it in.
  2. Update it: composer update codeigniter4/framework --with-all-dependencies. You need 4.7.4 or newer.
  3. 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.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-63221.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for SQL injection issues while the upgrade waits. None of it replaces the fix.

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.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-63221. Advisory title: “CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions”.

References

Other codeigniter4/framework advisories

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 fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit