Skip to content

fix: disable CSRF check for message-id deeplinks#12959

Open
SoleroTG wants to merge 1 commit into
nextcloud:mainfrom
SoleroTG:main
Open

fix: disable CSRF check for message-id deeplinks#12959
SoleroTG wants to merge 1 commit into
nextcloud:mainfrom
SoleroTG:main

Conversation

@SoleroTG
Copy link
Copy Markdown
Contributor

@SoleroTG SoleroTG commented May 20, 2026

Description

This PR fixes a CSRF error that occurs when accessing a message-id deeplink directly via the browser's address bar or via external apps. This feature was recently introduced in #12632 .

Since the route is accessed via a standard, stateless GET request from outside the Vue frontend, no CSRF token header is present. Adding the #[NoCSRFRequired] attribute to the DeepLinkController::open method allows the stateless redirect to work as intended.

Related Issue

Follow-up fix for #12632.

How to test

  1. Log into Nextcloud.
  2. Open a new tab and paste a valid deeplink directly into the URL bar, e.g.: https://<your-nc>/apps/mail/open/<valid-message-id>
  3. Without this PR: Nextcloud throws a CSRF error.
  4. With this PR: The request is processed, and you are correctly redirected to the expected email message.

Signed-off-by: SoleroTG <github-29h@solero.quietmail.eu>
@welcome
Copy link
Copy Markdown

welcome Bot commented May 20, 2026

Thanks for opening your first pull request in this repository! ✌️

@ChristophWurst
Copy link
Copy Markdown
Member

<NUMMER_DEINES_ALTEN_PR>

FTFY

Copy link
Copy Markdown
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix

CSRF can be skipped for a GET 👍

@ChristophWurst
Copy link
Copy Markdown
Member

/backport to stable5.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants