CVE-2022-39369
Service Hostname Discovery Exploitation in phpCAS
Check your servers for CVE-2022-39369
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-39369 affects phpcas, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
phpCAS is an authentication library that allows PHP applications to easily authenticate users via a Central Authentication Service (CAS) server. The phpCAS library uses HTTP headers to determine the service URL used to validate tickets. This allows an attacker to control the host header and use a valid ticket granted for any authorized service in the same SSO realm (CAS server) to authenticate to the service protected by phpCAS. Depending on the settings of the CAS server service registry in worst case this may be any other service URL (if the allowed URLs are configured to "^(https)://.*") or may be strictly limited to known and authorized services in the same SSO federation if proper URL service validation is applied. This vulnerability may allow an attacker to gain access to a victim's account on a vulnerable CASified service without victim's knowledge, when the victim visits attacker's website while being logged in to the same CAS server. phpCAS 1.6.0 is a major version upgrade that starts enforcing service URL discovery validation, because there is unfortunately no 100% safe default config to use in PHP. Starting this version, it is required to pass in an additional service base URL argument when constructing the client class. For more information, please refer to the upgrading doc. This vulnerability only impacts the CAS client that the phpCAS library protects against. The problematic service URL discovery behavior in phpCAS < 1.6.0 will only be disabled, and thus you are not impacted from it, if the phpCAS configuration has the following setup: 1. `phpCAS::setUrl()` is called (a reminder that you have to pass in the full URL of the current page, rather than your service base URL), and 2. `phpCAS::setCallbackURL()` is called, only when the proxy mode is enabled. 3. If your PHP's HTTP header input `X-Forwarded-Host`, `X-Forwarded-Server`, `Host`, `X-Forwarded-Proto`, `X-Forwarded-Protocol` is sanitized before reaching PHP (by a reverse proxy, for example), you will not be impacted by this vulnerability either. If your CAS server service registry is configured to only allow known and trusted service URLs the severity of the vulnerability is reduced substantially in its severity since an attacker must be in control of another authorized service. Otherwise, you should upgrade the library to get the safe service discovery behavior.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- required: a user has to do something, such as open a link or a file
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 2.45%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 84.8% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 23 Apr 2025):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Weakness
- CWE-99 Improper Control of Resource Identifiers
- CWE-1287 Improper Validation of Specified Type of Input
Affected products
As the CNA lists them.
Is my server affected?
Find the installed version of phpcas and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i phpcas
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2022-39369 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2022-39369RHEL, Rocky, Alma, Fedora
rpm -q phpcas
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2022-39369Alpine
apk list --installed | grep -i phpcasWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2022-39369
trivy image --scanners vuln IMAGE | grep CVE-2022-39369
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- FEDORA-2022-37c2d26f59 lists.fedoraproject.org · vendor advisory
- FEDORA-2022-d6c6782130 lists.fedoraproject.org · vendor advisory
- FEDORA-2022-76b3530ac2 lists.fedoraproject.org · vendor advisory
Other references
- https://github.com/apereo/phpCAS/security/advisories/GHSA-8q72-6qq8-xv64 github.com
- [debian-lts-announce] 20230708 [SECURITY] [DLA 3485-1] php-cas security update lists.debian.org · mailing list
Source: the record CVE-2022-39369 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse