I finally could create a way to reproduce the bug that I am having. When 2 or more users call a page at the same second modsecurity generates the same sequence of random numbers (using rand() function from php) to both users.
Here is a demonstration of the bug:
http://quemfazsite.com.br/em_criacao/modelo9/teste.php
Opening this page, 2 iframes will load and each one should be generating random numbers independetly of each other but both frames are generating the same sequence of random numbers! The very simple source code can be seen below. If you dont see the same sequence I ask you to reload the page a few times till you get the same number sequence.
EDIT: this bug only happens with modsecurity active. If you comment the "LoadModule" line that loads the modsecurity the bug wont happen!
<?php
if (isset($_GET["test"])) {
$output= "";
for ($i=0;$i<10;$i++) {
$output.= rand(0,99999999) . "<br />";
}
echo $output;
exit();
}
?>
<iframe src="PUT_THE_SAME_NAME_OF_THIS_FILE_HERE.php?test&953487"></iframe>
<iframe src="PUT_THE_SAME_NAME_OF_THIS_FILE_HERE.php?test&234322"></iframe>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…