-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
do not use uniqid()
for generating dev tool tokens
#57746
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
Conversation
xabbuh
commented
Jul 17, 2024
Q | A |
---|---|
Branch? | 7.2 |
Bug fix? | no |
New feature? | no |
Deprecations? | no |
Issues | part of #57588 |
License | MIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
uniqid()
for generating dev tool tokens
src/Symfony/Bundle/FrameworkBundle/EventListener/ConsoleProfilerListener.php
Outdated
Show resolved
Hide resolved
How important is it to have collision-free tokens? I mean, the places where we've cut six characters out of a hash were certainly not collision-free, but |
We could increase the length of the generated string. What do you think about that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with 4 bytes then?
updated for four random bytes |
Thank you @xabbuh. |