CVE-2026-63221

CodeIgniter: SQL injection is possible via Query Builder deleteBatch() when used with where() conditions

Published Jul 31, 2026 CVSS 3.1 · 9.4 Critical EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability resides in the Query Builder deleteBatch() method of CodeIgniter 4. From version 4.3.0 until 4.7.3 inclusive, SQL fragments provided by the user in where() condition bindings are substituted into the generated delete statement without respecting the framework's escape flags. This leads to uncontrolled SQL injection, allowing an attacker to inject arbitrary SQL into the delete command. The flaw is defined as CWE-89. The attacker can delete, modify, or read data beyond the intended rows, potentially compromising confidentiality, integrity, or availability of the database.

Affected Systems

CodeIgniter 4.3.0 through 4.7.3. The affected product is CodeIgniter4, a PHP web framework maintained by the codeigniter4 organization. Applications built with these versions that use deleteBatch() with where() conditions are vulnerable.

Risk and Exploitability

This is a critical flaw with a CVSS score of 9.4. The EPSS score is <1%, indicating a very low likelihood of exploitation on a global scale. The vulnerability is not listed in the CISA Key Exploited Vulnerabilities catalog. Exploitation requires that an attacker can influence the parameters passed to deleteBatch(); based on the description, the attack vector is likely a web request that includes user‑controlled where() input. With sufficient privileges or without privileged database access, the attacker could execute arbitrary SQL commands through the unsafe substitution.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to CodeIgniter 4.7.4 or later, where the issue is fixed.
  • Avoid using deleteBatch() with user‑controlled where() conditions; if necessary, manually escape or validate the inputs.
  • Ensure the database user has minimal privileges to reduce impact if injection occurs.

Generated by OpenCVE AI on August 2, 2026 at 04:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-c9w5-rwh3-7pm9 CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions
History
Type Values Removed Values Added
First Time appeared Codeigniter
Codeigniter codeigniter
Vendors & Products Codeigniter
Codeigniter codeigniter
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description 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.
Title CodeIgniter: SQL injection is possible via Query Builder deleteBatch() when used with where() conditions
Weaknesses CWE-89
References
Metrics cvssV3_1

{'score': 9.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H'}

Weaknesses
  • CWE-89

    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 31, 2026, 1:52 PM
Reserved
Jul 15, 2026, 10:19 PM
Status
Deferred
Published
Jul 31, 2026, 6:16 AM
Modified
Sep 8, 2026, 8:51 PM