You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Require sesskey to switch the ad hoc debug mode - #25
This issue was identified during a penetration test. Neither adhocdebug.php nor the userdebug=1 URL parameter validated the sesskey, so the ad hoc debug mode of a user holding tool/userdebug:adhocdebug could be switched by a cross-site request (CSRF); this change requires a valid sesskey on both paths and adds it to the generated toggle link.
Compatibility note: the userdebug=1 shortcut mentioned in CHANGES.md now only takes effect together with &sesskey=<current sesskey>; without it the parameter is silently ignored (no error page). Covered by tests/hook_test.php (test_setdebug_without_sesskey, test_setdebug_with_sesskey); tests/behat/enable_adhoc_debug.feature uses the toggle link, which now carries the sesskey.
Hi, thank you for providing this fix.
I wonder if someone is using the "userdebug" parameter at all. So I would suggest to remove this part completely.
What do you think?
Thanks for looking into this! We actually use the userdebug parameter a lot. On our large instance (more than 650,000 active users), switching on debugging site-wide immediately causes error messages that end up as support requests, so being able to enable it ad hoc for a single session is really helpful for us. We would therefore prefer to keep the parameter and only protect it with the sesskey.
Hi, I'm not quite convinced that we need the 'userdebug' parameter. Ad-hoc debugging doesn't really rely on it, and it forces the user to find the sesskey themselves. Can you give me an example of a use case for the 'userdebug' parameter?
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
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.
This issue was identified during a penetration test. Neither adhocdebug.php nor the
userdebug=1URL parameter validated the sesskey, so the ad hoc debug mode of a user holdingtool/userdebug:adhocdebugcould be switched by a cross-site request (CSRF); this change requires a valid sesskey on both paths and adds it to the generated toggle link.Compatibility note: the
userdebug=1shortcut mentioned in CHANGES.md now only takes effect together with&sesskey=<current sesskey>; without it the parameter is silently ignored (no error page). Covered bytests/hook_test.php(test_setdebug_without_sesskey,test_setdebug_with_sesskey);tests/behat/enable_adhoc_debug.featureuses the toggle link, which now carries the sesskey.