SECURITY: signature issue
This commit is contained in:
@@ -104,6 +104,21 @@ class HTTPSig {
|
||||
if(strpos($h,'.')) {
|
||||
$spoofable = true;
|
||||
}
|
||||
if($h === 'host' && (strpos(strtolower(\App::get_hostname()),strtolower($headers[$h])) === false)) {
|
||||
logger('bad host: ' . $sig_block['keyId'] . ' != ' . $headers[$h]);
|
||||
return $result;
|
||||
}
|
||||
if($h === 'date') {
|
||||
$d = new \DateTime($headers[$h]);
|
||||
$d->setTimeZone(new \DateTimeZone('UTC'));
|
||||
$dplus = datetime_convert('UTC','UTC','now + 1 day');
|
||||
$dminus = datetime_convert('UTC','UTC','now - 1 day');
|
||||
$c = $d->format('Y-m-d H:i:s');
|
||||
if($c > $dplus || $c < $dminus) {
|
||||
logger('bad time: ' . $c);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
$signed_data = rtrim($signed_data,"\n");
|
||||
|
||||
|
Reference in New Issue
Block a user