Skip to content

chore: remove unused CSRF token from server switcher - #17

Merged
Rushaway merged 1 commit into
mainfrom
chore/remove-unused-csrf-token
Aug 28, 2026
Merged

Rushaway merged 1 commit into
mainfrom
chore/remove-unused-csrf-token

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Summary

  • Removes the client-generated csrf_token from the AJAX request in header.php's server switcher.
  • It was never validated server-side: pages/server.php never reads $_POST['csrf_token'], and has never done so since the token was introduced (checked full git history) - pure theater, no real protection.
  • The target endpoint is read-only (lists demo filenames), with no session/auth state to protect, so there's nothing meaningful for CSRF to target here anyway.

No behavior change for users.

Test plan

  • vendor/bin/phpunit - 25 tests, OK
  • vendor/bin/phpstan analyse - no errors
  • vendor/bin/phpcs - clean on changed file

The token generated in header.php's changeServ handler was never
validated server-side (pages/server.php never read csrf_token, and
never has since the token was introduced) - it was pure client-side
theater with no real protection. The endpoint is also read-only
(lists demo files) with no session/auth to protect, so there's
nothing meaningful for CSRF to target here.
@Rushaway
Rushaway merged commit 7519e53 into main Aug 28, 2026
2 checks passed
@Rushaway
Rushaway deleted the chore/remove-unused-csrf-token branch August 28, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant