Skip to content

[Security] Allow to stick to a specific password hashing algorithm #34020

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
Oct 27, 2019

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Oct 18, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #33054
License MIT
Doc PR todo

Allows using argon2i, argon2id and bcrypt.

@stof
Copy link
Member

stof commented Oct 18, 2019

Some tests are failing

@chalasr chalasr force-pushed the sec-fixed-algo branch 3 times, most recently from 6b03279 to 7f049a1 Compare October 19, 2019 01:15
@chalasr
Copy link
Member Author

chalasr commented Oct 19, 2019

Got it, the PASSWORD_* constants will be strings as of PHP 7.4, not integers (https://wiki.php.net/rfc/password_registry).
Now green.

Copy link
Member

@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.

How can one configure a migrating encoder that uses bcrypt as the main one? I think that should be the main supported use case here.

@chalasr chalasr changed the title [Security] Allow to stick to a specific password hashing algorithm [Security] Allow to stick/migrate to a specific password hashing algorithm Oct 27, 2019
@chalasr
Copy link
Member Author

chalasr commented Oct 27, 2019

@nicolas-grekas Now possible via a new encoder option:

encoders:
    App\User:
        algorithm: argon2id
        migrating_from: bcrypt # or ['bcrypt, 'argon2i']

Comments addressed also, thanks.

@chalasr chalasr force-pushed the sec-fixed-algo branch 2 times, most recently from ce7a6b7 to 0641859 Compare October 27, 2019 10:10
@chalasr chalasr changed the title [Security] Allow to stick/migrate to a specific password hashing algorithm [Security] Allow to stick to a specific password hashing algorithm Oct 27, 2019
@chalasr
Copy link
Member Author

chalasr commented Oct 27, 2019

Migrations related part moved to #34139

@chalasr chalasr force-pushed the sec-fixed-algo branch 3 times, most recently from 2cdadfe to 6f12f71 Compare October 27, 2019 10:41
@nicolas-grekas
Copy link
Member

Thank you @chalasr.

nicolas-grekas added a commit that referenced this pull request Oct 27, 2019
…ng algorithm (chalasr)

This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Allow to stick to a specific password hashing algorithm

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

Allows using `argon2i`, `argon2id` and `bcrypt`.

Commits
-------

6712d1e [Security] Allow to set a fixed algorithm
@nicolas-grekas nicolas-grekas merged commit 6712d1e into symfony:4.4 Oct 27, 2019
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
@chalasr chalasr deleted the sec-fixed-algo branch April 14, 2020 15:30
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.

[RFC] Give back control of password hashing algorithm to app developer
5 participants