Skip to content

[SecurityBundle] make remember-me cookies auto-secure + inherit their default config from framework.session.cookie_* #28446

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

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #28338
License MIT
Doc PR -

Let's make it easier to have a good default security level, now for the remember-me cookie.

$rememberMeSecureDefault = false;
$rememberMeSameSiteDefault = null;

foreach ($container->getExtensions() as $name => $extension) {
Copy link
Member

Choose a reason for hiding this comment

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

if (isset($container->getExtensions()['framework'])) { instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

Missing some notes in the changelog files.

@stof
Copy link
Member

stof commented Sep 12, 2018

As you add support in BrowserKit, shouldn't you also not send the cookie in the request if it is a samesite=strict one and we don't have a request to the same site as the last one in the history ? Otherwise, we don't actually support them.

@nicolas-grekas
Copy link
Member Author

At least we can read the response cookie. I agree it would even be better to implement the samesite logic in browserkit. Let's open a separate issue for that?

@nicolas-grekas nicolas-grekas force-pushed the sec-cookie-rememberme branch 3 times, most recently from ff03aa0 to 9c153e4 Compare September 18, 2018 19:31
@nicolas-grekas
Copy link
Member Author

Comments addressed.

Status: needs review

@@ -11,6 +11,9 @@ CHANGELOG
or `Symfony\Component\Security\Core\Authentication\Token\RememberMeToken`.
* Added `Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddExpressionLanguageProvidersPass`
* Added `json_login_ldap` authentication provider to use LDAP authentication with a REST API.
* Made remember-me cookies inherit their default config from `framework.session.cookie_*`
and added an "auto" mode to their "secure" config option to make them secure on HTTPS automatically.

Copy link
Member

Choose a reason for hiding this comment

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

extra blank line

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed thanks :)

… default config from framework.session.cookie_*
Copy link
Contributor

@leofeyer leofeyer left a comment

Choose a reason for hiding this comment

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

Except the two unrelated changes (src/Symfony/Component/DomCrawler/CHANGELOG.md and src/Symfony/Component/Finder/CHANGELOG.md), this look good to me.

@fabpot
Copy link
Member

fabpot commented Sep 26, 2018

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 6ec223b into symfony:master Sep 26, 2018
fabpot added a commit that referenced this pull request Sep 26, 2018
…+ inherit their default config from framework.session.cookie_* (nicolas-grekas)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[SecurityBundle] make remember-me cookies auto-secure + inherit their default config from framework.session.cookie_*

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28338
| License       | MIT
| Doc PR        | -

Let's make it easier to have a good default security level, now for the remember-me cookie.

Commits
-------

6ec223b [SecurityBundle] make remember-me cookies auto-secure + inherit their default config from framework.session.cookie_*
@nicolas-grekas nicolas-grekas deleted the sec-cookie-rememberme branch October 2, 2018 14:04
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
This was referenced Nov 3, 2018
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.

6 participants