Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

RememberMe token should be hashed in the database #27910

Copy link
Copy link
Closed
@aschempp

Description

@aschempp
Issue body actions

Symfony version(s) affected: any (since 2.0)

Description
Symfony security supports two different types of rememberme cookies. Persistent rememberme tokens are stored in the database to prevent identity theft. They store a series (sort of like a username for your token) and the token (sort of your password). For each series/username, the token is changed on every successful rememberme login.

If someone get's access to a database dump for any reason, he can possibly manually add a rememberme cookie to his browser and be authenticated by Symfony automatically. To prevent such attach, it is recommended to hash the token value in the database (see How to Secure Long-Term Authentication article by Paragon IE).

This is currently not done in Symfony, and adding it would generally improve security.

How to reproduce
This is more of a theoretical issue in the security implementation, reproducing it would require manipulating your browser cookies.

Possible Solution
The PersistentTokenBasedRememberMeServices implementation should be adjusted to store hashed passwords and authenticate for them.

Additional context
I'm very much willing to create a PR for this if the Symfony security experts agree that things should be changed (and for which version). We also need to decide on whether all existing rememberme cookies will become invalid after this implementation or we should continue to support unencrypted database values (for until the user has logged in once and the token is updated).

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureHelp wantedIssues and PRs which are looking for volunteers to complete them.Issues and PRs which are looking for volunteers to complete them.Security

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.