p PatchFirst

CVE-2022-31109

CVE-2022-31109 · HTTP Host Header Attack Vulnerability in laminas-diactoros

This page contains facts from public vulnerability sources. Check the original advisory before updating.

laminas-diactoros is a PHP package containing implementations of the PSR-7 HTTP message interfaces and PSR-17 HTTP message factory interfaces. Applications that use Diactoros, and 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. Since the `X-Forwarded-*` headers do have valid use cases, particularly in clustered environments using a load balancer, the library offers mitigation measures only in the v2 releases, as doing otherwise would break these use cases immediately. Users of v2 releases from 2.11.1 can provide an additional argument to `Laminas\Diactoros\ServerRequestFactory::fromGlobals()` in the form of a `Laminas\Diactoros\RequestFilter\RequestFilterInterface` instance, including the shipped `Laminas\Diactoros\RequestFilter\NoOpRequestFilter` implementation which ignores the `X-Forwarded-*` headers. Starting in version 3.0, the library will reverse behavior to use the `NoOpRequestFilter` by default, and require users to opt-in to `X-Forwarded-*` header usage via a configured `Laminas\Diactoros\RequestFilter\LegacyXForwardedHeaderFilter` instance. Users are advised to upgrade to version 2.11.1 or later to resolve this issue. Users unable to upgrade may configure web servers to reject `X-Forwarded-*` headers at the web server level.

CVSS 7.2 · High · EPSS 0.8% · Fix available

Published
Updated

Stack: php

Affected products and versions

  • laminas-diactoros

    Versions
    • < 2.11.1: Affected

    No fix published

  • laminas/laminas-diactoros Packagist

    Versions
    • 1.0.0
    • 1.0.1
    • 1.0.2
    • 1.0.3
    • 1.0.4
    • 1.0.5
    • 1.1.0
    • 1.1.1
    • 1.1.2
    • 1.1.3
    • 1.1.4
    • 1.2.0
    • 1.2.1
    • 1.3.0
    • 1.3.1
    • 1.3.10
    • 1.3.11
    • 1.3.2
    • 1.3.3
    • 1.3.4
    • 1.3.5
    • 1.3.6
    • 1.3.7
    • 1.3.8
    • 1.3.9
    • 1.4.0
    • 1.4.1
    • 1.5.0
    • 1.6.0
    • 1.6.1
    • 1.7.0
    • 1.7.1
    • 1.7.2
    • 1.8.0
    • 1.8.0p1
    • 1.8.0p2
    • 1.8.1
    • 1.8.1p1
    • 1.8.1p2
    • 1.8.2
    • 1.8.2p1
    • 1.8.2p2
    • 1.8.3
    • 1.8.3p1
    • 1.8.3p2
    • 1.8.4
    • 1.8.4p1
    • 1.8.4p2
    • 1.8.5
    • 1.8.5p1
    • 1.8.5p2
    • 1.8.6
    • 1.8.6p1
    • 1.8.6p2
    • 1.8.7
    • 1.8.7p1
    • 1.8.7p2
    • 2.0.0
    • 2.0.0p1
    • 2.0.0p2
    • 2.0.1
    • 2.0.1p1
    • 2.0.1p2
    • 2.0.2
    • 2.0.2p1
    • 2.0.2p2
    • 2.0.3
    • 2.0.3p1
    • 2.0.3p2
    • 2.1.0
    • 2.1.0p1
    • 2.1.0p2
    • 2.1.1
    • 2.1.1p1
    • 2.1.1p2
    • 2.1.2
    • 2.1.2p1
    • 2.1.2p2
    • 2.1.3
    • 2.1.3p1
    • 2.1.3p2
    • 2.1.4
    • 2.1.4p1
    • 2.1.4p2
    • 2.1.5
    • 2.1.5p1
    • 2.1.5p2
    • 2.10.0
    • 2.11.0
    • 2.2.0
    • 2.2.0p1
    • 2.2.0p2
    • 2.2.1
    • 2.2.1p1
    • 2.2.1p2
    • 2.2.2
    • 2.2.3
    • 2.3.0
    • 2.3.1
    • 2.3.2
    • 2.4.0
    • 2.4.1
    • 2.5.0
    • 2.5.1
    • 2.6.0
    • 2.7.0
    • 2.8.0
    • 2.9.0
    • 2.9.1
    • 2.9.2
    Affected ranges
    • ECOSYSTEM: < 2.11.1

    Update to 2.11.1

Original sources

Check your server →