Repository navigation
Conversation
Three scripts changed state on behalf of the logged-in user without checking the request tokens that other such scripts use, so a link or form on another site could trigger them (CSRF): - forum_thread_status.php: thread owner's "answered" / notice-export status (GET links) - host_venue_action.php: location (venue) of the user's computer (GET) - team_remove_inactive_action.php: removal of members from a team by its founder (POST) Call check_tokens() in each and add url_tokens() or form_tokens() to the links and forms that lead to them (forum_thread.php, host.inc, team_remove_inactive_form.php). The two GET scripts also list the token arguments in check_get_args(). Assisted-by: Claude Code:claude-sonnet-5-5
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.
Three scripts changed state on behalf of the logged-in user without checking the request tokens that other state-changing scripts use (see the comment above
url_tokens()inutil.inc), so a link or form on another site could trigger them:forum_thread_status.php: the thread owner's "answered" / notice-export status (GET links)host_venue_action.php: the location (venue) of the user's computer (GET)team_remove_inactive_action.php: removal of members from a team by its founder (POST)Each now calls
check_tokens(), and the links and forms that lead to them addurl_tokens()orform_tokens():forum_thread.php,location_form()inhost.inc(only shown to the logged-in owner of the computer) andteam_remove_inactive_form.php. The two GET scripts also listtnowandttokincheck_get_args().AI assistance
Found and written with Claude Code (claude-sonnet-5-5). I reviewed the change.
Testing
php -lis clean for all six files. Host venue, on a test project with a logged-in test user and a computer record: a request without tokens is refused with "Link has timed out" and the venue stays unchanged. The location form on the computer's page containstnowandttok, and a request with those values sets the venue. The thread status and member removal changes follow the same pattern; I did not run them.Summary by cubic
Adds request token checks to three state-changing scripts so that cross-site request forgery can no longer trigger them. Previously, a link or form on another site could change the user's thread status, computer venue, or team membership.
forum_thread_status.php,host_venue_action.php, andteam_remove_inactive_action.phpnow callcheck_tokens()and requiretnow/ttokarguments.forum_thread.php,host.inc, andteam_remove_inactive_form.phpnow include the appropriate tokens.Written for commit bc49fd6. Summary will update on new commits.