Skip to content
Fencer Vulns
medium 5.4

CVE-2024-22195 json

Jinja vulnerable to Cross-Site Scripting (XSS)

published 2024-01-11 2 y ago modified 2026-09-10 1 mo ago also GHSA-h5c8-rqwp-cp95 , PYSEC-2026-1473 , EUVD-2024-0365

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

Summary

Jinja is an extensible templating engine. Special placeholders in the template allow writing code similar to Python syntax. It is possible to inject arbitrary HTML attributes into the rendered HTML template, potentially leading to Cross-Site Scripting (XSS). The Jinja `xmlattr` filter can be abused to inject arbitrary HTML attribute keys and values, bypassing the auto escaping mechanism and potentially leading to XSS. It may also be possible to bypass attribute validation checks if they are blacklist-based.

Patch / fix

  • pypi jinja2 3.1.3
  • palletsprojects jinja 3.1.3
  • jinja2 Debian 12 3.1.2-1+deb12u1
  • jinja2 Debian 14, Debian 13 3.1.3-1

debian advisories DEBIAN-CVE-2024-22195

  • jinja2 Ubuntu 20.04 LTS 2.10.1-2ubuntu0.2
  • jinja2 Ubuntu 22.04 LTS 3.0.3-1ubuntu0.1
  • jinja2 Ubuntu 24.04 LTS 3.1.2-1ubuntu1
  • jinja2 Ubuntu Pro 14.04 LTS 2.7.2-2ubuntu0.1~esm2
  • jinja2 Ubuntu Pro 16.04 LTS 2.8-1ubuntu0.1+esm2
  • jinja2 Ubuntu Pro 18.04 LTS 2.10-1ubuntu0.18.04.1+esm1

ubuntu advisories UBUNTU-CVE-2024-22195

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

  • fence-agents RHEL 9 4.10.0-55.el9_3.3
  • fence-virt RHEL 9 4.10.0-55.el9_3.3
  • fence-virtd RHEL 9 4.10.0-55.el9_3.3
  • fence-virtd-cpg RHEL 9 4.10.0-55.el9_3.3
  • fence-virtd-tcp RHEL 9 4.10.0-55.el9_3.3
  • fence-agents-all RHEL 9 4.10.0-55.el9_3.3
  • fence-agents-apc RHEL 9 4.10.0-55.el9_3.3
  • fence-agents-aws RHEL 9 4.10.0-55.el9_3.3

red hat advisories RHBA-2024:1416RHBA-2024:1137RHBA-2024:1398RHBA-2024:1114RHBA-2024:0891RHBA-2024:1091

  • grafana Multi Linux Manager Tools SLE-15 12.4.10-150002.4.27.1
  • mgr-push Multi Linux Manager Tools SLE-15 5.2.5-150002.3.12.1
  • spacecmd Multi Linux Manager Tools SLE-15 5.2.10-150002.3.15.1
  • uyuni-tools Multi Linux Manager Tools SLE-Micro-5, Multi Linux Manager Tools SLE-15 5.2.17-150002.3.20.1
  • venv-salt-minion Multi Linux Manager Tools SLE-Micro-5, Multi Linux Manager Tools SLE-15 3006.0-150002.5.22.1
  • spacewalk-client-tools Multi Linux Manager Tools SLE-15 5.2.7-150002.3.12.1
  • golang-github-prometheus-prometheus Multi Linux Manager Tools SLE-15 3.13.2-150002.3.19.1
  • mgr-push Multi Linux Manager Tools SLE-12 5.2.5-120002.3.12.1

suse advisories SUSE-SU-2026:4585-1SUSE-SU-2026:4584-1SUSE-SU-2026:4583-1SUSE-SU-2026:4582-1SUSE-SU-2026:4581-1SUSE-SU-2026:4580-1

  • python-Jinja2 openSUSE Tumbleweed 3.1.6-2.4
  • python-Jinja2 openSUSE Tumbleweed 3.1.3-1.1

opensuse advisories openSUSE-SU-2026:11992-1openSUSE-SU-2024:13581-1

  • fence-agents-all AlmaLinux 8 4.2.1-129.el8
  • fence-agents-apc AlmaLinux 8 4.2.1-129.el8
  • fence-agents-aws AlmaLinux 8 4.2.1-129.el8
  • fence-agents-eps AlmaLinux 8 4.2.1-129.el8
  • fence-agents-gce AlmaLinux 8 4.2.1-129.el8
  • fence-agents-rsa AlmaLinux 8 4.2.1-129.el8
  • fence-agents-rsb AlmaLinux 8 4.2.1-129.el8
  • fence-agents-sbd AlmaLinux 8 4.2.1-129.el8

almalinux advisories ALSA-2024:2968ALSA-2024:2987ALSA-2024:3102ALSA-2024:2132ALSA-2024:2348

  • pytz Rocky Linux 8 2017.2-13.module+el8.10.0+1817+0b01df83
  • babel Rocky Linux 8 2.5.1-10.module+el8.9.0+1531+a18208f5
  • numpy Rocky Linux 8 1:1.14.2-16.module+el8.9.0+1531+a18208f5
  • scipy Rocky Linux 8 1.0.0-22.module+el8.10.0+1817+0b01df83
  • Cython Rocky Linux 8 0.28.1-7.module+el8.9.0+1531+a18208f5
  • pytest Rocky Linux 8 3.4.2-13.module+el8.9.0+1531+a18208f5
  • PyYAML Rocky Linux 8 3.12-16.module+el8.9.0+1531+a18208f5
  • python2 Rocky Linux 8 2.7.18-17.module+el8.10.0+1813+4b021305.rocky.0.2

rocky linux advisories RLSA-2024:2987RLSA-2024:2968RLSA-2024:3102

  • py3-jinja2 Alpine 3.19, Alpine 3.18, Alpine 3.17 3.1.4-r0
  • py3-jinja2 Alpine 3.24, Alpine 3.23, Alpine 3.22 +2 more 3.1.3-r0

alpine advisories ALPINE-CVE-2024-22195

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-3
  • nodejs18 CBL-Mariner 2.0 18.20.3-3
  • nodejs Azure Linux 3.0 20.14.0-1
  • python-jinja2 Azure Linux 3.0 3.1.2-2

azure linux advisories AZL-33320AZL-33349AZL-35050AZL-35134

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-22195 updated cvss 5.4

jinja2: HTML attribute injection when passing user input as keys to xmlattr filter

  • Red Hat Ansible Automation Platform 1.2 ansible-tower Red Hat Ceph Storage 5 cephadm-ansible
    affected: workaround, no fix planned “Out of support scope”
  • Red Hat Ceph Storage 6 cephadm-ansible
    affected: workaround, no fix planned “Will not fix”
  • Red Hat Enterprise Linux 6 python-jinja2 Red Hat Enterprise Linux 7 python-jinja2
    affected: workaround, no fix planned “Out of support scope”
  • Red Hat Quay 3 quay/quay-rhel8
    affected: workaround, no fix available
  • Red Hat Satellite 6 python-jinja2, python2-jinja2, tfm-pulpcore-python-jinja2
    affected: workaround, no fix available, no fix planned “Will not fix”
  • Red Hat Software Collections rh-python38-python-jinja2
    affected: workaround, no fix planned “Will not fix”
  • Red Hat Storage 3 gdeploy
    affected: workaround, no fix planned “Out of support scope”
  • Red Hat Ansible Automation Platform 2.4 for RHEL 8 python39-jinja2 3.1.3-1.el8ap, python3x-jinja2 3.1.3-1.el8ap, automation-controller-venv-tower 4.5.5-2.el8ap Red Hat Ansible Automation Platform 2.4 for RHEL 9 python-jinja2 3.1.3-1.el9ap, python3-jinja2 3.1.3-1.el9ap, automation-controller-venv-tower 4.5.5-2.el9ap
    fixed: vendor fix RHSA-2024:1057
show 27 more
  • Red Hat Ceph Storage 7.1 Tools rhceph/rhceph-7-rhel9 7-385, rhceph/grafana-rhel9 10.4.0-9, rhceph/keepalived-rhel9 2.2.8-20, rhceph/ceph-nvmeof-rhel9 1.2.13-4, rhceph/snmp-notifier-rhel9 1.2.1-67, rhceph/ceph-nvmeof-cli-rhel9 1.2.13-4, +2 more
    fixed: vendor fix RHSA-2024:3927
  • Red Hat Enterprise Linux AppStream (v. 8) fence-agents 4.2.1-129.el8, python-jinja2 2.10.1-4.el8, python3-jinja2 2.10.1-4.el8, fence-agents 4.2.1-121.el8_9.4, fence-agents-all 4.2.1-129.el8, fence-agents-apc 4.2.1-129.el8, +171 more
    fixed: vendor fix RHSA-2024:2987
  • Red Hat Enterprise Linux AppStream (v. 9) fence-virt 4.10.0-62.el9, fence-virtd 4.10.0-62.el9, fence-agents 4.10.0-62.el9, python-jinja2 2.11.3-5.el9, python3-jinja2 2.11.3-5.el9, fence-virt 4.10.0-55.el9_3.3, +24 more
    fixed: vendor fix RHBA-2024:1137
  • Red Hat Enterprise Linux AppStream AUS (v.8.4) fence-agents 4.2.1-65.el8_4.14, fence-agents-all 4.2.1-65.el8_4.14, fence-agents-apc 4.2.1-65.el8_4.14, fence-agents-eps 4.2.1-65.el8_4.14, fence-agents-rsa 4.2.1-65.el8_4.14, fence-agents-rsb 4.2.1-65.el8_4.14, +36 more Red Hat Enterprise Linux AppStream E4S (v.8.4) fence-agents 4.2.1-65.el8_4.14, fence-agents-all 4.2.1-65.el8_4.14, fence-agents-apc 4.2.1-65.el8_4.14, fence-agents-eps 4.2.1-65.el8_4.14, fence-agents-rsa 4.2.1-65.el8_4.14, fence-agents-rsb 4.2.1-65.el8_4.14, +36 more
    fixed: vendor fix RHBA-2024:1398
  • Red Hat Enterprise Linux AppStream EUS (v.8.6) fence-agents 4.2.1-89.el8_6.11, fence-agents-all 4.2.1-89.el8_6.11, fence-agents-apc 4.2.1-89.el8_6.11, fence-agents-eps 4.2.1-89.el8_6.11, fence-agents-rsa 4.2.1-89.el8_6.11, fence-agents-rsb 4.2.1-89.el8_6.11, +37 more
    fixed: vendor fix RHBA-2024:1114
  • Red Hat Enterprise Linux AppStream EUS (v.8.8) fence-agents 4.2.1-112.el8_8.3, fence-agents-all 4.2.1-112.el8_8.3, fence-agents-apc 4.2.1-112.el8_8.3, fence-agents-eps 4.2.1-112.el8_8.3, fence-agents-rsa 4.2.1-112.el8_8.3, fence-agents-rsb 4.2.1-112.el8_8.3, +37 more
    fixed: vendor fix RHBA-2024:1416
  • Red Hat Enterprise Linux AppStream EUS (v.9.0) fence-virt 4.10.0-20.el9_0.11, fence-virtd 4.10.0-20.el9_0.11, fence-agents 4.10.0-20.el9_0.11, fence-virtd-cpg 4.10.0-20.el9_0.11, fence-virtd-tcp 4.10.0-20.el9_0.11, fence-agents-virsh 4.10.0-20.el9_0.11, +9 more
    fixed: vendor fix RHSA-2024:1155
  • Red Hat Enterprise Linux AppStream EUS (v.9.2) fence-virt 4.10.0-43.el9_2.3, fence-virtd 4.10.0-43.el9_2.3, fence-agents 4.10.0-43.el9_2.3, fence-virtd-cpg 4.10.0-43.el9_2.3, fence-virtd-tcp 4.10.0-43.el9_2.3, fence-agents-virsh 4.10.0-43.el9_2.3, +8 more
    fixed: vendor fix RHBA-2024:1091
  • Red Hat Enterprise Linux AppStream TUS (v.8.4) fence-agents 4.2.1-65.el8_4.14, fence-agents-all 4.2.1-65.el8_4.14, fence-agents-apc 4.2.1-65.el8_4.14, fence-agents-eps 4.2.1-65.el8_4.14, fence-agents-rsa 4.2.1-65.el8_4.14, fence-agents-rsb 4.2.1-65.el8_4.14, +36 more
    fixed: vendor fix RHBA-2024:1398
  • Red Hat Enterprise Linux High Availability (v. 8) fence-agents-aws 4.2.1-121.el8_9.4, fence-agents-gce 4.2.1-121.el8_9.4, fence-agents-aliyun 4.2.1-121.el8_9.4, fence-agents-azure-arm 4.2.1-121.el8_9.4, fence-agents-openstack 4.2.1-121.el8_9.4
    fixed: vendor fix RHBA-2024:0891
  • Red Hat Enterprise Linux High Availability (v. 9) fence-agents-all 4.10.0-55.el9_3.3, fence-agents-apc 4.10.0-55.el9_3.3, fence-agents-aws 4.10.0-55.el9_3.3, fence-agents-eps 4.10.0-55.el9_3.3, fence-agents-gce 4.10.0-55.el9_3.3, fence-agents-rsa 4.10.0-55.el9_3.3, +36 more
    fixed: vendor fix RHBA-2024:1137
  • Red Hat Enterprise Linux High Availability AUS (v.8.4) fence-agents-aws 4.2.1-65.el8_4.14, fence-agents-gce 4.2.1-65.el8_4.14, fence-agents-aliyun 4.2.1-65.el8_4.14, fence-agents-azure-arm 4.2.1-65.el8_4.14
    fixed: vendor fix RHBA-2024:1398
  • Red Hat Enterprise Linux High Availability EUS (v.8.6) fence-agents-aws 4.2.1-89.el8_6.11, fence-agents-gce 4.2.1-89.el8_6.11, fence-agents-aliyun 4.2.1-89.el8_6.11, fence-agents-azure-arm 4.2.1-89.el8_6.11
    fixed: vendor fix RHBA-2024:1114
  • Red Hat Enterprise Linux High Availability EUS (v.8.8) fence-agents-aws 4.2.1-112.el8_8.3, fence-agents-gce 4.2.1-112.el8_8.3, fence-agents-aliyun 4.2.1-112.el8_8.3, fence-agents-azure-arm 4.2.1-112.el8_8.3, fence-agents-openstack 4.2.1-112.el8_8.3
    fixed: vendor fix RHBA-2024:1416
  • Red Hat Enterprise Linux High Availability EUS (v.9.0) fence-agents-all 4.10.0-20.el9_0.11, fence-agents-apc 4.10.0-20.el9_0.11, fence-agents-aws 4.10.0-20.el9_0.11, fence-agents-eps 4.10.0-20.el9_0.11, fence-agents-gce 4.10.0-20.el9_0.11, fence-agents-rsa 4.10.0-20.el9_0.11, +36 more
    fixed: vendor fix RHSA-2024:1155
  • Red Hat Enterprise Linux High Availability EUS (v.9.2) fence-agents-all 4.10.0-43.el9_2.3, fence-agents-apc 4.10.0-43.el9_2.3, fence-agents-aws 4.10.0-43.el9_2.3, fence-agents-eps 4.10.0-43.el9_2.3, fence-agents-gce 4.10.0-43.el9_2.3, fence-agents-rsa 4.10.0-43.el9_2.3, +36 more
    fixed: vendor fix RHBA-2024:1091
  • Red Hat Enterprise Linux HighAvailability (v. 8) fence-agents-aws 4.2.1-129.el8, fence-agents-gce 4.2.1-129.el8, fence-agents-aliyun 4.2.1-129.el8, fence-agents-azure-arm 4.2.1-129.el8, fence-agents-openstack 4.2.1-129.el8
    fixed: vendor fix RHSA-2024:2968
  • Red Hat Enterprise Linux HighAvailability (v. 9) fence-agents-all 4.10.0-62.el9, fence-agents-apc 4.10.0-62.el9, fence-agents-aws 4.10.0-62.el9, fence-agents-eps 4.10.0-62.el9, fence-agents-gce 4.10.0-62.el9, fence-agents-rsa 4.10.0-62.el9, +36 more
    fixed: vendor fix RHSA-2024:2132
  • Red Hat Enterprise Linux HighAvailability E4S (v.8.4) fence-agents-aws 4.2.1-65.el8_4.14, fence-agents-gce 4.2.1-65.el8_4.14, fence-agents-aliyun 4.2.1-65.el8_4.14, fence-agents-azure-arm 4.2.1-65.el8_4.14 Red Hat Enterprise Linux HighAvailability TUS (v.8.4) fence-agents-aws 4.2.1-65.el8_4.14, fence-agents-gce 4.2.1-65.el8_4.14, fence-agents-aliyun 4.2.1-65.el8_4.14, fence-agents-azure-arm 4.2.1-65.el8_4.14
    fixed: vendor fix RHBA-2024:1398
  • Red Hat Enterprise Linux Resilient Storage (v. 8) fence-agents-aws 4.2.1-121.el8_9.4, fence-agents-gce 4.2.1-121.el8_9.4, fence-agents-aliyun 4.2.1-121.el8_9.4, fence-agents-azure-arm 4.2.1-121.el8_9.4, fence-agents-openstack 4.2.1-121.el8_9.4
    fixed: vendor fix RHBA-2024:0891
  • Red Hat Enterprise Linux Resilient Storage (v. 9) fence-agents-all 4.10.0-55.el9_3.3, fence-agents-apc 4.10.0-55.el9_3.3, fence-agents-aws 4.10.0-55.el9_3.3, fence-agents-eps 4.10.0-55.el9_3.3, fence-agents-gce 4.10.0-55.el9_3.3, fence-agents-rsa 4.10.0-55.el9_3.3, +36 more
    fixed: vendor fix RHBA-2024:1137
  • Red Hat Enterprise Linux Resilient Storage EUS (v.8.6) fence-agents-aws 4.2.1-89.el8_6.11, fence-agents-gce 4.2.1-89.el8_6.11, fence-agents-aliyun 4.2.1-89.el8_6.11, fence-agents-azure-arm 4.2.1-89.el8_6.11
    fixed: vendor fix RHBA-2024:1114
  • Red Hat Enterprise Linux Resilient Storage EUS (v.8.8) fence-agents-aws 4.2.1-112.el8_8.3, fence-agents-gce 4.2.1-112.el8_8.3, fence-agents-aliyun 4.2.1-112.el8_8.3, fence-agents-azure-arm 4.2.1-112.el8_8.3, fence-agents-openstack 4.2.1-112.el8_8.3
    fixed: vendor fix RHBA-2024:1416
  • Red Hat Enterprise Linux Resilient Storage EUS (v.9.0) fence-agents-all 4.10.0-20.el9_0.11, fence-agents-apc 4.10.0-20.el9_0.11, fence-agents-aws 4.10.0-20.el9_0.11, fence-agents-eps 4.10.0-20.el9_0.11, fence-agents-gce 4.10.0-20.el9_0.11, fence-agents-rsa 4.10.0-20.el9_0.11, +36 more
    fixed: vendor fix RHSA-2024:1155
  • Red Hat Enterprise Linux Resilient Storage EUS (v.9.2) fence-agents-all 4.10.0-43.el9_2.3, fence-agents-apc 4.10.0-43.el9_2.3, fence-agents-aws 4.10.0-43.el9_2.3, fence-agents-eps 4.10.0-43.el9_2.3, fence-agents-gce 4.10.0-43.el9_2.3, fence-agents-rsa 4.10.0-43.el9_2.3, +36 more
    fixed: vendor fix RHBA-2024:1091
  • Red Hat Enterprise Linux ResilientStorage (v. 8) fence-agents-aws 4.2.1-129.el8, fence-agents-gce 4.2.1-129.el8, fence-agents-aliyun 4.2.1-129.el8, fence-agents-azure-arm 4.2.1-129.el8, fence-agents-openstack 4.2.1-129.el8
    fixed: vendor fix RHSA-2024:2968
  • Red Hat Enterprise Linux ResilientStorage (v. 9) fence-agents-all 4.10.0-62.el9, fence-agents-apc 4.10.0-62.el9, fence-agents-aws 4.10.0-62.el9, fence-agents-eps 4.10.0-62.el9, fence-agents-gce 4.10.0-62.el9, fence-agents-rsa 4.10.0-62.el9, +36 more
    fixed: vendor fix RHSA-2024:2132

4 more fixed, 12 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
partial
Assessed
2 y ago

Exploit prediction

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

CVSS scores

assigned by version score vector
CNA 3.1 5.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
NVD 3.1 6.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
GitHub 3.1 5.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
OSV 3.1 5.4 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Affected packages

ecosystem package affected fixed in
pypi jinja2
<3.1.3
3.1.3

Affected products

  • pallets jinja

Classification

Weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation

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.