CVE-2022-39284: Config\Cookie Secure or HttpOnly flag not set in CodeIgniter4

Published Oct 6, 2022
·
Updated

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

3 affected componentsFixes available
composer/codeigniter4/framework<4.2.7
CodeIgniter Codeigniter>=4.0.0<4.2.7
composer/codeigniter4/framework<4.2.7
4.2.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/codeigniter4/framework to a version that resolves this vulnerability.

    Fixed in 4.2.7
  2. Upgrade

    Upgrade CodeIgniter4 to a version that resolves this vulnerability.

    Fixed in 4.2.7
  3. 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

Oct 6, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
Advisory Published
09:39 AM
Data Sourced
via Packagist·09:39 AM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

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.

2

What is the severity of CVE-2022-39284?

CVE-2022-39284 has a severity rating of 4.3, which is considered medium.

3

How does CVE-2022-39284 affect CodeIgniter?

CVE-2022-39284 affects CodeIgniter versions prior to 4.2.7.

4

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.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203