NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
🐘 Packagist
Not in CISA KEV

mezzio-swoole Applications Using Diactoros Vulnerable to HTTP Host Header AttackGHSA-c8rp-cgf4-937w

GHSA-c8rp-cgf4-937w is a security vulnerability in mezzio/mezzio-swoole. A fix is available for mezzio/mezzio-swoole — see the affected versions and patch details below.

Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Nov 28, 2024 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

2 pkgs affected
🐘mezzio/mezzio-swoole🐘mezzio/mezzio-swoole

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.

Description

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.

Patches

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.

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:

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
🐘Packagistmezzio/mezzio-swooleall versions3.7.0composer require mezzio/mezzio-swoole:^3.7.0
🐘Packagistmezzio/mezzio-swoole≥ 4.0.0&&< 4.3.04.3.0composer require mezzio/mezzio-swoole:^4.3.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mezzio/mezzio-swoole, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update mezzio/mezzio-swoole to 3.7.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-c8rp-cgf4-937w is resolved across your whole dependency graph.

  3. Workarounds

    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.

Frequently Asked Questions

### 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. ### Patches 3.7.0, and 4.3.0 and later. The patches present in these versions update the `SwooleServerRequestFactory` to
O3 Security · Impact-Aware SCA

Is GHSA-c8rp-cgf4-937w in your dependencies?

Find it across Packagist, including transitive dependencies.

mezzio-swoole Applications Using Diactoros Vulnerable…