Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐘 Packagist
Not in CISA KEV

GHSA-c8rp-cgf4-937w mezzio/mezzio-swoole

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.

mezzio-swoole Applications Using Diactoros Vulnerable to HTTP Host Header Attack

Published
Jul 29, 2022
Updated
Nov 28, 2024
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-swoole4.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

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-c8rp-cgf4-937w can be triaged on real exposure rather than presence alone.

Tailored to GHSA-c8rp-cgf4-937w. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

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?

O3 Security finds GHSA-c8rp-cgf4-937w across Packagist dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-c8rp-cgf4-937w: mezzio/mezzio XSS | O3 Security