Summary
Zammad contained a server-side template injection vulnerability in its AI Agent type enrichment feature that could lead to remote code execution on the server.
The issue becomes exploitable when an attacker can control or significantly influence type_enrichment_data, a capability typically restricted to high-privilege administrative users or compromised configuration channels.
Affected context
This vulnerability manifests in Zammad deployments that:
- Enable and use the AI Agent or related type enrichment functionality
- Process
type_enrichment_datathrough a server-side templating engine - Allow high-privilege users or automated systems to define or modify enrichment templates or configuration values
The risk is most pronounced in environments where administrative or integration interfaces can be misused, or where configuration is synchronized from external, partially trusted systems.
Exploit preconditions
- Attack surface: Web-based application paths that invoke the AI Agent / type enrichment logic on the Zammad server.
- Required access: Ability to control or influence
type_enrichment_data, typically requiring administrative-level access, API keys, or compromise of configuration/integration systems. - Trigger point: Evaluation or rendering of the enrichment data by the underlying server-side template engine as part of AI Agent processing.
- Why exploitation is possible: Untrusted or insufficiently validated template content is interpreted by a powerful server-side template engine that can execute arbitrary expressions or commands, enabling code execution in the application context.
Why this happens
The core issue is the execution of attacker-influenced template content on the server side, aligning with CWE-94: Improper Control of Generation of Code ('Code Injection').
The AI Agent type enrichment logic appears to treat type_enrichment_data as trusted input, passing it directly or with weak validation into a server-side templating engine capable of executing dynamic expressions.
Because template syntax can be used to access internal objects, invoke methods, or execute commands, any control over this content effectively becomes control over server-side code execution.
This pattern also relates to CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine, where user-controlled or externally sourced data is embedded into templates without strict sanitization, context-aware encoding, or use of a restricted expression dialect.
Potential impact
- Remote execution of arbitrary code within the Zammad application server process.
- Reading or modification of sensitive ticket data, user information, and configuration stored by the helpdesk system.
- Use of the compromised Zammad server as a foothold for lateral movement within the hosting environment.
- Exfiltration of credentials, API keys, or integration tokens configured within Zammad.
- Disruption of helpdesk operations, including denial of service or tampering with AI Agent behavior and responses.
General mitigation guidance
Effective mitigation generally involves removing the capability for untrusted template execution and reducing the power of any templating mechanisms that remain:
- Avoid interpreting configuration or enrichment data as executable template code; treat it as plain data wherever possible.
- Where templating is required, use a restricted template engine or sandboxed expression language that cannot access arbitrary server objects or execute system commands.
- Enforce strict validation and whitelisting for configuration fields like
type_enrichment_data, limiting allowed syntax, operations, and data types. - Ensure that only least-privilege roles can modify AI Agent or enrichment configurations, and review which integrations or automated systems can influence them.
- Segment the component that evaluates templates from core infrastructure and run it under a locked-down runtime account with minimal OS and network permissions.
- Prefer declarative configuration formats over script-like or expression-capable templates, especially for security-sensitive features such as AI-driven automations.
How teams detect issues like this
Detection of similar vulnerabilities typically combines code-centric and operational approaches:
- Static analysis: Search for usages of server-side template engines where configuration or database-backed fields are rendered without strict separation of code and data. Flag patterns where administrative configuration values are passed directly into template rendering functions.
- Code review: Pay particular attention to AI/automation modules, enrichment features, and dynamic configuration pathways. Indicators include string interpolation, concatenation, or direct template evaluation of fields like
type_enrichment_data. - Policy enforcement: Introduce secure coding guidelines that prohibit use of full-power template engines for user or admin-supplied content, and require sandboxed or read-only expression engines for automation rules and AI features.
- Runtime monitoring: Instrument server logging and application security tools to detect anomalous template expressions, suspicious method access via templates, or unusual process and file system activity originating from template evaluation paths.

