From c138984fc9e7be4ba683ff77e313ca37ad4f7777 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 25 Jan 2024 18:48:39 -0500 Subject: [PATCH] XSS prevent on sort_asc and eid. Still need to protect filter --- web/includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index b4a5d0cc8..6e9c99402 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1126,9 +1126,9 @@ function sortHeader($field, $querySep='&') { '?view='.$view, 'page=1'.((isset($_REQUEST['filter']) and isset($_REQUEST['filter']['query'])) ? $_REQUEST['filter']['query'] : ''), 'sort_field='.$field, - 'sort_asc='.( ( isset($_REQUEST['sort_field']) and ( $_REQUEST['sort_field'] == $field ) ) ? !$_REQUEST['sort_asc'] : 0), + 'sort_asc='.( ( isset($_REQUEST['sort_field']) and ( $_REQUEST['sort_field'] == $field ) ) ? !validInt($_REQUEST['sort_asc']) : 0), 'limit='.(isset($_REQUEST['limit']) ? validInt($_REQUEST['limit']) : ''), - (isset($_REQUEST['eid']) ? 'eid='.$_REQUEST['eid'] : '' ), + (isset($_REQUEST['eid']) ? 'eid='.validCardinal($_REQUEST['eid']) : '' ), )); }