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
insane token params #14918
Comments
|
and errors like "PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0" triggered by various exports sucks too - triggered by a user may you consider roll back to the version before ajax and forget any "development" which happened from then? |
|
BTW: it's the f**ing ~ - who the hell is using that in a GET request on servers where you don't serve userhomes and backup files to the world? |
|
guess what - gefore phpMyAdmin 4.8.x no problem 18.05.2013SecRule REQUEST_URI "~" "id:'121',phase:1,status:404,nolog,t:none,t:htmlEntityDecode,t:urlDecodeUni,t:removeWhitespace,t:replaceNulls,block" |
|
From Util.php, lines 4761+: public static function generateRandom($length)
{
$result = '';
if (class_exists('phpseclib\\Crypt\\Random')) {
$random_func = [
'phpseclib\\Crypt\\Random',
'string',
];
} else {
$random_func = 'openssl_random_pseudo_bytes';
}
while (strlen($result) < $length) {
// Get random byte and strip highest bit
// to get ASCII only range
$byte = ord($random_func(1)) & 0x7f;
// We want only ASCII chars
if ($byte > 32) {
$result .= chr($byte);
}
}
return $result;
}The problem here is that the returned random string can also contain URL-problematic characters, like After taking a look at the ASCII table, I suggest to remove the interval from U+0021 (33) to U+002B (43) and thus exclude these characters from the allowed set:
In addition, I’d add a blacklist for these characters:
The most effective approach may be either:
Performance considerations are not that important in my opinion, since the token is not regenerated on every user action, but instead stored in the session. Open to input from the others here. |
|
seriously why do people these days need for every trivial piece of code complex solutions, libraries and frameworks? php > echo bin2hex(openssl_random_pseudo_bytes(30)); php > echo bin2hex(random_bytes(30)); bin2hex(generateRandom()) and you are done for the sake of god if ypu can#t live without using at least one framework |
Signed-off-by: William Desportes <williamdes@wdes.fr>
Signed-off-by: William Desportes <williamdes@wdes.fr>
Signed-off-by: William Desportes <williamdes@wdes.fr>
|
@thelounge-zz We will now use hex for the session token 🎉 ! |
|
thanks |
may you guys consider instead crap like "&token=hzRo%3F6v~*95v'_7]" where intrusion detection systems react create tokens like every normal person on this plant with hash functions?
The text was updated successfully, but these errors were encountered: