CVE-2026-105315 django-haystack more_like_this Template Tag elasticsearch_backend.py _to_python eval injection

Medium 5.1 Published Updated

Remote attackers can execute arbitrary code via the more_like_this template tag in django-haystack due to unsafe evaluation of the result_class argument.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2026-105315?

CVE-2026-105315 is a medium-severity code injection vulnerability in django-haystack, published on 5 Oct 2026. An attacker needs administrator access to exploit it, with no action from the victim.

Official description

A vulnerability has been found in django-haystack up to 3.3.0. Affected is the function _to_python of the file haystack/backends/elasticsearch_backend.py of the component more_like_this Template Tag Handler. Such manipulation of the argument result_class leads to improper neutralization of directives in dynamically evaluated code. The attack can be launched remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 3.4.0 is able to address this issue. The name of the patch is eb05f193c9771a68dcc8cfac6674a0d48a52ee9d. It is suggested to upgrade the affected component.

Weakness: CWE-95, CWE-94

Which versions are affected by CVE-2026-105315?

2 open source packages ship an affected version, including django-haystack.

PackageAffectedFixed in
django-haystack PyPIAll versions3.4.0
django-haystack PyPIAll versions3.4.0

How do I fix CVE-2026-105315?

Upgrade django-haystack to 3.4.0 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-105315 being exploited?

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

Sources

Also known as DEBIAN-CVE-2026-105315, GHSA-5x9v-pqqg-p8jg, GHSA-r3hx-x5rh-p9vv, UBUNTU-CVE-2026-105315.

Is CVE-2026-105315 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free