Skip to content

Web: require tokens for deleting sandbox files - #7550

Open
alplix wants to merge 1 commit into
BOINC:masterfrom
alplix:fix-sandbox-delete
Open

alplix wants to merge 1 commit into
BOINC:masterfrom
alplix:fix-sandbox-delete

Conversation

@alplix

@alplix alplix commented Dec 6, 2026 •

Copy link
Copy Markdown

sandbox.php?action=delete_files removed the named files from the user's sandbox without checking the request tokens, unlike upload_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 for delete_files. The file list form already includes form_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:

  • before the change, sandbox.php?action=delete_files&victim.txt=1 deleted the file;
  • after the change, the same request is refused with "Link has timed out" and the file stays.
    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.php where action=delete_files deleted files without verifying request tokens, unlike other state-changing actions. check_tokens() is now called, and the existing file list form already includes form_tokens(), so the delete button continues to work.

Written for commit 1ae56e3. Summary will update on new commits.

View guided diff

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

@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 1 file

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