fix: protect share accept endpoint with CSRF token - #63952
Merged
Conversation
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
approved these changes
Sep 2, 2026
skjnldsv
approved these changes
Sep 2, 2026
Contributor
related error |
kristian-zendato
force-pushed
the
fix/accept-file-csrf
branch
from
September 3, 2026 04:01
9e83232 to
75e2caa
Compare
Signed-off-by: kristian-zendato <kristian.zendato@nextcloud.com>
kristian-zendato
force-pushed
the
fix/accept-file-csrf
branch
from
September 3, 2026 04:02
75e2caa to
4f938c3
Compare
Contributor
|
/backport to stable35 |
| And As an "user1" | ||
| When accepting last share via the accept endpoint | ||
| And Logging in using web as "user1" | ||
| When opening last share accept confirmation page |
Member
There was a problem hiding this comment.
Might be a good idea to add a negative regression test for GET behavior as a followup.
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.
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.
/apps/files_sharing/accept/{shareId}— shows a confirmation page with sharer name and file name/apps/files_sharing/accept/{shareId}— accepts the share and redirects to the shared file (CSRF-protected)Screenshot of Accept page
Checklist
3. to review, feature component)stable32)AI (if applicable)