Eval injection in django-haystack more_like_this template tag
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Code execution
- Confidentiality · integrity · availability
- Low · Low · Low
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-94.
Summary
django-haystack versions from 3.0 before 3.4.0 are affected. The _to_python function in the Elasticsearch backend does not neutralize directives in code it evaluates, so the result_class argument of the more_like_this template tag can inject code (CWE-95). A remote attacker with high privileges can exploit this, and a public exploit is referenced.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | django-haystack | 3.0; 3.1; 3.2; 3.3.0 | 3.4.0 | Patch available | CNA |
- django-haystack Vendor— Affected 3.0; 3.1; 3.2; 3.3.0 Fixed in 3.4.0 Patch available CNA
CPE names CNA · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:django-haystack:django-haystack:*:*:*:*:*:*:*:* | — | — | — |
- cpe:2.3:a:django-haystack:django-haystack:*:*:*:*:*:*:*:* Versions — — ·—
Remediation
Upgrade django-haystack to version 3.4.0, which fixes this issue (patch eb05f193c9771a68dcc8cfac6674a0d48a52ee9d).
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
- Fix · CNA django-haystack Fixed in 3.4.0
Vendor assessments
Timeline
- 2026-10-05 Threatist record created from CVE-2026-105315
- 2026-10-05 Alias added: GHSA-5x9v-pqqg-p8jg
- 2026-10-06 Affected versions changed · Red Hat
- 2026-10-06 CVSS score added · Red Hat
References
Patch 2
Sources
- CVE-2026-105315 · CVE Program
- CVE-2026-105315 · NVD
- FIRST EPSS
- GHSA-5x9v-pqqg-p8jg · GitHub Advisory Database · CC BY 4.0
- CVE-2026-105315 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences