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 relevant PHP changes after 7.1.0 #2

Open
solardiz opened this issue Dec 26, 2024 · 0 comments
Open

Document relevant PHP changes after 7.1.0 #2

solardiz opened this issue Dec 26, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@solardiz
Copy link
Member

Our documentation currently covers PHP up to "7.1.0+", but apparently a relevant change was made already in php-7.1.4RC1+:

https://stackoverflow.com/questions/53687593/when-is-mt-rand-seeded

I just found the answer. Starting with php7.1 mt_rand seeds are not retained. This is the commit for this change.
answered Dec 8, 2018 at 23:21
Jens Klammerer

The commit is php/php-src@e9e860a

Mar 27, 2017
Don't retain mt_rand() seeds across requests
In particular, this prevents manual seeding of mt_rand() to leak
across requests.

and is included in tags php-7.1.4RC1 through php-8.4.2 and security-audit-2024.

Also relevant is this recent blog post:

https://whiteknightlabs.com/2024/06/14/exploiting-gh-13690-mt_rand-in-php-in-2024/

about a PHP reseeding bug fixed just recently, apparently in PHP 8.3.6 and 8.2.18:

- Random:
. Fixed bug GH-13544 (Pre-PHP 8.2 compatibility for mt_srand with unknown
modes). (timwolla)
. Fixed bug GH-13690 (Global Mt19937 is not properly reset in-between
requests when MT_RAND_PHP is used). (timwolla)

We should double-check this and document it. Also, read up on the PHP bugs above (not just third-party blog).

@solardiz solardiz added the documentation Improvements or additions to documentation label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant