CVE-2022-39284
PHP vulnerability analysis and mitigation

Overview

CodeIgniter, a PHP full-stack web framework, was found to have a security vulnerability (CVE-2022-39284) in versions prior to 4.2.7. The issue involves the $secure or $httponly values set to true in Config\Cookie not being properly reflected in set_cookie() or Response::setCookie() functions, resulting in cookie values being erroneously exposed to scripts. This vulnerability was discovered and disclosed in October 2022, though it notably does not affect session cookies (GitHub Advisory, NVD).

Technical details

The vulnerability stems from an implementation flaw where the cookie configuration settings in Config\Cookie are not properly applied when creating new cookies. When using the set_cookie() helper function or Response::setCookie() method, the security flags specified in the configuration are ignored, potentially exposing cookie data. The vulnerability has been assigned a CVSS v3.1 Base Score of 4.3 (MEDIUM) by NVD, with a vector string of CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N (NVD).

Impact

The primary impact of this vulnerability is that cookies intended to be secure can be exposed to unauthorized access. When the secure flag is not properly set, cookies may be transmitted over insecure HTTP connections, making them vulnerable to interception. Similarly, when the httponly flag is not applied as configured, cookies become accessible to client-side scripts, potentially exposing them to cross-site scripting (XSS) attacks (GitHub Advisory).

Mitigation and workarounds

Users are advised to upgrade to CodeIgniter version 4.2.7 or later which contains the fix for this vulnerability. For those unable to upgrade immediately, two workarounds are available: 1) Explicitly specify the security options when setting cookies, or 2) Use the Cookie object directly. Example of explicit specification: set_cookie(['name' => $name, 'value' => $value, 'secure' => true, 'httponly' => true]) (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-13828CRITICAL9
  • PHPPHP
  • mautic/core
NoYesDec 02, 2025
CVE-2025-13827HIGH8.8
  • PHPPHP
  • mautic/grapes-js-builder-bundle
NoYesDec 02, 2025
CVE-2025-66312MEDIUM6.2
  • PHPPHP
  • getgrav/grav
NoYesDec 01, 2025
CVE-2025-66311MEDIUM6.2
  • PHPPHP
  • getgrav/grav
NoYesDec 01, 2025
CVE-2025-66310MEDIUM6.2
  • PHPPHP
  • getgrav/grav
NoYesDec 01, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management