CVE-2022-39284
published 2022-10-06CVE-2022-39284: 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…
PriorityP421medium4.3CVSS 3.1
AVNACLPRLUINSUCLINAN
EPSS
0.83%
52.8th percentile
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.
Affected
3 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| codeigniter | codeigniter | >= 4.0.0 < 4.2.7 | 4.2.7 |
| codeigniter4 | codeigniter4 | < 4.2.7 | 4.2.7 |
| codeigniter4 | framework | >= 0 < 4.2.7 | 4.2.7 |
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
Codeigniter4's Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued
osv·2022-10-06
CVE-2022-39284 [LOW] Codeigniter4's Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued
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`.
```php
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.
```php
helper('cookie');
$cookie = [
'name' => $name,
'value' => $value,
'secure' => true,
'httponly' => true,
];
set_cookie($cookie);
//
GHSA
Codeigniter4's Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued
ghsa·2022-10-06
CVE-2022-39284 [LOW] CWE-665 Codeigniter4's Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued
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`.
```php
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.
```php
helper('cookie');
$cookie = [
'name' => $name,
'value' => $value,
'secure' => true,
'httponly' => true,
];
set_cookie($cookie);
//
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://codeigniter4.github.io/userguide/helpers/cookie_helper.html#set_cookiehttps://codeigniter4.github.io/userguide/outgoing/response.html#CodeIgniter%5CHTTP%5CResponse::setCookiehttps://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookieshttps://github.com/codeigniter4/CodeIgniter4/issues/6540https://github.com/codeigniter4/CodeIgniter4/pull/6544https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-745p-r637-7vvphttps://codeigniter4.github.io/userguide/helpers/cookie_helper.html#set_cookiehttps://codeigniter4.github.io/userguide/outgoing/response.html#CodeIgniter%5CHTTP%5CResponse::setCookiehttps://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#restrict_access_to_cookieshttps://github.com/codeigniter4/CodeIgniter4/issues/6540https://github.com/codeigniter4/CodeIgniter4/pull/6544https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-745p-r637-7vvp
2022-10-06
Published