Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helpdesk form: store direct access token in session once validated #19142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AdrienClairembault
Copy link
Contributor

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.

Description

As a reminder, this token allow a form to be accessed like this: /Form/Render/{$id}?token={$token}.

This works well when accessing a form but mean that any AJAX requested performed on the form page must also include this token to make sure the user is allowed to call it.

This is bad because it is hard to maintain (need to manually include the token everywhere) and non generic (the access policiy that deal with the token should not rely on external code that manually refer to its internal behavior).

The proposed solution is to store the submitted token in the session so it can easily be accessed by any ajax request using the session data.

This should not weaken the security as you still need the correct token to access the form in the first place.

@AdrienClairembault AdrienClairembault self-assigned this Mar 6, 2025
@AdrienClairembault AdrienClairembault marked this pull request as ready for review March 6, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant