Skip to content

← Actionable
Critical, CVSS 9.4amended

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

CVE-2026-63221GHSA-c9w5-rwh3-7pm9

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (codeigniter4/framework 4.7.4), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
9.4 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
EPSS
  • CVE-2026-63221: 0.61% estimated exploitation activity in the next 30 days; percentile 49.36 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-c9w5-rwh3-7pm9

  2. Revision 1 · created ·

    Published from osv record GHSA-c9w5-rwh3-7pm9

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-63221

Advisory: CodeIgniter: SQL injection in Query Builder deleteBatch() when used with where() conditions
IDs: CVE-2026-63221, GHSA-c9w5-rwh3-7pm9
Record: https://patchnext.com/advisories/cve-2026-63221 (revision 2, source checked 26 Oct 2026, 14:50 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Critical (CVSS 9.4)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: codeigniter4/framework 4.7.4. A vendor fix does not mean a deployment is fixed.

## Affected components
- Packagist codeigniter4/framework: affected >= 4.3.0, < 4.7.4; fixed in 4.7.4

## Suggested inspection (read-only)
- Packagist codeigniter4/framework: check the installed version with your package manager.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on codeigniter4/framework.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-c9w5-rwh3-7pm9 (OSV record GHSA-c9w5-rwh3-7pm9 lists affected ranges: Packagist codeigniter4/framework >=4.3.0 <4.7.4 (fixed))
- Verified: https://github.com/advisories/GHSA-c9w5-rwh3-7pm9 (GitHub-reviewed advisory GHSA-c9w5-rwh3-7pm9 lists affected ranges: Packagist codeigniter4/framework >=4.3.0 <4.7.4)

Commands are suggestions: review each one before running it.

Loading voting…