Advisories · PHP & Laravel
CVE-2024-2756
Medium
CVSS 6.5
PHP cookie prefix bypass
Disclosed 2024 · Last reviewed 2 Dec 2026
A cookie whose name looked like a __Host- or __Secure- prefix could be accepted in a case that the browser rules were meant to reject.
What happened
Cookie name checks did not cover every encoding of the reserved prefixes.
Affected and patched versions
- Affected
- PHP 8.1 before 8.1.28, 8.2 before 8.2.18, and 8.3 before 8.3.6.
- Patched
- PHP 8.1.28, 8.2.18, 8.3.6, and later.
How to check your server
Check
php -v
How to fix and harden
- Upgrade PHP to the April 2024 release for your major, or any later release.
- Keep the Secure and Host- prefix checks in the application as well. The PHP bug was in the engine, not a reason to drop those cookie flags.
Fix
php -v
Sources
Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON