From 816ba87485e68e2636167a945496c9e33a199f99 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Sun, 27 Mar 2022 20:02:16 +0100 Subject: [PATCH] SQL Injection / XSS fixes --- api/v1/contacts/read.php | 2 +- client_asset_add_modal.php | 2 +- client_assets.php | 10 +++--- client_certificates.php | 6 ++-- client_contacts.php | 6 ++-- client_departments.php | 4 +-- client_documents.php | 4 +-- client_domains.php | 6 ++-- client_invoices.php | 6 ++-- client_locations.php | 6 ++-- client_logins.php | 6 ++-- client_logs.php | 2 +- client_networks.php | 6 ++-- client_payments.php | 6 ++-- client_quotes.php | 6 ++-- client_recurring_invoices.php | 6 ++-- client_software.php | 6 ++-- client_tickets.php | 6 ++-- client_trips.php | 6 ++-- client_vendors.php | 6 ++-- invoices.php | 2 +- post.php | 64 ++++++++++++++++++++++------------- 22 files changed, 95 insertions(+), 79 deletions(-) diff --git a/api/v1/contacts/read.php b/api/v1/contacts/read.php index 5b4409ea..7f7b4903 100644 --- a/api/v1/contacts/read.php +++ b/api/v1/contacts/read.php @@ -17,7 +17,7 @@ if(isset($_GET['contact_id'])){ // Specific contact via email (single) elseif(isset($_GET['contact_email'])){ - $email = trim($_GET['contact_email']); + $email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_GET['contact_email']))); $sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_email = '$email' AND company_id = '$company_id'"); } diff --git a/client_asset_add_modal.php b/client_asset_add_modal.php index a21c9069..ee3764a8 100644 --- a/client_asset_add_modal.php +++ b/client_asset_add_modal.php @@ -2,7 +2,7 @@