phpCAS is not handling logout requests when behind a load balancer
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 798
- Forks
- 419
- PR merge metrics
- No merged PRs in 30d
Description
- place your app behind a load balancer.
- configure config.php
$cas_real_hosts = array('cas-real-1.example.com', 'cas-real-2.example.com'); - login to your app
- in a separate browser tab visit: https://your.cas-server.com/cas/logout
- go back to your app and refresh the page
- The app is still logged in... should not be
I suspect this is due to Client.php
$client_ip = $_SERVER['REMOTE_ADDR'];
which if your app is behind a load balancer, will return the load balancer's IP instead of the end user's ip. Instead, Client.php should check all the x-forwarded-for, etc. headers and try to find the real IP address. for example: https://stackoverflow.com/questions/44085102/php-most-accurate-safe-way-to-get-real-user-ip-address-in-2017
see also, https://groups.google.com/a/apereo.org/forum/#!topic/cas-user/Wte7lwmYkkc
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Client.php, especially the $_SERVER['REMOTE_ADDR'] handling, and review the config.php setting for $cas_real_hosts. Reproduce the logout flow behind a load balancer, then verify that the app no longer remains logged in while accounting for the security implications of forwarded headers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100