Every CVE Search/ Get API key

CVE-2022-39284

Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued in Codeigniter4

2.6 LowFix available

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 set_cookie() 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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
Low
User interaction
Required

What an attacker can affect

Confidentiality
Low
Integrity
None
Availability
None

Exploit likelihood

1.12%Up 0.1 points since Oct 7, 2022
90%50%10%1%

What each source reports

CVE List Score used 2.6

Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued 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 set_cookie() 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.

Record
CVE-2022-39284
CVSS 3.1
2.6 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
Weakness
CWE-665
Updated
2026-11-02
EUVDEUVD-2022-7041 2.6

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 set_cookie() 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.

Record
EUVD-2022-7041
CVSS 3.1
2.6 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-745p-r637-7vvp 2.6

Codeigniter4's Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued

Impact

Setting $secure or $httponly value to true in Config\Cookie is not reflected in set_cookie() or Response::setCookie().

Note This vulnerability does not affect session cookies.

The following code does not issue a cookie with the secure flag even if you set $secure = true in Config\Cookie.

helper('cookie');

$cookie = [
    'name'  => $name,
    'value' => $value,
];
set_cookie($cookie);
// or
$this->response->setCookie($cookie);

Patches

Upgrade to v4.2.7 or later.

Workarounds

  1. Specify the options explicitly.
    helper('cookie');
    
    $cookie = [
        'name'     => $name,
        'value'    => $value,
        'secure'   => true,
        'httponly' => true,
    ];
    set_cookie($cookie);
    // or
    $this->response->setCookie($cookie);
    
  2. Use Cookie object.
    use CodeIgniter\Cookie\Cookie;
    
    helper('cookie');
    
    $cookie = new Cookie($name, $value);
    set_cookie($cookie);
    // or
    $this->response->setCookie($cookie);
    

References

For more information

If you have any questions or comments about this advisory:

Record
GHSA-745p-r637-7vvp
CVSS 3.1
2.6 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
Weakness
CWE-665, CWE-732
Updated
2026-11-02
NVD 2.6

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 set_cookie() 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.

Record
CVE-2022-39284
CVSS 3.1
2.6 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
CVSS 3.1
4.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
Weakness
CWE-665, CWE-732
Updated
2026-11-02
OSV 2.6

Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued 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 set_cookie() 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.

Record
CVE-2022-39284
CVSS 3.1
2.6 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
Weakness
CWE-665
Updated
2026-11-02
OSVGHSA-745p-r637-7vvp 2.6

Codeigniter4's Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued

Impact

Setting $secure or $httponly value to true in Config\Cookie is not reflected in set_cookie() or Response::setCookie().

Note This vulnerability does not affect session cookies.

The following code does not issue a cookie with the secure flag even if you set $secure = true in Config\Cookie.

helper('cookie');

$cookie = [
    'name'  => $name,
    'value' => $value,
];
set_cookie($cookie);
// or
$this->response->setCookie($cookie);

Patches

Upgrade to v4.2.7 or later.

Workarounds

  1. Specify the options explicitly.
    helper('cookie');
    
    $cookie = [
        'name'     => $name,
        'value'    => $value,
        'secure'   => true,
        'httponly' => true,
    ];
    set_cookie($cookie);
    // or
    $this->response->setCookie($cookie);
    
  2. Use Cookie object.
    use CodeIgniter\Cookie\Cookie;
    
    helper('cookie');
    
    $cookie = new Cookie($name, $value);
    set_cookie($cookie);
    // or
    $this->response->setCookie($cookie);
    

References

For more information

If you have any questions or comments about this advisory:

Record
GHSA-745p-r637-7vvp
CVSS 3.1
2.6 LowCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:N/A:N
Weakness
CWE-665, CWE-732
Updated
2026-11-02
OSVBIT-codeigniter-2022-39284 No score

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 set_cookie() 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.

Record
BIT-codeigniter-2022-39284
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
codeigniter4/framework
Packagist
before 4.2.7
4.2.7
codeigniter
Bitnami
4.0.0 up to 4.2.7
4.2.7
codeigniter4/framework
Packagist
before 4.2.7, plus listed versions
4.0.04.0.0-rc.4v4.0.0-alpha.3v4.0.0-alpha.4v4.0.0-alpha.5
Show 30 moreShow less
v4.0.0-beta.1v4.0.0-beta.2v4.0.0-beta.3v4.0.0-beta.4v4.0.0-rc.1v4.0.0-rc.2v4.0.0-rc.2.1v4.0.0-rc.3v4.0.1v4.0.2v4.0.3v4.0.4v4.0.5v4.1.0v4.1.1v4.1.2v4.1.3v4.1.4v4.1.5v4.1.6v4.1.7v4.1.8v4.1.9v4.2.0v4.2.1v4.2.2v4.2.3v4.2.4v4.2.5v4.2.6
4.2.7

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-39284 is a low vulnerability (CVSS 2.6) in Codeigniter, published October 6, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.12%, the 66th percentile. Fixed in codeigniter4/framework 4.2.7.

References

Show 5 moreShow less
MoveEnter Open