VulnWatch by ve1ve2
medium 6.5 EPSS 49.6%

GHSA-wpj3-hf5j-x4v4 / CVE-2024-2756: __Host-/__Secure- cookie bypass due to partial CVE-2022-31629 fix

Source:
PHP releases (GitHub php/php-src tags)
Published:
Fetched:
Updated:
Affects:
php php-src

https://github.com/php/php-src/security/advisories/GHSA-wpj3-hf5j-x4v4 ↗

repo-advisoryCWE-20securityrepo:php/php-srcstack

__Host-/__Secure- cookie bypass due to partial CVE-2022-31629 fix ### Summary Due to an incomplete fix to CVE-2022-31629, network and same-site attackers can set a standard insecure cookie in the victim's browser which is treated as a `__Host-` or `__Secure-` cookie by PHP applications. ### Details The vulnerability is identical to one previously described in https://bugs.php.net/bug.php?id=81727. Unfortunatly, since CVE-2022-31629 got only partially fixed in PHP >8.1.11, cookies starting with `_[Host-` are parsed by PHP applications as `__Host-`. Notice that I reported this vulnerability multiple times via email after the fix for CVE-2022-31629 landed (I am the original reporter of that CVE), but I guess that the message got lost. ### PoC ```sh $ echo '' > x $ docker run -p 8080:8080 --rm -v $(pwd):$(pwd) php:latest php -S 0.0.0.0:8080 $(pwd)/x $ curl -b '_[Host-x=y' localhost:8080/x {"__Host-x":"y"} ``` Patched: 8.1.28, 8.2.18, 8.3.6

Linked vulnerabilities (3)

CVE-2024-2756 medium 6.5 EPSS 38.1% (p99) NVDCVE.orgGHSAGHSA
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

php8.2 - security update

CWE: CWE-20Aliases: CVE-2023-3823, CVE-2023-3824, CVE-2024-3096, CVE-2022-31629, GHSA-c43m-486j-j32p, GHSA-wpj3-hf5j-x4v4
CVE-2022-31629 medium 6.5 EPSS 49.6% (p99) NVDCVE.org
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

In PHP versions before 7.4.31, 8.0.24 and 8.1.11, the vulnerability enables network and same-site attackers to set a standard insecure cookie in the victim's browser which is treated as a `__Host-` or `__Secure-` cookie by PHP applications.

CWE: CWE-20, CWE-1284NVD: Modified

__Host-/__Secure- cookie bypass due to partial CVE-2022-31629 fix

CWE: CWE-20Aliases: CVE-2024-2756, CVE-2022-31629