CVE-2026-142138: CodeIgniter4 through 4.7.6 XSS via Unescaped Form Helper Attribute Values
CodeIgniter4 through 4.7.6 contains a cross-site scripting vulnerability in parseformattributes() and related form helpers that escape only the value key. Attackers who influence values passed to forminput(), formlabel(), formdropdown() or formdatalist() can inject a double quote and event handlers to execute script in victims' browsers.
Affected Software
Event History
Frequently Asked Questions
What conditions are required for exploitation?
An attacker must be able to influence attribute values passed to affected form helpers, including form_input(), form_label(), form_dropdown(), or form_datalist(). Exploitation also requires a victim to load the page containing the crafted form output.
Are all CodeIgniter4 applications affected by default?
The issue affects CodeIgniter4 through version 4.7.6, but exploitation depends on whether an application passes attacker-influenced data into attribute values for the affected form helpers. Applications that do not use those helpers with untrusted attribute values are not exposed through this vector.
How can developers identify vulnerable code?
Review uses of form_input(), form_label(), form_dropdown(), and form_datalist() for attribute values derived from request data or other attacker-controlled sources. Inputs containing a double quote followed by an event-handler attribute are relevant indicators of the vulnerable output path.