HTTP Host Header Attack Vulnerability in laminas-diactoros
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| laminas | laminas-diactoros | before 2.11.1 | 2.11.1 | Patch available | CNA |
| — | laminas/laminas-diactoros (Packagist) | before 2.11.1 | 2.11.1 | Patch available | GHSA-8274-h5jp-97vr |
- laminas-diactoros Vendorlaminas Affected before 2.11.1 Fixed in 2.11.1 Patch available CNA
- laminas/laminas-diactoros (Packagist) Vendor— Affected before 2.11.1 Fixed in 2.11.1 Patch available GHSA-8274-h5jp-97vr
Remediation
- Fix · CNA laminas-diactoros (laminas) Fixed in 2.11.1
- Fix · GHSA-8274-h5jp-97vr laminas/laminas-diactoros (Packagist) Fixed in 2.11.1 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2022-31109
- 2026-10-03 Alias added: GHSA-8274-h5jp-97vr
References
Advisory 4
More Laminas-diactoros vulnerabilities
- TI-2023-13898 Laminas Diactoros vulnerable to HTTP Multiline Header Termination CVSS 3.1HIGH 7.5
Sources
- CVE-2022-31109 · CVE Program
- CVE-2022-31109 · NVD
- FIRST EPSS
- GHSA-8274-h5jp-97vr · GitHub Advisory Database · CC BY 4.0
- CVE-2022-31109 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences