Framework: CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions (CVE-2026-63221)
A critical SQL injection vulnerability exists in CodeIgniter 4's Query Builder deleteBatch() method when used with where() conditions. The vulnerability arises because bound values from the WHERE clause are directly substituted into the SQL query without proper escaping or quoting. This flaw allows user-controlled input passed to where() before deleteBatch() to be interpreted as SQL code, enabling SQL injection attacks. Regular delete() operations are not affected. The issue affects versions from 4.3.0 up to but not including 4.7.4. A patch is available in version 4.7.4 and later.
AI Analysis
Technical Summary
The CodeIgniter 4 framework contains a SQL injection vulnerability (CVE-2026-63221) in the Query Builder's deleteBatch() method when combined with where() conditions. Specifically, bound values from the WHERE clause are inserted into the generated SQL query with their escape flags ignored, causing them to be unescaped and unquoted. This allows an attacker to inject arbitrary SQL if user-controlled input is passed to where() before calling deleteBatch(). This vulnerability is limited to the deleteBatch() code path; the regular delete() method correctly escapes where() binds. The vulnerability affects versions >=4.3.0 and <4.7.4. The vendor has released version 4.7.4 to address this issue.
Potential Impact
Successful exploitation of this vulnerability can lead to SQL injection, allowing an attacker to execute arbitrary SQL commands. This can result in unauthorized data manipulation, data leakage, or denial of service. The CVSS score of 9.4 (critical) reflects the high impact on confidentiality, integrity, and availability. Since the vulnerability is exploitable remotely without authentication, it poses a significant risk to affected applications.
Mitigation Recommendations
Upgrade to CodeIgniter version 4.7.4 or later, where this vulnerability is fixed. If immediate upgrade is not possible, avoid passing user-controlled input to where() when using deleteBatch(). Validate and cast input strictly, especially numeric IDs, though this does not fully protect string inputs. Alternatively, use the normal delete() method with Query Builder binds for user-controlled conditions or express matching values through batch data and onConstraint() instead of separate where() clauses.
Framework: CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions (CVE-2026-63221)
Description
A critical SQL injection vulnerability exists in CodeIgniter 4's Query Builder deleteBatch() method when used with where() conditions. The vulnerability arises because bound values from the WHERE clause are directly substituted into the SQL query without proper escaping or quoting. This flaw allows user-controlled input passed to where() before deleteBatch() to be interpreted as SQL code, enabling SQL injection attacks. Regular delete() operations are not affected. The issue affects versions from 4.3.0 up to but not including 4.7.4. A patch is available in version 4.7.4 and later.
CVSS v3.1
Score 9.4critical
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The CodeIgniter 4 framework contains a SQL injection vulnerability (CVE-2026-63221) in the Query Builder's deleteBatch() method when combined with where() conditions. Specifically, bound values from the WHERE clause are inserted into the generated SQL query with their escape flags ignored, causing them to be unescaped and unquoted. This allows an attacker to inject arbitrary SQL if user-controlled input is passed to where() before calling deleteBatch(). This vulnerability is limited to the deleteBatch() code path; the regular delete() method correctly escapes where() binds. The vulnerability affects versions >=4.3.0 and <4.7.4. The vendor has released version 4.7.4 to address this issue.
Potential Impact
Successful exploitation of this vulnerability can lead to SQL injection, allowing an attacker to execute arbitrary SQL commands. This can result in unauthorized data manipulation, data leakage, or denial of service. The CVSS score of 9.4 (critical) reflects the high impact on confidentiality, integrity, and availability. Since the vulnerability is exploitable remotely without authentication, it poses a significant risk to affected applications.
Mitigation Recommendations
Upgrade to CodeIgniter version 4.7.4 or later, where this vulnerability is fixed. If immediate upgrade is not possible, avoid passing user-controlled input to where() when using deleteBatch(). Validate and cast input strictly, especially numeric IDs, though this does not fully protect string inputs. Alternatively, use the normal delete() method with Query Builder binds for user-controlled conditions or express matching values through batch data and onConstraint() instead of separate where() clauses.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-c9w5-rwh3-7pm9
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-63221"]
- Ecosystems
- ["Packagist"]
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a7742a8bf8831d539b08cef
Added to database: 08/08/2026, 14:52:24 UTC
Last enriched: 08/08/2026, 15:20:11 UTC
Last updated: 08/08/2026, 15:20:11 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.