Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-745p-r637-7vvp

Опубликовано: 06 окт. 2022
Источник: github
Github: Прошло ревью
CVSS3: 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:

Пакеты

Наименование

codeigniter4/framework

composer
Затронутые версииВерсия исправления

< 4.2.7

4.2.7

EPSS

Процентиль: 64%
0.00467
Низкий

2.6 Low

CVSS3

Дефекты

CWE-665
CWE-732

Связанные уязвимости

CVSS3: 2.6
nvd
больше 3 лет назад

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.

CVSS3: 2.6
debian
больше 3 лет назад

CodeIgniter is a PHP full-stack web framework. In versions prior to 4. ...

EPSS

Процентиль: 64%
0.00467
Низкий

2.6 Low

CVSS3

Дефекты

CWE-665
CWE-732