Summary
mezzio-swoole Applications Using Diactoros Vulnerable to HTTP Host Header Attack
Workarounds
Infrastructure or DevOps can place a trusted reverse proxy in front of the mezzio-swoole server.
References
For more information
If you have any questions or comments about this advisory:
- Open an issue in mezzio/mezzio-swoole
- Email us
Impact
mezzio-swoole applications using Diactoros for their PSR-7 implementation, and which are either not behind a proxy, or can be accessed via untrusted proxies, can potentially have the host, protocol, and/or port of a Laminas\Diactoros\Uri instance associated with the incoming server request modified to reflect values from X-Forwarded-* headers. Such changes can potentially lead to XSS attacks (if a fully-qualified URL is used in links) and/or URL poisoning.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
3.7.0, and 4.3.0 and later.
The patches present in these versions update the SwooleServerRequestFactory to filter out X-Forwarded-* headers when creating the initial request. They then by default pass that instance through a Laminas\Diactoros\ServerRequestFilter\FilterUsingXForwardedHeaders instance created from the trustReservedSubnet() constructor, ensuring that the request only honors the X-Forwarded-* headers for private reserved subnets.
Users can define the Laminas\Diactoros\ServerRequestFilter\FilterServerRequestInterface service if they wish to provide a different implementation, or configure the FilterUsingXForwardedHeaders instance differently. When defined, that instance will be used to filter the generated request instance.
Frequently Asked Questions
- What is GHSA-C8RP-CGF4-937W? GHSA-C8RP-CGF4-937W is a high-severity security vulnerability in mezzio/mezzio-swoole (composer), affecting versions < 3.7.0. It is fixed in 3.7.0, 4.3.0.
- Which versions of mezzio/mezzio-swoole are affected by GHSA-C8RP-CGF4-937W? mezzio/mezzio-swoole (composer) versions < 3.7.0 is affected.
- Is there a fix for GHSA-C8RP-CGF4-937W? Yes. GHSA-C8RP-CGF4-937W is fixed in 3.7.0, 4.3.0. Upgrade to this version or later.
- Is GHSA-C8RP-CGF4-937W exploitable, and should I be worried? Whether GHSA-C8RP-CGF4-937W is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-C8RP-CGF4-937W is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-C8RP-CGF4-937W?
- Upgrade
mezzio/mezzio-swooleto 3.7.0 or later - Upgrade
mezzio/mezzio-swooleto 4.3.0 or later
- Upgrade