Improper Input ValidationWeakness · CWE-20

CVE-2024-2756

MEDIUM · 6.5 CVSS v3.1 Published 2024-04-29
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
72/100
Remediation priority · Elevated
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Due to an incomplete fix to CVE-2022-31629 https://github.com/advisories/GHSA-c43m-486j-j32p , 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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

An incomplete fix to CVE-2022-31629 allows network and same-site attackers to set standard insecure cookies that PHP applications mistakenly treat as secure prefix cookies (__Host- or __Secure-). This bypasses the intended security protections of these prefixes, potentially enabling session fixation or authentication bypass attacks.

MitigationUpdate to patched PHP versions when available, or implement application-level validation to verify cookie origins and enforce that __Host-/__Secure- prefix cookies were actually set over secure connections.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify PHP version
    Run `php --version` or `phpinfo()` to obtain the exact PHP version installed
    Affected if The version is within a range that received an incomplete fix for CVE-2022-31629 (e.g., versions after the initial fix but before the complete fix for CVE-2024-2756) - compare against vendor advisory version tables
  2. Verify HTTPS is enforced
    Check the server configuration (httpd.conf, nginx.conf, or PHP settings) for strict HTTPS enforcement - look for `force_ssl` or similar directives, and verify the site is only accessible via HTTPS
    Affected if HTTP connections are permitted or the site responds over HTTP, allowing attackers to set cookies over insecure connections that PHP may then incorrectly treat as secure prefix cookies
  3. Identify __Host- and __Secure- cookie usage
    Search application source code for `setcookie()`, `setrawcookie()`, or `session_set_cookie_params()` calls using `__Host-` or `__Secure-` prefixes in cookie names
    Affected if The application relies on __Host- or __Secure- prefixed cookies for security-critical functions such as session management or authentication, and these cookies can be set by external sources
  4. Inspect incoming cookie headers
    Examine HTTP request headers (via `$_COOKIE` or server logs) to see if cookies are being received from untrusted origins or if unexpected cookies with secure prefixes are present
    Affected if Cookies with __Host- or __Secure- prefixes are arriving from non-HTTPS connections or from cross-site origins, indicating potential prefix bypass
  5. Review cookie origin validation
    Check application code for explicit validation that cookies were received over secure channels before accepting __Host-/__Secure- prefixed cookies (e.g., checking `$_SERVER['HTTPS']` or `$_SERVER['REQUEST_SCHEME']`)
    Affected if The application does not validate that cookies with secure prefixes were actually set over HTTPS before trusting them for security decisions

A user is affected if their PHP version has an incomplete fix for the secure cookie prefix bypass AND their application accepts cookies with __Host- or __Secure- prefixes over non-HTTPS connections or from untrusted origins.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

From vendor data
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Update to patched PHP versions when available, or implement application-level validation to verify cookie origins and enforce that __Host-/__Secure- prefix cookies were actually set over secure connections.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
16.0 hours of engineering $2,800
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,480.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-2756 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-2756 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data