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

- Severity: High 7.2 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.82%, higher than 58% of CVEs (2026-12-01)
- Published: 2022-07-27T22:05:18.000Z
- Modified: 2026-06-17T04:44:49.110Z
- Also known as: GHSA-8274-h5jp-97vr
- Weaknesses: CWE-79, CWE-444
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- laminas laminas-diactoros: < 2.11.1
- laminas/laminas-diactoros (Packagist): before 2.11.1
- getlaminas laminas-diactoros: before 2.11.1

## Every score

- GitHub_M: CVSS:3.1 7.2 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://portswigger.net/web-security/host-header> (third-party-advisory, web)
- <https://github.com/laminas/laminas-diactoros/security/advisories/GHSA-8274-h5jp-97vr> (mitigation, third-party-advisory, web)
- <https://github.com/laminas/laminas-diactoros/commit/25b11d422c2e5dad868f68619888763b30f91e2d> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31109> (advisory)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/laminas/laminas-diactoros/CVE-2022-31109.yaml> (web)
- <https://github.com/advisories/GHSA-8274-h5jp-97vr> (advisory)
- <https://github.com/laminas/laminas-diactoros> (package)
- <https://github.com/laminas/laminas-diactoros/releases/tag/2.11.1> (web)

## Sources

- CVE List: [CVE-2022-31109](https://www.cve.org/CVERecord?id=CVE-2022-31109), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-8274-h5jp-97vr](https://github.com/advisories/GHSA-8274-h5jp-97vr), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-31109](https://nvd.nist.gov/vuln/detail/CVE-2022-31109), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-31109 · Whole record: https://cve.day/CVE-2022-31109.json · Rebuilt by cve.day 2026-11-25T22:58:13.339Z
