Access Restriction Bypass Affecting apereo/phpcas package, versions <1.6.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.22% (60th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-APEREOPHPCAS-3097827
  • published2 Nov 2022
  • disclosed2 Nov 2022
  • creditFilip Hejsek

Introduced: 2 Nov 2022

CVE-2022-39369  (opens in a new tab)
CWE-99  (opens in a new tab)

How to fix?

Upgrade apereo/phpcas to version 1.6.0 or higher.

Overview

apereo/phpcas is a simple API for authenticating users against a CAS server

Affected versions of this package are vulnerable to Access Restriction Bypass in HTTP hostname discovery validation. An attacker can control the host header and use a valid ticket granted for any authorized service in the same SSO realm (CAS server) to authenticate. This could allow the attacker to access a user's account on a vulnerable CASified service without the user's knowledge, when the user visits the attacker's website while being logged in to the same CAS server.

Workaround

This vulnerability can be avoided by ensuring the following setup:

  • phpCAS::setUrl() is called and phpCAS::setCallbackURL() is called, only when the proxy mode is enabled.

OR

  • Header input for X-Forwarded-Host, X-Forwarded-Server, Host, X-Forwarded-Proto, and X-Forwarded-Protocol is sanitized before reaching PHP

Additionally, if your CAS server service registry is configured to only allow known and trusted service URLs the severity of the vulnerability is reduced substantially since an attacker must be in control of another authorized service.

References

CVSS Scores

version 3.1