Loading...
Skip to main content

CVE-2026-63221 — CodeIgniter: SQL injection in...

CRITICAL

CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions

Published August 7, 2026Updated August 7, 2026Source: osv

Summary

### 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: - Strictly validate and cast values (e.g. numeric IDs) before using them in conditions - though this does not fully protect string conditions. - Do not pass user-controlled input to `where()` when using `deleteBatch()`. - For user-controlled conditions, use a normal `delete()` with Query Builder binds instead of `deleteBatch(`). - Where possible, express required matching values through the batch data and `onConstraint()` rather than as separate user-controlled `where()` clauses.

Advisory Timeline

  • First published August 7, 2026 (66 days ago).
  • Last revised August 7, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update codeigniter4/framework to 4.7.4 or later
composer require "codeigniter4/framework:^4.7.4"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: packagist (1).

PackageEcosystemAffectedFixed In
codeigniter4/framework
packagist
v4.3.0, v4.3.1, v4.3.2, v4.3.3 (+33 more)4.7.4

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.4 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H

Frequently Asked Questions

What is CVE-2026-63221?
CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.4/10).
How do I check if my project is affected by CVE-2026-63221?
CVE-2026-63221 affects codeigniter4/framework. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-63221 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.4

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-c9w5-rwh3-7pm9

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies