mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-21 23:20:22 +00:00
Don't allow to read ini file everywhere on filesystem.
Signed-off-by: D9ping <D9ping@users.noreply.github.com>
This commit is contained in:
parent
fb7ba20055
commit
182a6509e9
1 changed files with 1 additions and 2 deletions
|
@ -5,8 +5,7 @@ include_once('../../includes/functions.php');
|
|||
|
||||
|
||||
if(isset($_POST['interface']) && isset($_POST['csrf_token']) && CSRFValidate()) {
|
||||
$int = $_POST['interface'];
|
||||
// FIXME slashes and other forbidden filename characters not stripped. [security]
|
||||
$int = preg_replace('/[^a-z0-9]/', '', $_POST['interface']);
|
||||
if(!file_exists(RASPI_CONFIG_NETWORKING.'/'.$int.'.ini')) {
|
||||
touch(RASPI_CONFIG_NETWORKING.'/'.$int.'.ini');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue