Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(sec): Fix SQL injection in dashboard #6250

Merged
merged 2 commits into from
Jun 25, 2018
Merged

Conversation

leoncx
Copy link
Contributor

@leoncx leoncx commented Apr 27, 2018

  • Fix some SQL Injections

@@ -3,34 +3,34 @@
* Copyright 2005-2016 Centreon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2018 ;)

@@ -61,9 +70,9 @@

if ($accessHost) {
$DBRESULT = $pearDBO->query(
"SELECT * FROM `log_archive_host` WHERE host_id = "
"SELECT * FROM `log_archive_host` WHERE host_id = '"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good idea to update this query like that ? Because it's not working with mysql strict mode

@@ -61,8 +70,8 @@
if ($accessService) {
$DBRESULT = $pearDBO->query(
"SELECT * FROM `log_archive_service` WHERE host_id = '".
$pearDBO->escape($_GET["host_id"])."' AND service_id = ".
$pearDBO->escape($_GET["id"])." ORDER BY `date_start` DESC"
$pearDBO->escape($_GET["host_id"])."' AND service_id = '".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good idea to update this query like that ? Because it's not working with mysql strict mode

@sc979 sc979 force-pushed the security-fix-reporting branch from a35f9ff to f9e5737 Compare June 4, 2018 12:38
leoncx added 2 commits June 8, 2018 12:03
* Use prepare statement on queries
@sc979 sc979 force-pushed the security-fix-reporting branch from f9e5737 to d520475 Compare June 8, 2018 10:03
@kduret kduret merged commit 552ea73 into 2.8.x Jun 25, 2018
@kduret kduret deleted the security-fix-reporting branch June 25, 2018 08:28
kduret pushed a commit that referenced this pull request Jun 25, 2018
* fix(sec): Fix SQL injection in dashboard

* Fix some SQL Injections

* fix(sec): Change query method

* Use prepare statement on queries
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants