From cf3c0a64106ea27ac432d8bba4826b5f1b7b881e Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 1 Jan 2022 17:02:31 -0500 Subject: [PATCH] Fixed a vulnerability in the setup.php file and other code cleanups. Thanks to the person that wishes to remain anonymous for reporting and providing a patch Also added a notice to readme to not use this web app during beta for production use --- README.md | 3 ++ check_login.php | 10 ++++--- functions.php | 10 +++---- login.php | 13 ++------- post.php | 13 +++++---- setup.php | 76 ++++++++++++++++++++++++++++--------------------- 6 files changed, 68 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 8950ae37..d7bb9680 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ * USERNAME: demo@demo * PASSWORD: demo +### Notice +This project is still in early Beta stages and is considered work in progress we highly do not recommend storing any confiential information like passwords in ITFlow. Many changes are being permformed and may cause breakage upon updates. We are hoping to have a stable 1.0 release by July 2022. + ### Features * Client Documentation * Contacts - Keep track of important individuals diff --git a/check_login.php b/check_login.php index 831fa688..367b2408 100644 --- a/check_login.php +++ b/check_login.php @@ -1,11 +1,13 @@ \ No newline at end of file diff --git a/login.php b/login.php index db682087..8e7ad958 100644 --- a/login.php +++ b/login.php @@ -2,14 +2,11 @@ if(!file_exists('config.php')){ header("Location: setup.php"); + exit; } -?> - - - - - - -$name created"; header("Location: clients.php"); - + exit; + } if(isset($_POST['edit_client'])){ diff --git a/setup.php b/setup.php index b5fa63e5..f3e5ee8f 100644 --- a/setup.php +++ b/setup.php @@ -1,6 +1,8 @@ $name created!"; header("Location: setup.php?company"); + exit; } @@ -475,11 +480,10 @@ if(isset($_POST['add_company_settings'])){ $config_api_key = keygen(); $config_aes_key = keygen(); - - mkdir("uploads/clients/$company_id"); - mkdir("uploads/expenses/$company_id"); - mkdir("uploads/settings/$company_id"); - mkdir("uploads/tmp/$company_id"); + mkdir_missing("uploads/clients/$company_id"); + mkdir_missing("uploads/expenses/$company_id"); + mkdir_missing("uploads/settings/$company_id"); + mkdir_missing("uploads/tmp/$company_id"); //Check to see if a file is attached if($_FILES['file']['tmp_name'] != ''){ @@ -552,13 +556,10 @@ if(isset($_POST['add_company_settings'])){ fwrite($myfile, $txt); - $txt = "?>\n"; - - fwrite($myfile, $txt); - fclose($myfile); header("Location: login.php"); + exit; } @@ -686,6 +687,10 @@ if(isset($_POST['add_company_settings'])){

Connect your Database

+ + Database already configured. Any further changes should be made by editing the config.php file, + or deleting it and refreshing this page. +
@@ -734,6 +739,7 @@ if(isset($_POST['add_company_settings'])){
+
@@ -798,6 +804,9 @@ if(isset($_POST['add_company_settings'])){

Company Details

+ + Database config invalid, or users already exist in the database. +
@@ -920,6 +929,7 @@ if(isset($_POST['add_company_settings'])){ +