Skip to content

fix: protect share accept endpoint with CSRF token - #63952

Open
kristian-zendato wants to merge 1 commit into
masterfrom
fix/accept-file-csrf
Open

fix: protect share accept endpoint with CSRF token#63952
kristian-zendato wants to merge 1 commit into
masterfrom
fix/accept-file-csrf

Conversation

@kristian-zendato

@kristian-zendato kristian-zendato commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The share accept link in notification emails previously accepted the share on a single GET request, which bypass CSRF protection. This change introduces a confirmation page and moves the actual acceptance to a POST request with a CSRF token.

  • GET /apps/files_sharing/accept/{shareId} — shows a confirmation page with sharer name and file name
  • POST /apps/files_sharing/accept/{shareId} — accepts the share and redirects to the shared file (CSRF-protected)
  • Share notification emails now link to the confirmation page (showAccept) instead of accepting directly

Screenshot of Accept page

image

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
@kristian-zendato
kristian-zendato requested review from a team as code owners September 2, 2026 11:27
@kristian-zendato
kristian-zendato requested review from come-nc, icewind1991, leftybournes, skjnldsv, sorbaugh and susnux and removed request for a team September 2, 2026 11:27
@susnux susnux added bug 3. to review Waiting for reviews labels Sep 2, 2026
@susnux susnux added this to the Nextcloud 36 milestone Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants