Vulnerabilities in pkg:pypi/giskard-checks

PACKAGE
Advisory Identifier: GHSA-7xjm-g8f4-rp26
Advisory Summary

CVE-2026-40320 is a MODERATE (CVSS 7.8) giskard has unsandboxed jinja2 template vulnerability (CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine) affecting Giskard checks libraries in the PyPI ecosystem. The issue involves giskard has unsandboxed jinja2 template rendering in conformitycheck. Remediation is available by upgrading affected packages to version 1.0.2b1.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/giskard-checks

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/giskard-checks. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7xjm-g8f4-rp26 CVE-2026-40320 MODERATE Giskard has Unsandboxed Jinja2 Template Rendering in ConformityCheck
GHSA-rq2q-4r55-9877 CVE-2026-40319 LOW Giskard has a Regular Expression Denial of Service (ReDoS) in RegexMatching Check

CVE-2026-40320 at a Glance

CVE Identifier CVE-2026-40320
GHSA Identifier GHSA-7xjm-g8f4-rp26
Severity MODERATE
CVSS v3.1 Base Score 7.8
CWE Classification CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
Affected Product Giskard checks
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-40320

To remediate this vulnerability, upgrade all affected Giskard checks dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

giskard-checks fixed: 1.0.2b1
pip install giskard-checks>=1.0.2b1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show giskard-checks

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-40320, inspect your installed packages using pip:

pip show giskard-checks

Analyze the terminal output to locate any version of Giskard checks in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.2b1), your application is affected.

Note: The pip show giskard-checks command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine, where the product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine. In Giskard checks, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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.

CVE-2026-40320 Affected Giskard checks Versions

1 component(s)
Fixed Versions:
1.0.2b1
Product / Package Ecosystem Affected Versions Fixed Version
giskard-checks
PyPI
< 1.0.2b1
1.0.2b1

References

Frequently Asked Questions

What is CVE-2026-40320?
CVE-2026-40320 is a security vulnerability in Giskard checks involving Giskard has Unsandboxed Jinja2 Template Rendering in ConformityCheck under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.
Which Giskard checks versions are affected?
Affected versions include releases prior to 1.0.2b1 across affected packages: giskard-checks.
What version fixes CVE-2026-40320?
Upgrading to 1.0.2b1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is giskard-checks affected?
Yes, giskard-checks is affected in releases prior to 1.0.2b1. Upgrade your dependency to 1.0.2b1 or later.
What is the CVSS score of CVE-2026-40320?
CVE-2026-40320 has a CVSS v3.1 base score of 7.8 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-40320?
CVE-2026-40320 is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine (The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.).
How can I check PyPI dependencies for CVE-2026-40320?
Run the dependency tree command: 'pip show giskard-checks'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7xjm-g8f4-rp26",
  "modified" : "2026-04-27T15:02:33Z",
  "published" : "2026-04-14T23:13:52Z",
  "aliases" : [ "CVE-2026-40320" ],
  "summary" : "Giskard has Unsandboxed Jinja2 Template Rendering in ConformityCheck",
  "details" : "## Summary\n \nThe `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.\n\n`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.\n\nHowever, 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. \n\n## Affected Component\n \n`conformity.py`, line 59:\n```python\nfrom jinja2 import Template\n...\nformatted_rule = Template(self.rule).render(trace=trace)\n```\n \n## Affected Versions\n \n`giskard-checks` < 1.0.2b1\n \n## Patched Version\n \n`giskard-checks` >= **1.0.2b1** (template parsing removed from rule evaluation entirely)\n \n## Remediation\n \nUpgrade to `giskard-checks` >= 1.0.2b1. The template rendering has been removed from rule evaluation.\n \n## Credit\n \nGiskard-AI thanks @dhabaleshwar for identifying the unsandboxed template usage.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "giskard-checks"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.2b1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.1b1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Giskard-AI/giskard-oss/security/advisories/GHSA-7xjm-g8f4-rp26"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40320"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Giskard-AI/giskard-oss"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Giskard-AI/giskard-oss/releases/tag/giskard-checks%2Fv1.0.2b1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T23:13:52Z",
    "nvd_published_at" : "2026-04-17T18:16:32Z"
  }
}