Miggo Logo

CVE-2022-31109: Diactoros before 2.11.1 vulnerable to HTTP Host Header Attack

6.1

CVSS Score
3.1

Basic Information

EPSS Score
0.38681%
Published
7/27/2022
Updated
1/30/2023
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
laminas/laminas-diactoroscomposer< 2.11.12.11.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from unvalidated use of X-Forwarded-* headers in URI construction. The ServerRequestFactory::fromGlobals method was the entry point that utilized marshalUriFromSapi() to build URIs from headers without proxy trust validation. The commit introduced filtering (FilterUsingXForwardedHeaders) to address this, indicating these were the vulnerable points. The deprecation of marshalUriFromSapi() and addition of filtering logic in fromGlobals() directly correlate to the patched vulnerability.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t *ppli**tions t**t us* *i**toros, *n* *r* *it**r not ***in* * proxy, or **n ** ****ss** vi* untrust** proxi*s, **n pot*nti*lly **v* t** *ost, proto*ol, *n*/or port o* * `L*min*s\*i**toros\Uri` inst*n** *sso*i*t** wit* t** in*omin* s*rv*r r

Reasoning

T** vuln*r**ility st*ms *rom unv*li**t** us* o* X-*orw*r***-* *****rs in URI *onstru*tion. T** `S*rv*rR*qu*st***tory::*rom*lo**ls` m*t*o* w*s t** *ntry point t**t utiliz** `m*rs**lUri*romS*pi()` to *uil* URIs *rom *****rs wit*out proxy trust v*li**ti