Eval Injection Affecting django-haystack package, versions [2.0.0,3.4.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Eval Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-DJANGOHAYSTACK-18016323
  • published19 Jul 2026
  • disclosed15 Jul 2026
  • creditUnknown

Introduced: 15 Jul 2026

CVE NOT AVAILABLE CWE-95  (opens in a new tab)

How to fix?

Upgrade django-haystack to version 3.4.0 or higher.

Overview

Affected versions of this package are vulnerable to Eval Injection through ElasticsearchSearchBackend._to_python in haystack/backends/elasticsearch_backend.py. An attacker can execute arbitrary Python code by supplying Elasticsearch result field values that are deserialized by eval() during search result processing. When a search returns attacker-controlled content, the backend evaluates the raw string value in the Django application process instead of treating it as data. This can let an attacker run shell commands with the web server’s privileges, compromising the application host.

CVSS Base Scores

version 4.0
version 3.1