CVE-2022-31629: $_COOKIE names string replacement (. -> _): cookie integrity vulnerabilities

Published Sep 28, 2022
·
Updated

$COOKIE names string replacement (. -> ): cookie integrity vulnerabilities

Other sources

Fixed bug GHSA-wpj3-hf5j-x4v4 (Host-/Secure- cookie bypass due to partial CVE-2022-31629 fix). (CVE-2024-2756)

— PHP

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.

— Launchpad

Affected Software

25 affected componentsFixes available
PHP PHP<8.1.28
8.1.28
PHP PHP<7.4.31
PHP PHP>=8.0.0<8.0.24
PHP PHP>=8.1.0<8.1.11
Fedoraproject Fedora=35
Fedoraproject Fedora=36
Fedoraproject Fedora=37
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Microsoft cbl2 php
redhat/php<7.4.31
7.4.31
redhat/php<8.0.25
8.0.25
alpine/php7<7.4.32-r0
7.4.32-r0
alpine/php7<7.4.32-r0
7.4.32-r0
alpine/php8<8.0.24-r0
8.0.24-r0
alpine/php8<8.0.25-r0
8.0.25-r0
alpine/php8<8.0.24-r0
8.0.24-r0
alpine/php81<8.1.11-r0
8.1.11-r0
alpine/php81<8.1.11-r0
8.1.11-r0
alpine/php81<8.1.11-r0
8.1.11-r0
alpine/php81<8.1.11-r0
8.1.11-r0
debian/php7.3
7.3.31-1~deb10u2
debian/php7.4
7.4.33-1+deb11u1
debian/php8.1
8.1.12-1
debian/php7.4<7.4.33-1+deb11u1
7.4.33-1+deb11u1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.1.28
  2. Upgrade

    Upgrade redhat/php to a version that resolves this vulnerability.

    Fixed in 7.4.31
  3. Upgrade

    Upgrade redhat/php to a version that resolves this vulnerability.

    Fixed in 8.0.25
  4. Upgrade

    Upgrade alpine/php7 to a version that resolves this vulnerability.

    Fixed in 7.4.32-r0
  5. Upgrade

    Upgrade alpine/php8 to a version that resolves this vulnerability.

    Fixed in 8.0.24-r0
  6. Upgrade

    Upgrade alpine/php8 to a version that resolves this vulnerability.

    Fixed in 8.0.25-r0
  7. Upgrade

    Upgrade alpine/php81 to a version that resolves this vulnerability.

    Fixed in 8.1.11-r0
  8. Upgrade

    Upgrade debian/php7.3 to a version that resolves this vulnerability.

    Fixed in 7.3.31-1~deb10u2
  9. Upgrade

    Upgrade debian/php7.4 to a version that resolves this vulnerability.

    Fixed in 7.4.33-1+deb11u1
  10. Upgrade

    Upgrade debian/php8.1 to a version that resolves this vulnerability.

    Fixed in 8.1.12-1
  11. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 7.4.31
  12. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.0.24
  13. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.1.11

Event History

Sep 28, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via MITRE·12:00 AM
RemedyDescriptionWeakness
Updated
via Ubuntu·12:00 AM
DescriptionAffected Software
CVE Published
via MITRE·10:25 PM
Data Sourced
via OSV·11:15 PM
DescriptionSeverityAffected Software
Sep 29, 2022
Data Sourced
via PHP·12:00 AM
DescriptionAffected Software
Updated
12:00 AM
Affected Software
Oct 7, 2022
Exploit Published
via GitHub·08:15 AM
Oct 11, 2022
Data Sourced
via Red Hat·07:52 AM
DescriptionSeverityAffected Software
Jan 20, 2023
Data Sourced
01:12 PM
Weakness
Nov 7, 2023
Data Sourced
via NVD·03:47 AM
DescriptionSeverityWeaknessAffected Software
Updated
via NVD·03:47 AM
Affected Software
Apr 11, 2024
Updated
via PHP·12:00 AM
DescriptionAffected Software
Updated
via PHP·12:00 AM
Affected Software
Apr 19, 2024
Updated
via NVD·04:15 AM
Affected Software
Updated
via NVD·11:15 PM
Affected Software
May 1, 2024
Updated
via NVD·05:15 PM
Affected Software
Oct 29, 2024
Updated
via NVD·03:35 PM
SeverityWeaknessAffected Software
Nov 21, 2024
Updated
via NVD·07:04 AM
Affected Software
Oct 1, 2025
Data Sourced
via Microsoft·11:11 PM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·11:11 PM
Affected Software
Nov 4, 2025
Updated
via NVD·06:15 PM
Affected Software
Jun 17, 2026
Updated
via NVD·04:45 AM
Affected Software
Nov 24, 2026
Withdrawn
via OSV·04:29 AM

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is CVE-2022-31629?

CVE-2022-31629 is a vulnerability in PHP versions before 7.4.31, 8.0.24, and 8.1.11 that enables network and same-site attackers to set an insecure cookie in the victim's browser.

2

How does CVE-2022-31629 affect PHP?

CVE-2022-31629 affects PHP versions before 7.4.31, 8.0.24, and 8.1.11 by allowing attackers to set a standard insecure cookie in the victim's browser.

3

How can I fix CVE-2022-31629 in PHP?

To fix CVE-2022-31629 in PHP, update to version 7.4.32, 7.3.31-1~deb10u4, or 7.4.33-1+deb11u3 (or later versions).

4

What are the details of CVE-2022-31629?

CVE-2022-31629 allows 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.

5

Where can I find more information about CVE-2022-31629?

You can find more information about CVE-2022-31629 at the following references: [Link 1](https://www.php.net/ChangeLog-7.php#7.4.32), [Link 2](https://bugs.php.net/bug.php?id=81727), [Link 3](https://github.com/php/php-src/commit/0611be4e82887cee0de6c4cbae320d34eec946ca)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203