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.
Published: 2026-07-31
Score: 9.4 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Sun, 02 Aug 2026 19:45:00 +0000

Type Values Removed Values Added
First Time appeared Codeigniter
Codeigniter codeigniter
Vendors & Products Codeigniter
Codeigniter codeigniter

Fri, 31 Jul 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 31 Jul 2026 05:30:00 +0000

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'}


Subscriptions

Codeigniter Codeigniter
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-31T13:52:40.376Z

Reserved: 2026-07-15T22:19:06.907Z

Link: CVE-2026-63221

cve-icon Vulnrichment

Updated: 2026-07-31T13:52:36.397Z

cve-icon NVD

Status : Received

Published: 2026-07-31T06:16:31.603

Modified: 2026-07-31T14:16:50.873

Link: CVE-2026-63221

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-02T19:30:17Z

Weaknesses
  • CWE-89

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