Miggo Logo

CVE-2022-39369: phpCAS vulnerable to Service Hostname Discovery Exploitation

8

CVSS Score
3.1

Basic Information

EPSS Score
0.70204%
Published
11/1/2022
Updated
7/10/2023
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
apereo/phpcascomposer< 1.6.01.6.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from phpCAS deriving the service URL from untrusted HTTP headers without proper validation. The _getClientUrl() method directly used headers like X-Forwarded-Host to build the URL, while _isHttps() used headers to determine the protocol. Both functions lacked allowlist validation, enabling host header injection. The patch (b759361) refactored these into ServiceBaseUrl classes with allowlist checks, confirming these were the vulnerable components.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t T** p*p**S li*r*ry us*s *TTP *****rs to **t*rmin* t** s*rvi** URL us** to v*li**t* ti*k*ts. T*is *llows *n *tt**k*r to *ontrol t** *ost *****r *n* us* * v*li* ti*k*t *r*nt** *or *ny *ut*oriz** s*rvi** in t** s*m* SSO r**lm (**S s*rv*r) to

Reasoning

T** vuln*r**ility st*mm** *rom p*p**S **rivin* t** s*rvi** URL *rom untrust** *TTP *****rs wit*out prop*r v*li**tion. T** _**t*li*ntUrl() m*t*o* *ir**tly us** *****rs lik* X-*orw*r***-*ost to *uil* t** URL, w*il* _is*ttps() us** *****rs to **t*rmin*