Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Security] Prevent creating session in stateless firewalls#51320
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedAug 9, 2023
Hey! Thanks for your PR. You are targeting branch "6.4" but it seems your PR description refers to branch "6.3". Cheers! Carsonbot |
| $this->logger?->debug('Authentication failure, redirect triggered.', ['failure_path' =>$options['failure_path']]); | ||
| $request->getSession()->set(SecurityRequestAttributes::AUTHENTICATION_ERROR,$exception); | ||
| if ($request->hasPreviousSession()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Better if we could check if!$options['stateless'] here, but that option is not passed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We cannot check on$request->hasPreviousSession() this is the reason why the test is failing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
hasPreviousSession is absolutely not the same than stateless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
So we need a way to access thestateless option from the firewall.
If someone has an idea how to do this, please help on that. I will close that PR for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@Seb33300 You can check if the_stateless attribute is set totrue instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good point! I modified my PR and reopened it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oups cannot reopen because I force pushed...
Here is the new PR:#51350
… (Seb33300)This PR was squashed before being merged into the 6.3 branch.Discussion----------[Security] Prevent creating session in stateless firewalls| Q | A| ------------- | ---| Branch? | 6.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#51319| License | MIT| Doc PR |<!--Replace this notice by a short README for your feature/bugfix.This will help reviewers and should be a good start for the documentation.Additionally (seehttps://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should followhttps://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (seehttps://symfony.com/bc).-->Please check related issue for details.Same as#51320 with `@chalasr` suggestion:#51320 (comment)Commits-------4efd50e [Security] Prevent creating session in stateless firewalls
… (Seb33300)This PR was squashed before being merged into the 6.3 branch.Discussion----------[Security] Prevent creating session in stateless firewalls| Q | A| ------------- | ---| Branch? | 6.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fixsymfony/symfony#51319| License | MIT| Doc PR |<!--Replace this notice by a short README for your feature/bugfix.This will help reviewers and should be a good start for the documentation.Additionally (seehttps://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should followhttps://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (seehttps://symfony.com/bc).-->Please check related issue for details.Same assymfony/symfony#51320 with `@chalasr` suggestion:symfony/symfony#51320 (comment)Commits-------4efd50e34c [Security] Prevent creating session in stateless firewalls
Uh oh!
There was an error while loading.Please reload this page.
Please check related issue for details.