Skip to content

Commit

Permalink
Sanitize date parameters against reflected XSS.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Gneady committed May 1, 2021
1 parent e123503 commit b7ae179
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/hooks/SummaryReport.php
Expand Up @@ -2111,6 +2111,8 @@ private function date_to_ts($date){
}

private function valid_app_date($date, $default = false) {
// only allow digits, a, p, m, whitespace and valid separators (.,-/) and strip everything else
$date = trim(preg_replace('/[^\d\s-\.,\/apm:]/i', '', $date));
return $this->date_to_ts($date) ? $date : $default;
}

Expand Down

0 comments on commit b7ae179

Please sign in to comment.