Repository navigation
Conversation
Validate the session ID so we don't send an invalid cookie. This is meant as a hardening measure. In php2shell memory was dumped through the session cookie, making it possible to bypass ASLR. By validating the cookie value we can prevent this. Related to php#24997
Contributor
Author
|
I don't like how it returns SUCCESS even if the cookie is invalid. If it returns FAILURE it causes quite a few tests to fail, because it aborts the session setup process. Details``` GH-23043 (broken session id code can cause zend_mm_heap corrupted) [ext/session/tests/user_session_module/gh23043.phpt] Test session_set_save_handler() function: class with create_sid [ext/session/tests/user_session_module/session_set_save_handler_class_017.phpt] Test session_set_save_handler() function: class with validate_sid [ext/session/tests/user_session_module/session_set_save_handler_class_018.phpt] session_set_save_handler(): optional closures not set again in second call [ext/session/tests/user_session_module/session_set_save_handler_multiple.phpt] Test session_set_save_handler() function: id interface [ext/session/tests/user_session_module/session_set_save_handler_iface_003.phpt] Test session_set_save_handler() function: create_sid [ext/session/tests/user_session_module/session_set_save_handler_sid_001.phpt] ```Ping @arnaud-lb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Validate the session ID so we don't send an invalid cookie. This is meant as a hardening measure. In php2shell memory was dumped through the session cookie, making it possible to bypass ASLR. By validating the cookie value we can prevent this.
Related to #24997