Skip to content

Commit dfae49f

Browse files
committed
Security: Add filter for DB port in install scripts
1 parent ece9eb2 commit dfae49f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

main/install/ajax.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
$dbName = null;
4747
}
4848

49-
$dbPort = isset($_POST['db_port']) ? $_POST['db_port'] : 3306;
49+
$dbPort = isset($_POST['db_port']) ? (int) $_POST['db_port'] : 3306;
5050

5151
$manager = connectToDatabase($dbHost, $dbUsername, $dbPass, $dbName, $dbPort);
5252

main/install/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@
279279
$GLOBALS[$key] = $_POST[$key];
280280
}
281281
}
282+
$dbPortForm = (int) $dbPortForm;
282283

283284
/* NEXT STEPS IMPLEMENTATION */
284285

0 commit comments

Comments
 (0)