Summary
GLPI versions 11.0.0 through 11.0.5 contain a template injection vulnerability that allows an authenticated administrator to transform server-side template expressions into executable code.
Under specific conditions, crafted template content can be interpreted as code by the underlying template engine, potentially leading to remote code execution on the GLPI server.
Affected context
This vulnerability occurs in GLPI's server-side templating features that accept administrator-supplied content, such as configurable templates, messages, or views rendered by the application engine.
It is relevant when:
- Administrators can edit or create templates that are later rendered on the server
- The template engine executes embedded expressions with elevated privileges
- There is insufficient separation between data (textual templates) and logic (executable expressions)
While the attack surface is typically restricted to authenticated admins, multi-tenant or delegated-admin environments can broaden the risk.
Exploit preconditions
- Attack surface: Server-side template rendering paths in the GLPI web application
- Required access: Authenticated administrator (or account with equivalent template-editing capabilities)
- Trigger point: Rendering of a maliciously crafted template by the GLPI server during normal application use
- Why exploitation is possible: The templating layer interprets untrusted template content as executable expressions, and protections such as expression whitelisting, sandboxing, or strict separation of display logic and business logic are insufficient, enabling arbitrary or near-arbitrary code execution.
Why this happens
The core issue is improper control over dynamically evaluated code within the templating system.
Administrator-supplied content is treated as trusted program logic instead of inert text, allowing injection of template expressions that the engine evaluates with application-level privileges.
This maps primarily to CWE-94: Improper Control of Generation of Code, where user-editable content ends up generating or modifying executable code at runtime.
The behavior also aligns with CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine, since special syntax and control structures in templates are insufficiently constrained and can be abused to escape intended limits and perform server-side operations beyond simple rendering.
Potential impact
- Execution of arbitrary commands or code on the GLPI server
- Complete compromise of the GLPI application and its stored configuration and asset data
- Unauthorized access to credentials, API keys, or integration secrets handled by GLPI
- Use of the GLPI server as a pivot point for lateral movement within the infrastructure
- Tampering with IT asset records, tickets, and configuration items, affecting operational integrity
- Installation of persistent backdoors or malware on the underlying host system
General mitigation guidance
Effective mitigation focuses on hardening the templating model and minimizing the ability of any actor (including administrators) to inject logic-bearing constructs:
- Prefer non-Turing-complete or heavily restricted templating languages that do not expose direct code execution or arbitrary function calls.
- Enforce strict separation of concerns: templates should be limited to presentation (variables, basic loops, and conditionals) rather than embedding business logic or system operations.
- Apply expression whitelisting and sandboxing in the template engine so that only safe functions, variables, and helpers are accessible and side-effecting operations are blocked.
- Normalize and escape special template syntax when storing or rendering user-editable content that should not be executed.
- Follow least privilege at the process and OS level: run the GLPI service with minimal system permissions so that any template-level compromise has limited impact.
- Introduce defense in depth controls such as web application firewalls or policy enforcement that detect and block suspicious template constructs in administrative interfaces.
How teams detect issues like this
Organizations can approach detection by looking both at code-level patterns and runtime behavior:
- Static analysis and code review:
- Identify code paths where template content originates from database fields or configuration options editable by users, even privileged ones.
- Flag uses of template engines that allow arbitrary function calls, file access, or evaluation of dynamic expressions without explicit restrictions.
- Review for any use of generic "evaluate" APIs in templating (e.g., dynamic evaluation helpers, unsafe filters, or direct language embedding).
- Configuration and policy checks:
- Enforce secure template engine modes (no-compile, sandboxed, or restricted-expression modes).
- Use CI/CD policies to prevent introduction of new templates or helpers that expose low-level system APIs.
- Runtime monitoring:
- Watch logs for unexpected template parse or render errors, or templates containing unusual control structures and function calls.
- Monitor for anomalous process activity (shell execution, file writes in unusual locations, outbound connections) correlated with template rendering endpoints.
- Automated scanning tools and SAST engines that understand template engines can be configured to highlight unsafe template evaluation patterns and high-risk helper APIs.

