Skip to content
Fencer Vulns
high 7.8

CVE-2024-56326 json

Jinja has a sandbox breakout through indirect reference to format method

published 2024-12-23 22 mo ago modified 2026-09-10 1 mo ago also EUVD-2024-3607 , GHSA-q2x7-8rv6-6q7h , PYSEC-2026-1475

cvss
7.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.5%
EPSS 0.5% chance of exploitation in 30 days, percentile 44%
public exploits
0
none known

Summary

Jinja is an extensible templating engine. Prior to 3.1.5, An oversight in how the Jinja sandboxed environment detects calls to str.format allows an attacker that controls the content of a template to execute arbitrary Python code. To exploit the vulnerability, an attacker needs to control the content of a template. Whether that is the case depends on the type of application using Jinja. This vulnerability impacts users of applications which execute untrusted templates. Jinja's sandbox does catch calls to str.format and ensures they don't escape the sandbox. However, it's possible to store a reference to a malicious string's format method, then pass that to a filter that calls it. No such filters are built-in to Jinja, but could be present through custom filters in an application. After the fix, such indirect calls are also handled by the sandbox. This vulnerability is fixed in 3.1.5.

Patch / fix

  • pypi jinja2 3.1.5
  • palletsprojects jinja 3.1.5
  • pocoo jinja2 3.1.5
  • jinja2 Debian 12 3.1.2-1+deb12u2
  • jinja2 Debian 14, Debian 13 3.1.5-1

debian advisories DEBIAN-CVE-2024-56326

  • jinja2 Ubuntu 20.04 LTS 2.10.1-2ubuntu0.4
  • jinja2 Ubuntu 22.04 LTS 3.0.3-1ubuntu0.3
  • jinja2 Ubuntu 24.04 LTS 3.1.2-1ubuntu1.2
  • jinja2 Ubuntu Pro 14.04 LTS 2.7.2-2ubuntu0.1~esm6
  • jinja2 Ubuntu Pro 16.04 LTS 2.8-1ubuntu0.1+esm5
  • jinja2 Ubuntu Pro 18.04 LTS 2.10-1ubuntu0.18.04.1+esm3

ubuntu advisories UBUNTU-CVE-2024-56326

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • rubygem-rack satellite capsule 6.17, satellite 6.17 2.2.13-1.el9sat
  • python-django satellite capsule 6.17, satellite 6.17 4.2.19-1.el9pc
  • python-jinja2 satellite capsule 6.17, satellite 6.17 3.1.5-1.el9pc
  • rubygem-graphql satellite 6.17 1.13.24-1.el9sat
  • python3.11-django satellite capsule 6.17, satellite 6.17 4.2.19-1.el9pc
  • python3.11-jinja2 satellite capsule 6.17, satellite 6.17 3.1.5-1.el9pc
  • foreman satellite utils 6.16, satellite capsule 6.16, satellite 6.16 3.12.0.6-1.el8sat
  • foreman satellite utils 6.16, satellite capsule 6.16, satellite 6.16 3.12.0.6-1.el9sat

red hat advisories RHSA-2025:4576RHSA-2025:2612RHSA-2025:2399RHSA-2025:1861RHSA-2025:1118RHSA-2025:1130

  • python-Jinja2 Linux Micro 6.1 3.1.4-slfo.1.1_2.1
  • python-Jinja2 Linux Micro 6.0 3.1.2-7.1
  • python-Jinja2 SLES for SAP 15 SP5, SLES for SAP 15 SP4, SLES for SAP 15 SP3 +19 more 2.10.1-150000.3.18.1
  • python-Jinja2 SLE Module for Public Cloud 12, Manager Client Tools 12 2.8-19.31.1
  • python-Jinja2 SLES for SAP 15 SP5, SLES for SAP 15 SP4, SLES 15 SP5-LTSS +9 more 3.1.2-150400.12.11.1

suse advisories SUSE-SU-2025:20254-1SUSE-SU-2025:20117-1SUSE-SU-2025:0029-1SUSE-SU-2025:0016-1SUSE-SU-2025:0006-1

  • oci-cli openSUSE Tumbleweed 3.54.1-1.1

opensuse advisories openSUSE-SU-2025:14997-1

  • python3-jinja2 AlmaLinux 8 2.10.1-6.el8_10
  • python3-jinja2 AlmaLinux 9 2.11.3-7.el9_5
  • fence-virt AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
  • fence-virtd AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
  • fence-virtd-cpg AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
  • fence-virtd-tcp AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
  • fence-agents-virsh AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
  • fence-virtd-serial AlmaLinux 9 4.10.0-76.el9_5.4.alma.1

almalinux advisories ALSA-2025:0711ALSA-2025:0667ALSA-2025:0308

  • fence-agents Rocky Linux 9 4.10.0-76.el9_5.4
  • python-jinja2 Rocky Linux 9 2.11.3-7.el9_5
  • python-jinja2 Rocky Linux 8 2.10.1-6.el8_10

rocky linux advisories RLSA-2025:0308RLSA-2025:0667RLSA-2025:0711

  • py3-jinja2 Alpine 3.24, Alpine 3.23, Alpine 3.22 +4 more 3.1.5-r0

alpine advisories ALPINE-CVE-2024-56326

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • python-jinja2 CBL-Mariner 2.0 3.0.3-5
  • python-jinja2 Azure Linux 3.0 3.1.2-2

azure linux advisories AZL-54647AZL-54654

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2024-56326 updated cvss 6.3

jinja2: Jinja has a sandbox breakout through indirect reference to format method

  • Red Hat OpenShift Lightspeed lightspeed-service-api-rhel9
    affected: workaround, no fix available
  • Red Hat Ansible Automation Platform 2 aap-cloud-metrics-collector-container Red Hat Enterprise Linux 6 python-jinja2
    affected: workaround, no fix available “Fix deferred”
  • Red Hat Enterprise Linux 9 keylime-registrar
    affected: workaround, no fix available
  • Red Hat Enterprise Linux AI (RHEL AI) bootc-amd-rhel9, bootc-intel-rhel9, bootc-nvidia-rhel9, bootc-azure-amd-rhel9, instructlab-amd-rhel9, bootc-aws-nvidia-rhel9, +5 more
    affected: workaround, no fix available “Fix deferred”
  • Red Hat OpenShift AI (RHOAI) odh-model-registry-rhel8, odh-ml-pipelines-driver-rhel8, odh-ml-pipelines-launcher-rhel8, odh-ml-pipelines-api-server-v2-rhel8, odh-ml-pipelines-persistenceagent-v2-rhel8, odh-ml-pipelines-scheduledworkflow-v2-rhel8 Red Hat OpenShift Container Platform 4 openshift4/ose-ovn-kubernetes, openshift4/ztp-site-generate-rhel8, openshift4/ose-ovn-kubernetes-microshift-rhel9
    affected: workaround, no fix available, no fix planned “Will not fix”
  • Red Hat Satellite 6 python-jinja2, python2-jinja2
    affected: workaround, no fix available
  • Red Hat Ansible Automation Platform Execution Environments ansible-automation-platform/ee-minimal-rhel8 2.17.7-3, ansible-automation-platform/ee-minimal-rhel8 2.17.8-3, ansible-automation-platform/ee-minimal-rhel8 2.18.1-3, ansible-automation-platform/ee-minimal-rhel8 2.18.2-3, ansible-automation-platform/ee-minimal-rhel9 2.17.8-4, ansible-automation-platform/ee-minimal-rhel9 2.18.1-4, +13 more
    fixed: vendor fix RHSA-2025:1101
  • Red Hat Discovery 1 for RHEL 9 discovery/discovery-ui-rhel9 1.12.0-1, discovery/discovery-server-rhel9 1.12.0-1
    fixed: vendor fix RHSA-2025:1249
show 28 more
  • Red Hat Ironic content for Red Hat OpenShift Container Platform 4.12 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2
    fixed: vendor fix RHSA-2025:0834
  • Red Hat Ironic content for Red Hat OpenShift Container Platform 4.13 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2
    fixed: vendor fix RHSA-2025:1118
  • Red Hat Ironic content for Red Hat OpenShift Container Platform 4.14 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2
    fixed: vendor fix RHSA-2025:0842
  • Red Hat Ironic content for Red Hat OpenShift Container Platform 4.15 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2
    fixed: vendor fix RHSA-2025:1130
  • Red Hat Ironic content for Red Hat OpenShift Container Platform 4.16 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2
    fixed: vendor fix RHSA-2025:0830
  • Red Hat Ironic content for Red Hat OpenShift Container Platform 4.17 python-jinja2 3.1.5-1.el9, python3-jinja2 3.1.5-1.el9, python3-jinja2+i18n 3.1.5-1.el9
    fixed: vendor fix RHSA-2025:0656
  • Red Hat Ironic content for Red Hat OpenShift Container Platform 4.18 crudini 0.9.3-4.el9, pysnmp 4.4.12-6.el9, python-ddt 1.6.0-1.el9, python-pbr 6.0.0-1.el9, python-amqp 5.0.6-1.el9, python-smi 0.3.4-10.el9, +323 more
    fixed: vendor fix RHEA-2024:6126
  • Red Hat Quay v3 quay/quay-rhel8 v3.10.8-6, quay/quay-rhel8 v3.11.8-4, quay/quay-rhel8 v3.12.7-5, quay/quay-rhel8 v3.13.3-6, quay/quay-rhel8 v3.9.10-7, quay/clair-rhel8 v3.10.8-1, +44 more
    fixed: vendor fix RHBA-2025:0250
  • Red Hat Ansible Automation Platform 2.4 for RHEL 8 python39-jinja2 3.1.5-1.el8ap, python3x-jinja2 3.1.5-1.el8ap, automation-controller-venv-tower 4.5.17-1.el8ap, ansible-automation-platform-24/lightspeed-rhel8-operator 2.4-33 Red Hat Ansible Automation Platform 2.4 for RHEL 9 python-jinja2 3.1.5-1.el9ap, python3-jinja2 3.1.5-1.el9ap, automation-controller-venv-tower 4.5.17-1.el9ap
    fixed: vendor fix RHSA-2025:0721
  • Red Hat Ansible Automation Platform 2.5 for RHEL 8 python3.11-jinja2 3.1.5-1.el8ap, automation-controller-venv-tower 4.6.7-1.el8ap, ansible-automation-platform-25/lightspeed-rhel8 2.5.250107-1 Red Hat Ansible Automation Platform 2.5 for RHEL 9 python3.11-jinja2 3.1.5-1.el9ap, automation-controller-venv-tower 4.6.7-1.el9ap
    fixed: vendor fix RHSA-2025:0777
  • Red Hat Developer Hub (RHDH) 1.4 rhdh 1.4-1737055846
    fixed: vendor fix RHBA-2025:0409
  • Red Hat Developer Hub 1.5 rhdh
    fixed: vendor fix RHSA-2025:3374
  • Red Hat Enterprise Linux AppStream (v. 8) python-jinja2 2.10.1-6.el8_10, python3-jinja2 2.10.1-6.el8_10
    fixed: vendor fix RHSA-2025:0711
  • Red Hat Enterprise Linux AppStream (v. 9) fence-virt 4.10.0-76.el9_5.4, python-jinja2 2.11.3-7.el9_5, fence-virtd 4.10.0-76.el9_5.4, python3-jinja2 2.11.3-7.el9_5, fence-agents 4.10.0-76.el9_5.4, fence-virtd-cpg 4.10.0-76.el9_5.4, +10 more
    fixed: vendor fix RHSA-2025:0308
  • Red Hat Enterprise Linux AppStream AUS (v. 8.2) python-jinja2 2.10.1-2.el8_2.3, python3-jinja2 2.10.1-2.el8_2.3
    fixed: vendor fix RHSA-2025:2612
  • Red Hat Enterprise Linux AppStream AUS (v.8.4) python-jinja2 2.10.1-2.el8_4.1, python3-jinja2 2.10.1-2.el8_4.1
    fixed: vendor fix RHSA-2025:1109
  • Red Hat Enterprise Linux AppStream AUS (v.8.6) python-jinja2 2.10.1-4.el8_6.1, python3-jinja2 2.10.1-4.el8_6.1
    fixed: vendor fix RHSA-2025:0950
  • Red Hat Enterprise Linux AppStream E4S (v.8.4) python-jinja2 2.10.1-2.el8_4.1, python3-jinja2 2.10.1-2.el8_4.1
    fixed: vendor fix RHSA-2025:1109
  • Red Hat Enterprise Linux AppStream E4S (v.8.6) python-jinja2 2.10.1-4.el8_6.1, python3-jinja2 2.10.1-4.el8_6.1
    fixed: vendor fix RHSA-2025:0950
  • Red Hat Enterprise Linux AppStream E4S (v.9.0) fence-virt 4.10.0-20.el9_0.20, fence-virtd 4.10.0-20.el9_0.20, python-jinja2 2.11.3-4.el9_0.1, fence-agents 4.10.0-20.el9_0.20, python3-jinja2 2.11.3-4.el9_0.1, fence-virtd-cpg 4.10.0-20.el9_0.20, +11 more
    fixed: vendor fix RHSA-2025:0345
  • Red Hat Enterprise Linux AppStream EUS (v.8.8) python-jinja2 2.10.1-4.el8_8.1, python3-jinja2 2.10.1-4.el8_8.1
    fixed: vendor fix RHSA-2025:0883
  • Red Hat Enterprise Linux AppStream EUS (v.9.2) fence-virt 4.10.0-43.el9_2.11, fence-virtd 4.10.0-43.el9_2.11, python-jinja2 2.11.3-4.el9_2.1, fence-agents 4.10.0-43.el9_2.11, python3-jinja2 2.11.3-4.el9_2.1, fence-virtd-cpg 4.10.0-43.el9_2.11, +10 more
    fixed: vendor fix RHSA-2025:0335
  • Red Hat Enterprise Linux AppStream EUS (v.9.4) python-jinja2 2.11.3-6.el9_4, fence-virt 4.10.0-62.el9_4.10, python3-jinja2 2.11.3-6.el9_4, fence-virtd 4.10.0-62.el9_4.10, fence-agents 4.10.0-62.el9_4.10, fence-virtd-cpg 4.10.0-62.el9_4.10, +10 more
    fixed: vendor fix RHSA-2025:0338
  • Red Hat Enterprise Linux AppStream TUS (v.8.4) python-jinja2 2.10.1-2.el8_4.1, python3-jinja2 2.10.1-2.el8_4.1
    fixed: vendor fix RHSA-2025:1109
  • Red Hat Enterprise Linux AppStream TUS (v.8.6) python-jinja2 2.10.1-4.el8_6.1, python3-jinja2 2.10.1-4.el8_6.1
    fixed: vendor fix RHSA-2025:0950
  • Red Hat Enterprise Linux High Availability (v. 9) fence-agents-all 4.10.0-76.el9_5.4, fence-agents-apc 4.10.0-76.el9_5.4, fence-agents-aws 4.10.0-76.el9_5.4, fence-agents-eps 4.10.0-76.el9_5.4, fence-agents-gce 4.10.0-76.el9_5.4, fence-agents-rsa 4.10.0-76.el9_5.4, +36 more
    fixed: vendor fix RHSA-2025:0308
  • Red Hat Enterprise Linux High Availability E4S (v.9.0) fence-agents-all 4.10.0-20.el9_0.20, fence-agents-apc 4.10.0-20.el9_0.20, fence-agents-aws 4.10.0-20.el9_0.20, fence-agents-eps 4.10.0-20.el9_0.20, fence-agents-gce 4.10.0-20.el9_0.20, fence-agents-rsa 4.10.0-20.el9_0.20, +36 more
    fixed: vendor fix RHSA-2025:0345
  • Red Hat Enterprise Linux High Availability EUS (v.9.2) fence-agents-all 4.10.0-43.el9_2.11, fence-agents-apc 4.10.0-43.el9_2.11, fence-agents-aws 4.10.0-43.el9_2.11, fence-agents-eps 4.10.0-43.el9_2.11, fence-agents-gce 4.10.0-43.el9_2.11, fence-agents-rsa 4.10.0-43.el9_2.11, +36 more
    fixed: vendor fix RHSA-2025:0335

18 more fixed, 24 more not affected in the full advisory

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
22 mo ago

Exploit prediction

0.52% chance of exploitation in the next 30 days, higher than 44% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 4.0 5.4 CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
CISA ADP 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHub 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CNA 4.0 5.4 CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
CNA 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
OSV 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
pypi jinja2
<3.1.5
3.1.5

Affected products

  • pallets jinja

Classification

Weakness
  • CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine
  • CWE-693 Protection Mechanism Failure

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.

CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.