Advisory

GHSA-c8rp-cgf4-937w

Also known as: None

Summary

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

Details

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:

Severity

High Basis: The source's own band: HIGH

Dates

Published
2022-07-29 22:26 UTC
Modified
2024-11-28 05:41 UTC

Affected packages and fixes

mezzio/mezzio-swoole

Packagist · All systems

Affected

  • introduced 0, fixed 3.7.0 (ecosystem)

Fixed versions

3.7.0

Fix

The export has no generic command for this ecosystem.

mezzio/mezzio-swoole

Packagist · All systems

Affected

  • introduced 4.0.0, fixed 4.3.0 (ecosystem)

Fixed versions

4.3.0

Fix

The export has no generic command for this ecosystem.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences