8000 [Security] Remember me secure option not working as expected with "auto" setting · Issue #40471 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] Remember me secure option not working as expected with "auto" setting #40471

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

Closed
fliespl opened this issue Mar 15, 2021 · 0 comments
Closed

Comments

@fliespl
Copy link
Contributor
fliespl commented Mar 15, 2021

Symfony version(s) affected: 4.4 / 5.2

Description
Manually setting remember_me cookie secure as auto is still is being set as secure one even if used over http.

Problem is that value 'auto' is being set on \Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices service instead of converting to null (to get data from $request->isSecure() method).

That causes a call to onLoginSuccess with secure being set as auto (string) and being treated as true in Cookie __constructor (which has typed bool conversion).

On the other hand - configuration specifies that 'auto' value should be fine.

$builder->enumNode($name)->values([true, false, 'auto'])->defaultValue('auto' === $value ? null : $value);

@fliespl fliespl added the Bug label Mar 15, 2021
@fliespl fliespl changed the title [Security] Secure not not working as expected with "auto" setting [Security] Remember me secure option not working as expected with "auto" setting Mar 15, 2021
@nicolas-grekas nicolas-grekas modified the milestone: 4.4 Mar 23, 2021
nicolas-grekas added a commit that referenced this issue Mar 23, 2021
…ookie security (fliespl)

This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Handle properly 'auto' option for remember me cookie security

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40471
| License       | MIT
| Doc PR        | n/a

Manually setting remember_me cookie secure as auto is still is being set as secure one even if used over http.

This PR fixes this behaviour by converting auto to null prior setting it up for service.

Commits
-------

2bcf69c [Security] Handle properly 'auto' option for remember me cookie security
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0