# CVE-2026-34172: Giskard Agents have Server-side template injection via ChatWorkflow.chat() using non-sandboxed Jinja2 Environment

> Attackers can achieve remote code execution by passing malicious input to ChatWorkflow.chat() due to unsafe Jinja2 template rendering.

- **Severity:** High 7.7 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Mar 2026
- **Updated:** 31 Mar 2026
- **Also known as:** GHSA-frv4-x25r-588m, PYSEC-2026-2487

## What is CVE-2026-34172?

CVE-2026-34172 is a high-severity code injection vulnerability in Giskard-AI giskard-oss, published on 31 Mar 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Giskard is an open-source Python library for testing and evaluating agentic systems. Prior to versions 0.3.4 and 1.0.2b1, 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. This issue has been patched in versions 0.3.4 and 1.0.2b1.

Weakness: CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine)

## Which versions are affected by CVE-2026-34172?

5 open source packages ship an affected version, including giskard-agents. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `giskard-agents` | PyPI | All versions | 0.3.4, 1.0.2b1 |
| `giskard-agents` | PyPI | All versions | 0.3.4 |
| `giskard-agents` | PyPI | All versions | 0.3.4 |
| `giskard-agents` | PyPI | From 1.0.1a1 | 1.0.2b1 |
| `giskard-agents` | PyPI | From 1.0.1a1 | 1.0.2b1 |

Products: Giskard Giskard-Agent, Giskard Giskard-Agents.

## How do I fix CVE-2026-34172?

Upgrade giskard-agents to a fixed version for your release line: 0.3.4 or 1.0.2b1.

## Is CVE-2026-34172 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-34172 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-34172 and fix it if it is affected.

What it is: CVE-2026-34172 is a high-severity code injection vulnerability in Giskard-AI giskard-oss, published on 31 Mar 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-34172 exists.

Affected packages and fixed versions:
- giskard-agents (PyPI): affected all versions; fixed in 0.3.4, 1.0.2b1
- giskard-agents (PyPI): affected all versions; fixed in 0.3.4
- giskard-agents (PyPI): affected all versions; fixed in 0.3.4
- giskard-agents (PyPI): affected from 1.0.1a1; fixed in 1.0.2b1
- giskard-agents (PyPI): affected from 1.0.1a1; fixed in 1.0.2b1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-34172/ (Markdown: https://insights.sbomify.com/CVE-2026-34172/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-34172
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-34172
- OSV: https://osv.dev/vulnerability/CVE-2026-34172

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-34172/
Summaries are generated and may contain mistakes; the official description above is the record.
