Skip to content
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

Document best practices about encoders and password validation to avoid DOS attacks #3003

Closed
fabpot opened this issue Sep 23, 2013 · 3 comments
Labels
actionable Clear and specific issues ready for anyone to take them. Security Validator

Comments

@fabpot
Copy link
Member

fabpot commented Sep 23, 2013

See http://symfony.com/blog/cve-2013-5750-security-issue-in-fosuserbundle-login-form

The documentation should warn about the following:

  • A password must have a max length validator (and the max value is 4096 as of Symfony 2.4 -- see [Security] limited the password length passed to encoders symfony#9100).
  • As of Symfony 2.4, when creating a custom encoder, $this->checkPasswordLength($raw); must be the first code executed in encodePassword() and isPasswordValid(). For other versions of Symfony, just copy paste the code of the checkPasswordLength() method found in Symfony\Component\Security\Core\Encoder\BasePasswordEncoder.

Not sure where to add these recommendations though.

@lutzportela
Copy link

weaverryan added a commit that referenced this issue Sep 25, 2013
…protecting against attacks with custom password encoders
weaverryan added a commit that referenced this issue Sep 26, 2013
@weaverryan
Copy link
Member

This should be all set now!

@lucups
Copy link

lucups commented Jan 7, 2014

This is very good !

weaverryan added a commit that referenced this issue Mar 8, 2014
…ssword encoders (bicpi)

This PR was merged into the 2.3 branch.

Discussion
----------

[Security][Authentication] Fix instructions for creating password encoders

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets | -

Please correct me if I am wrong, but it seems that the code has changed after #3003. There is no `BasePasswordEncoder::checkPasswordLength()` method. Same seems to apply to 2.4. Maybe the implementation was changed to make it bc?

Commits
-------

e95c1f5 [Security][Authentication] Fix instructions for creating custom password encoders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. Security Validator
Projects
None yet
Development

No branches or pull requests

4 participants