Skip to main content

Python CVE-2026-34172

HIGH
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-03-27 https://github.com/Giskard-AI/giskard-oss GHSA-frv4-x25r-588m
7.7
CVSS 4.0 · Vendor: https://github.com/Giskard-AI/giskard-oss
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticated user calls ChatWorkflow.chat()
  2. Exploit
    Pass malicious Jinja2 template string
  3. Execution
    Template renders without sandbox
  4. Impact
    Execute arbitrary code via class traversal

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
Exploitation Conditions

Requires authenticated access (PR:L) to Giskard agent workflow. Developer must pass user-controlled input directly to ChatWorkflow.chat(message) method. Attacker leverages Jinja2 template injection in non-sandboxed Environment to achieve RCE via class traversal.

Impact

This vulnerability presents critical real-world risk despite the absence of a formal CVSS score. The attack requires developers to pass unsanitized user input directly to ChatWorkflow.chat(), which the method signature and naming conventions inadvertently encourage-the parameter is literally named 'message', strongly implying it accepts user chat messages. Authentication requirements cannot be confirmed from available data, but the vulnerability operates at the application layer where the giskard-agents library is integrated, meaning exploitation depends on how the consuming application exposes the chat() method. No EPSS score is available for this recently-disclosed CVE, and CISA KEV status shows no confirmed active exploitation. However, the GitHub advisory provides detailed exploitation mechanics including working proof-of-concept code demonstrating the full class traversal chain to achieve RCE. The technical barrier is low-the payload uses standard Python object introspection techniques well-documented in SSTI literature. The automatable nature of the exploit (once an application exposes the vulnerable code path) combined with the catastrophic technical impact (arbitrary code execution, file system access, environment variable theft) makes this a genuine emergency for affected deployments. The primary risk mitigation factor is that exploitation requires the specific developer mistake of passing user input to chat() rather than using the safe with_inputs() method, potentially limiting the vulnerable application population. Organizations using giskard-agents for customer-facing chatbots or interactive AI systems face immediate risk.

Exploit ScenarioDerived

An organization deploys a customer support chatbot using giskard-agents where user messages are processed through ChatWorkflow.chat(user_message). An attacker submits a chat message containing the Jinja2 payload: {{ ''.__class__.__mro__[1].__subclasses__()[INDEX].__init__.__globals__['os'].popen('cat /etc/passwd').read() }} where INDEX is adjusted for the Python version. When the workflow processes this message, the unsandboxed Jinja2 engine traverses Python's object hierarchy to reach the os module, executes the popen() command, and returns the contents of /etc/passwd to the attacker. The attacker can then exfiltrate environment variables containing API keys, database credentials, or execute reverse shells for persistent access. Publicly available exploit code exists demonstrating the complete attack chain, requiring only minor adjustment of subclass indices across Python versions.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 27, 2026

Remote code execution in giskard-agents Python library (versions ≤0.3.3 and 1.0.x alpha) allows attackers to execute arbitrary system commands when user-controlled strings are passed to the ChatWorkflow.chat() method. The vulnerability stems from unsandboxed Jinja2 template rendering that enables class traversal exploitation via Python's object introspection. Patched in versions 0.3.4 (stable) and 1.0.2b1 (pre-release). Public exploit code exists demonstrating full RCE via Jinja2 object traversal to os.popen(). No active exploitation confirmed at time of analysis, though the straightforward attack vector and clear POC make this a critical priority for affected deployments.

RemediationAI

Organizations using giskard-agents must immediately upgrade to version 0.3.4 for stable deployments or version 1.0.2b1 for pre-release branch users. The vendor-released patches replace the unsandboxed Jinja2 Environment with SandboxedEnvironment, which blocks access to attributes beginning with underscores, preventing the __class__.__mro__ traversal chain required for exploitation. Install the patched version using pip: 'pip install --upgrade giskard-agents0.3.4' for stable or 'pip install --upgrade giskard-agents1.0.2b1' for beta users. As an interim workaround for environments where immediate patching is not feasible, audit all code calling ChatWorkflow.chat() to ensure no user-controlled data is passed directly as the message parameter. Instead, use the with_inputs() method to pass user data as template variables, which are safely rendered without template parsing. Complete remediation guidance and patch details are available in the GitHub Security Advisory at https://github.com/Giskard-AI/giskard-oss/security/advisories/GHSA-frv4-x25r-588m and the general advisory database at https://github.com/advisories/GHSA-frv4-x25r-588m.

Affected Packages

pypi giskard-agents fix: 0.3.4, 1.0.2b1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability resides in the giskard-agents library's ChatWorkflow implementation, specifically in the message handling pipeline. When a developer calls ChatWorkflow.chat() with a string argument, the code automatically wraps it in a MessageTemplate object where the string becomes the content_template attribute. During rendering, this template is parsed using Jinja2's Environment.from_string() method without sandboxing protections. The affected component uses a standard Jinja2 Environment with autoescape=False instead of SandboxedEnvironment. This maps to CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine), a server-side template injection vulnerability class. In Python's Jinja2, unsandboxed templates allow access to the object model through dunder methods like __class__ and __mro__, enabling traversal to dangerous built-in classes. Attackers can reach subprocess management classes through the method resolution order chain, ultimately accessing os.popen() or similar execution primitives. The package identifier pkg:pip/giskard-agents confirms this affects the Python PyPI distribution of the giskard-agents library, a component designed for building AI agent workflows with large language models.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/Giskard-AI/giskard-oss) PRIMARY 7.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/Giskard-AI/giskard-oss) · only source for this CVE.

CVSS VectorVendor: https://github.com/Giskard-AI/giskard-oss

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch released
Mar 31, 2026 - 21:13 nvd
Patch available
CVE Published
Mar 27, 2026 - 22:17 nvd
HIGH 7.7

DescriptionCVE.org

Summary

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:

python
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:

python
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:

python
_inline_env = Environment(
    autoescape=False,
# Not SandboxedEnvironment
)

Proof of Concept

python
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:

python
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().

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).

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.

Executive ViewAI

Why It Matters

The giskard-agents Python library (versions ≤0.3.3 and 1.0.x alpha) contains a remote code execution vulnerability in the ChatWorkflow.chat() method that allows attackers to execute arbitrary system commands through unvalidated template input. Organizations using this library in production risk complete system compromise if user-controlled data reaches the affected method. Immediate patching to versions 0.3.4 or 1.0.2b1 is required to eliminate this attack surface.

Business Impact: Severe
Compensating Controls

Vendor-released patch: versions 0.3.4 (stable) and 1.0.2b1 (pre-release). If immediate patching is blocked, implement strict input validation on all data passed to ChatWorkflow.chat() method and restrict library functionality to trusted internal users only; however, these mitigations are insufficient for production use-patching is mandatory.

Threat Intelligence Overview

EPSS Score
0.4%
Top 39% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
Very High
Technical Impact
Total

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

pkg:pip/giskard-agents
pkg:pip/giskard-agents

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy