Skip to content

Commit b5b15a2

Browse files
committed
fix: whitelist
1 parent 1b72ce4 commit b5b15a2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

install/installNewDB.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @filesource installNewDB.php
99
* @package TestLink
1010
* @author Francisco Mancardi
11-
* @copyright 2008,2018 TestLink community
11+
* @copyright 2008,2019 TestLink community
1212
* @copyright inspired by Etomite Content Management System
1313
* 2003, 2004 Alexander Andrew Butter
1414
*
@@ -38,8 +38,15 @@
3838
}
3939

4040
// catch DB input data
41-
foreach($_POST as $key => $val) {
42-
$_SESSION[$key] = $val;
41+
$validKeys = array("databasetype","databasehost",
42+
"databasename","tableprefix",
43+
"databaseloginname","databaseloginpassword",
44+
"tl_loginname","tl_loginpassword");
45+
foreach ($validKeys as $key) {
46+
$_SESSION[$key] = '';
47+
if( isset($_POST[$key]) ) {
48+
$_SESSION[$key] = $_POST[$key];
49+
}
4350
}
4451

4552
//assure that no timeout happens for large data

0 commit comments

Comments
 (0)