Skip to content

[Security/Http] Check tokens before loading users from providers #49078

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
Jan 24, 2023

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Remember me cookies and login link handler tokens contain an expiry but we check this expiry only after we've loaded a user from a provider. This can create unneeded load on the provider. Note that the now legacy security subsystem was free from this issue so this PR is fixing a regression.

For persistent tokens, I've removed any logic to sign them in PersistentRememberMeHandler because we never validate the signature, so it's just useless.

@nicolas-grekas
Copy link
Member Author

(deps=high failures need a merge up to be green).

Copy link
Member Author

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Comments addressed @stof, thanks for the review. New round unlocked :)

@nicolas-grekas nicolas-grekas merged commit 1eebf31 into symfony:5.4 Jan 24, 2023
@nicolas-grekas nicolas-grekas deleted the sec-remember-me branch January 24, 2023 13:20
nicolas-grekas added a commit that referenced this pull request Jan 25, 2023
…legacy tokens (nicolas-grekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[Security/Http] Fix compat of persistent remember-me with legacy tokens

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #49100
| License       | MIT
| Doc PR        | -

In #49078, we changed the format of remember-me tokens, effectively invalidating them all.
While the invalidation is intentional for signature-based remember-me handlers, persistent remember-me handlers could accept both legacy and updated tokens.
This PR fixes compat with legacy tokens for persistent remember-me handlers.

Commits
-------

538d660 [Security/Http] Fix compat of persistent remember-me with legacy tokens
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.

4 participants