Improper Initialization Affecting codeigniter4/framework package, versions <4.2.7


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.16% (53rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-CODEIGNITER4FRAMEWORK-3040877
  • published7 Oct 2022
  • disclosed6 Oct 2022
  • creditUnknown

Introduced: 6 Oct 2022

CVE-2022-39284  (opens in a new tab)
CWE-665  (opens in a new tab)

How to fix?

Upgrade codeigniter4/framework to version 4.2.7 or higher.

Overview

codeigniter4/framework is a PHP full-stack web framework that is light, fast, flexible, and secure.

Affected versions of this package are vulnerable to Improper Initialization due to not issuing a cookie with the secure flag even $secure = true in Config\Cookie is set.

Workaround

Users who are unable to upgrade to the fixed version, should:

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);

CVSS Scores

version 3.1