Summary
A SQL injection flaw in the GLPI Inventory Plugin allows specially crafted report parameters to be interpreted as part of SQL queries when user input is not properly sanitized.
With sufficient permissions to access reporting features, an attacker can manipulate database queries, potentially exposing or altering sensitive GLPI data.
Affected context
This vulnerability occurs in the GLPI Inventory Plugin's reporting functionality, where user-supplied parameters are incorporated into SQL queries without adequate sanitization.
It is relevant in deployments where the Inventory Plugin is installed and configured, users have access to report generation or filtering features, and the underlying database is reachable by the GLPI application.
The risk increases in environments where report parameters are widely accessible to authenticated users with elevated or delegated rights.
Exploit preconditions
- Attack surface: GLPI web interface, specifically the Inventory Plugin reporting screens and endpoints.
- Required access: Authenticated access with sufficient rights to view and interact with inventory reports (e.g., reporting, inventory, or administrative roles).
- Trigger point: Submission of crafted input through report filters, parameters, or search fields that are directly used in SQL queries.
- Why exploitation is possible: The plugin builds SQL statements using user-controlled values without consistently applying parameterization or proper escaping, allowing attacker-supplied input to change the structure of the query.
Why this happens
The underlying issue is the construction of SQL queries using concatenated or interpolated strings that include user input from report-related fields.
Instead of using parameterized queries or prepared statements, the code path trusts input from authenticated users with reporting rights and inserts it directly into SQL clauses such as WHERE, ORDER BY, or JOIN conditions.
This behavior aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where input is not correctly validated, escaped, or bound, enabling attackers to inject additional SQL logic.
Potential impact
- Unauthorized reading of GLPI inventory and configuration data that the attacker would not normally be allowed to access.
- Modification or deletion of inventory records, asset information, or related metadata.
- Tampering with software deployment or inventory records that depend on the compromised data.
- Escalation of impact to broader GLPI data compromise if additional SQL statements can be chained or abused.
- Potential disruption of GLPI operations due to corrupted or inconsistent database state.
General mitigation guidance
Effective mitigation centers on eliminating direct string concatenation with user input in SQL and tightening data access boundaries.
Recommended patterns include:
- Using parameterized queries or prepared statements for all dynamic SQL in the Inventory Plugin, especially report-related queries.
- Enforcing strict input validation and whitelisting on report parameters (e.g., limiting fields to known values, numeric ranges, or enumerations).
- Implementing centralized query-building helpers that handle escaping and parameter binding consistently.
- Applying least-privilege principles to the database account used by GLPI, restricting its ability to perform destructive operations beyond what the application truly requires.
- Separating reporting-specific data operations from core administrative operations to reduce blast radius if report inputs are abused.
These measures help reduce the likelihood that any user-controlled input can alter the structure of database queries.
How teams detect issues like this
Detection typically involves both code-level and operational monitoring approaches:
- Static analysis: Scan PHP or backend code for dynamic SQL construction patterns, such as string concatenation with
$_GET,$_POST, or other user-driven variables, and direct interpolation into SQL statements. - Code review signals: Flag areas where report filters, search criteria, or sorting options are directly embedded in SQL without parameter binding; prioritize review of reporting modules and any custom report builders.
- Database activity monitoring: Use database logs or monitoring tools to identify anomalous queries, such as those containing unexpected concatenated fragments or multiple SQL statements originating from report endpoints.
- Security testing: Incorporate automated and manual SQL injection tests in QA and CI pipelines for GLPI plugins, focusing on inventory and reporting features.
Automated code review or SAST tools can assist in surfacing risky SQL construction patterns early in the development and maintenance lifecycle.

