Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
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 applicationsUpgrade django-haystack to version 3.4.0 or higher.
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.