CVE-2022-39284: Config\Cookie Secure or HttpOnly flag not set in CodeIgniter4
CodeIgniter is a PHP full-stack web framework. In versions prior to 4.2.7 setting $secure or $httponly value to true in Config\Cookie is not reflected in setcookie() or Response::setCookie(). As a result cookie values are erroneously exposed to scripts. It should be noted that this vulnerability does not affect session cookies. Users are advised to upgrade to v4.2.7 or later. Users unable to upgrade are advised to manually construct their cookies either by setting the options in code or by constructing Cookie objects. Examples of each workaround are available in the linked GHSA.
Other sources
CVE-2022-39284: Config\Cookie Secure or HttpOnly flag not set in CodeIgniter4
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
composer/codeigniter4/frameworkto a version that resolves this vulnerability.Fixed in 4.2.7 - Upgrade
Upgrade
CodeIgniter4to a version that resolves this vulnerability.Fixed in 4.2.7 - Configuration
If unable to upgrade, manually construct cookies by setting the Secure or HttpOnly options in code or by constructing Cookie objects.
CodeIgniter4 cookies Secure or HttpOnly = true
Event History
Frequently Asked Questions
What is CVE-2022-39284?
CVE-2022-39284 is a vulnerability in CodeIgniter version 4.2.7 that allows cookie values to be exposed to scripts due to the Config\Cookie Secure or HttpOnly flag not being set properly.
What is the severity of CVE-2022-39284?
CVE-2022-39284 has a severity rating of 4.3, which is considered medium.
How does CVE-2022-39284 affect CodeIgniter?
CVE-2022-39284 affects CodeIgniter versions prior to 4.2.7.
How can I fix CVE-2022-39284?
To fix CVE-2022-39284, update CodeIgniter to version 4.2.7 or later and ensure that the `$secure` and `$httponly` values are set to `true` in Config\Cookie.
Where can I find more information about CVE-2022-39284?
You can find more information about CVE-2022-39284 in the official CodeIgniter documentation and the GitHub security advisory.