Intel

AIKIDO-2026-711956

haystack-ai is vulnerable to Remote Code Execution (RCE)

Remote Code Execution (RCE) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 6 days ago

81

High Risk

This Affects:

PYTHONhaystack-ai
2.3.1 - 3.0.0
Fixed in 3.1.0
Are you affected? Scan for Free

TL;DR

Haystack loads pipeline definitions in a default safe mode that is meant to reject dangerous callables while deserializing components. A crafted pipeline can bypass this by setting an unsafe flag on OutputAdapter or ConditionalRouter to disable the Jinja sandbox, or by registering an import primitive such as thread_safe_import as a Jinja custom filter that Jinja invokes during template compilation. It can also traverse allowlisted modules during callable resolution to reach dangerous callables and disarm the deserialization allowlist. Loading an untrusted pipeline therefore leads to arbitrary command execution; the fix blocks import primitives, rejects serialized unsafe flags in safe mode, hardens the Jinja sandbox, and validates the real module of every object during callable traversal.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you load pipeline definitions from untrusted or externally influenced sources with Pipeline.load, Pipeline.loads, or Pipeline.from_dict in default safe mode.

Background info

haystack-ai is vulnerable to Remote Code Execution (RCE) in versions 2.3.1 - 3.0.0.

How to fix this

Upgrade the haystack-ai library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform