Repository navigation
Conversation
sandbox.php?action=delete_files removed the named files from the user's sandbox without checking the request tokens, unlike the other state-changing actions in that script. The file names are passed as query arguments, so a link on another site could delete files of a logged-in user who can use the sandbox (CSRF). Call check_tokens() for delete_files. The file list form already includes form_tokens(). 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.
sandbox.php?action=delete_filesremoved the named files from the user's sandbox without checking the request tokens, unlikeupload_file,add_file,get_file, the tag actions and the others in that script. The file names are passed as query arguments, so a link on another site could delete files of a logged-in user who can use the sandbox (CSRF).check_tokens()is now called fordelete_files. The file list form already includesform_tokens(), so the "Delete selected files" button keeps working.AI assistance
Found and written with Claude Code (claude-sonnet-5-5). I reviewed the change.
Testing
On a test project with a logged-in test user who has sandbox access and a file in the sandbox:
sandbox.php?action=delete_files&victim.txt=1deleted the file;I did not click the button in the browser; the list form's hidden token fields are the ones
check_tokens()reads.Summary by cubic
Fixes a CSRF vulnerability in
sandbox.phpwhereaction=delete_filesdeleted files without verifying request tokens, unlike other state-changing actions.check_tokens()is now called, and the existing file list form already includesform_tokens(), so the delete button continues to work.Written for commit 1ae56e3. Summary will update on new commits.