thephpleague / oauth2-client

Easy integration with OAuth 2.0 service providers.
http://oauth2-client.thephpleague.com
MIT License
3.66k stars 752 forks source link

Docs: Fix state check example if session variable is not set #946

Closed Strelox closed 1 year ago

Strelox commented 2 years ago

The state check in the Basic Usage example will only fail if the session variable is set. If an attacker uses a fresh session with the "oauth2state" session variable unset, the check would pass. Even worse if the attacker uses a random state and the check fails, the state variable will be unset in the next line. Then a second request would just pass.

ramsey commented 1 year ago

Thank you for contributing! 🎉