Skip to content

Commit 3581edc

Browse files
committed
fix: Time-Based Blind SQL Injection via options[stato] Parameter
1 parent 5a631ac commit 3581edc

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

modules/contratti/ajax/select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
$stato = !empty($superselect['stato']) && in_array($superselect['stato'], $allowed_stati)
5858
? $superselect['stato']
5959
: 'is_pianificabile';
60-
$where[] = '`idstato` IN (SELECT `id` FROM `co_staticontratti` WHERE '.$stato.' = 1)';
60+
$where[] = '`idstato` IN (SELECT `id` FROM `co_staticontratti` WHERE `'.str_replace('`', '', $stato).'` = 1)';
6161
}
6262

6363
if (!empty($search)) {

modules/ordini/ajax/select.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
? $superselect['stato']
5454
: 'is_fatturabile';
5555
$where[] = '`or_statiordine`.'.$stato.' = 1';
56+
$where[] = '`or_statiordine`.`'.str_replace('`', '', $stato).'` = 1';
5657
}
5758
}
5859

modules/preventivi/ajax/select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
$stato = !empty($superselect['stato']) && in_array($superselect['stato'], $allowed_stati)
6161
? $superselect['stato']
6262
: 'is_pianificabile';
63-
$where[] = '('.$stato.' = 1)';
63+
$where[] = '(`'.str_replace('`', '', $stato).'` = 1)';
6464
}
6565

6666
if (!empty($search)) {

0 commit comments

Comments
 (0)