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
Real-World Exposure
mezzio/mezzio-swoole🐘mezzio/mezzio-swooleReal-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:
- Open an issue in mezzio/mezzio-swoole
- Email us
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | mezzio/mezzio-swoole | all versions | 3.7.0composer require mezzio/mezzio-swoole:^3.7.0 |
| 🐘Packagist | mezzio/mezzio-swoole | ≥ 4.0.0&&< 4.3.0 | 4.3.0composer require mezzio/mezzio-swoole:^4.3.0 |
Detection & mitigation playbook
Open-source dependencyDetect
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.
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.
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.
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
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.