CVE-2022-36032: React/http ReactPHP's HTTP Server Parses Encoded Vulnerability

MODERATE
Advisory Identifier: GHSA-w3w9-vrf5-8mx8
CVSS 5.3
CWE-20 CWE-565
Published
Advisory Summary

CVE-2022-36032 is a MODERATE (CVSS 5.3) reactphp's http server parses encoded vulnerability (CWE-20: Improper Input Validation) affecting React/http libraries in the Packagist ecosystem. The issue involves reactphp's http server parses encoded cookie names so malicious `__host-` and `__secure-` cookies can be sent. Remediation is available by upgrading affected packages to version 1.7.0.

CVE-2022-36032 at a Glance

CVE Identifier CVE-2022-36032
GHSA Identifier GHSA-w3w9-vrf5-8mx8
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-20: Improper Input Validation
Affected Product React/http
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2022-36032

To remediate this vulnerability, upgrade all affected React/http dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

react/http fixed: 1.7.0
Upgrade react/http to 1.7.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for react/http

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-36032, inspect your project dependencies for React/http:

inspect dependencies for react/http

Analyze the terminal output to locate any version of React/http in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In React/http, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact In ReactPHP's HTTP server component versions below v1.7.0, when ReactPHP is processing incoming HTTP cookie values, the cookie names are url-decoded. This may lead to cookies with prefixes like `__Host-` and `__Secure-` confused with cookies that decode to such prefix, thus leading to an attacker being able to forge cookie which is supposed to be secure. See also CVE-2020-7070 and CVE-2020-8184 for more information. ### Patches * https://github.com/reactphp/http/commit/663c9a3b77b71463fa7fcb76a6676ffd16979dd6 - Fixed in [reactphp/http `v1.7.0`](https://github.com/reactphp/http/releases/tag/v1.7.0) ### Workarounds Infrastructure or DevOps can place a reverse proxy in front of the ReactPHP HTTP server to filter out any unexpected `Cookie` request headers. ### References * CVE-2020-7070, https://bugs.php.net/bug.php?id=79699 and https://github.com/php/php-src/commit/6559fe912661ca5ce5f0eeeb591d928451428ed0 * CVE-2020-8184, https://hackerone.com/reports/895727 and https://github.com/rack/rack/commit/1f5763de6a9fe515ff84992b343d63c88104654c * Originally introduced via https://github.com/reactphp/http/pull/175 ### Credits * Thanks to Marco Squarcina (TU Wien) for reporting this and working with us to coordinate this security advisory ### For more information If you have any questions or comments about this advisory: * [Join the discussion](https://github.com/orgs/reactphp/discussions/465) * Email us at support@reactphp.org

CVE-2022-36032 Affected React/http Versions

1 component(s)
Fixed Versions:
1.7.0
Product / Package Ecosystem Affected Versions Fixed Version
react/http
Packagist
≥ 0.7.0
< 1.7.0
1.7.0

References

Frequently Asked Questions

What is CVE-2022-36032?
CVE-2022-36032 is a security vulnerability in React/http involving ReactPHP's HTTP server parses encoded cookie names so malicious `__Host-` and `__Secure-` cookies can be sent under CWE-20: Improper Input Validation.
Which React/http versions are affected?
Affected versions include releases prior to 1.7.0 across affected packages: react/http.
What version fixes CVE-2022-36032?
Upgrading to 1.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is react/http affected?
Yes, react/http is affected in releases prior to 1.7.0. Upgrade your dependency to 1.7.0 or later.
What is the CVSS score of CVE-2022-36032?
CVE-2022-36032 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2022-36032?
CVE-2022-36032 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Packagist dependencies for CVE-2022-36032?
Run the dependency tree command: 'inspect dependencies for react/http'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w3w9-vrf5-8mx8",
  "modified" : "2022-09-16T18:48:53Z",
  "published" : "2022-09-16T18:48:53Z",
  "aliases" : [ "CVE-2022-36032" ],
  "summary" : "ReactPHP's HTTP server parses encoded cookie names so malicious `__Host-` and `__Secure-` cookies can be sent",
  "details" : "### Impact\n\nIn ReactPHP's HTTP server component versions below v1.7.0, when ReactPHP is processing incoming HTTP cookie values, the cookie names are url-decoded. This may lead to cookies with prefixes like `__Host-` and `__Secure-` confused with cookies that decode to such prefix, thus leading to an attacker being able to forge cookie which is supposed to be secure. See also CVE-2020-7070 and CVE-2020-8184 for more information. \n\n### Patches\n\n* https://github.com/reactphp/http/commit/663c9a3b77b71463fa7fcb76a6676ffd16979dd6 - Fixed in [reactphp/http `v1.7.0`](https://github.com/reactphp/http/releases/tag/v1.7.0)\n\n### Workarounds\n\nInfrastructure or DevOps can place a reverse proxy in front of the ReactPHP HTTP server to filter out any unexpected `Cookie` request headers.\n\n### References\n\n* CVE-2020-7070, https://bugs.php.net/bug.php?id=79699 and https://github.com/php/php-src/commit/6559fe912661ca5ce5f0eeeb591d928451428ed0\n* CVE-2020-8184, https://hackerone.com/reports/895727 and https://github.com/rack/rack/commit/1f5763de6a9fe515ff84992b343d63c88104654c\n* Originally introduced via https://github.com/reactphp/http/pull/175\n\n### Credits\n\n* Thanks to Marco Squarcina (TU Wien) for reporting this and working with us to coordinate this security advisory\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* [Join the discussion](https://github.com/orgs/reactphp/discussions/465)\n* Email us at support@reactphp.org\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "react/http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.7.0"
      }, {
        "fixed" : "1.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/reactphp/http/security/advisories/GHSA-w3w9-vrf5-8mx8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36032"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/reactphp/http/pull/175"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/reactphp/http/commit/663c9a3b77b71463fa7fcb76a6676ffd16979dd6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/react/http/CVE-2022-36032.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/reactphp/http"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/reactphp/http/releases/tag/v1.7.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-565" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-16T18:48:53Z",
    "nvd_published_at" : "2022-09-06T19:15:00Z"
  }
}