Skip to content

Web: add request tokens to thread status, host venue and member removal - #7551

Open
alplix wants to merge 1 commit into
BOINC:masterfrom
alplix:fix-csrf-tokens
Open

alplix wants to merge 1 commit into
BOINC:masterfrom
alplix:fix-csrf-tokens

Conversation

@alplix

@alplix alplix commented Dec 6, 2026 •

Copy link
Copy Markdown

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() in util.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 add url_tokens() or form_tokens(): forum_thread.php, location_form() in host.inc (only shown to the logged-in owner of the computer) and team_remove_inactive_form.php. The two GET scripts also list tnow and ttok in check_get_args().

AI assistance

Found and written with Claude Code (claude-sonnet-5-5). I reviewed the change.

Testing

php -l is 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 contains tnow and ttok, 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, and team_remove_inactive_action.php now call check_tokens() and require tnow/ttok arguments.
  • The links and forms in forum_thread.php, host.inc, and team_remove_inactive_form.php now include the appropriate tokens.

Written for commit bc49fd6. Summary will update on new commits.

View guided diff

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

View guided diff | Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants