mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
XSS sanitize pwrstatd application script inputs (#14545)
* XSS sanitize pwrstatd application script inputs * Removing is_int logic
This commit is contained in:
@@ -31,7 +31,14 @@ $rrd_def = RrdDefinition::make()
|
||||
|
||||
$metrics = [];
|
||||
foreach ($pwrstatd_data as $data) {
|
||||
$sn = $data['sn'];
|
||||
$sn = is_string($data['sn']) ? filter_var($data['sn'], FILTER_SANITIZE_STRING) : null;
|
||||
|
||||
if (is_null($data['sn'])) {
|
||||
echo PHP_EOL . $name . ':' . ' Invalid or no psu serial number found.' . PHP_EOL;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$mruntime = $data['mruntime'];
|
||||
$pcapacity = $data['pcapacity'];
|
||||
$pload = $data['pload'];
|
||||
|
Reference in New Issue
Block a user