cve.bz

CVE-2024-22195 palletsprojects jinja: Cross-site Scripting

6.1 mediumEPSS 0.9%Fix available

Medium (6.1) in palletsprojects jinja. EPSS 0.9% estimated probability of exploitation activity in the next 30 days. Fixed in jinja2 3.1.3.

On this page
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.

Severity

CVSS 3.1

6.1 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
EPSS
0.9% (unchanged from 0.9% a week ago; 0.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 60th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-01-11. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-79 Improper Neutralization of Input During Web Page Generation (Cross-site Scripting)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-22195 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-22195?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-22195?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-22195 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
palletsprojects:jinjabefore 3.1.3

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-h5c8-rqwp-cp95PyPIjinja2<3.1.33.1.3
PYSEC-2026-1473PyPIjinja2<3.1.33.1.3

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10jinja22.10-2+deb10u1DLA-3715-1
Debian11jinja22.11.3-1+deb11u1DLA-3988-1
Debian12jinja23.1.2-1+deb12u1DEBIAN-CVE-2024-22195
Debian13, 14jinja23.1.3-1DEBIAN-CVE-2024-22195
Ubuntu20.04:LTSjinja22.10.1-2ubuntu0.2UBUNTU-CVE-2024-22195 USN-6599-1
Ubuntu22.04:LTSjinja23.0.3-1ubuntu0.1UBUNTU-CVE-2024-22195 USN-6599-1
Ubuntu24.04:LTSjinja23.1.2-1ubuntu1UBUNTU-CVE-2024-22195
UbuntuPro:14.04:LTSjinja22.7.2-2ubuntu0.1~esm2UBUNTU-CVE-2024-22195 USN-6599-1
UbuntuPro:16.04:LTSjinja22.8-1ubuntu0.1+esm2UBUNTU-CVE-2024-22195 USN-6599-1
UbuntuPro:18.04:LTSjinja22.10-1ubuntu0.18.04.1+esm1UBUNTU-CVE-2024-22195 USN-6599-1
Red Hatansible_automation_platform:2.4::el8ansible-automation-platform-installer0:2.4-6.el8apRHSA-2024:1057
Red Hatansible_automation_platform:2.4::el8ansible-rulebook, automation-eda-controller, automation-eda-controller-ui and 1 more0:1.0.5-1.el8apRHSA-2024:1057
Red Hatansible_automation_platform:2.4::el8automation-controller-venv-tower0:4.5.5-2.el8apRHSA-2024:1640
Red Hatansible_automation_platform:2.4::el8python39-aiohttp, python3x-aiohttp, python39-aiohttp-debuginfo and 1 more0:3.9.1-1.el8apRHSA-2024:1057
Red Hatansible_automation_platform:2.4::el8python39-aiohttp, python3x-aiohttp, python39-aiohttp-debuginfo and 1 more0:3.9.3-1.el8apRHSA-2024:1640
Red Hatansible_automation_platform:2.4::el8python39-django, python3x-django0:4.2.10-1.el8apRHSA-2024:1057
Red Hatansible_automation_platform:2.4::el8python39-django, python3x-django0:4.2.11-1.el8apRHSA-2024:1640
Red Hatansible_automation_platform:2.4::el8python39-pillow, python3x-pillow, python39-pillow-debuginfo and 1 more0:10.0.1-1.el8apRHSA-2024:1057
Red Hatansible_automation_platform:2.4::el8python39-pycryptodomex, python3x-pycryptodomex, python39-pycryptodomex-debuginfo and 1 more0:3.20.0-1.el8apRHSA-2024:1057
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-jinja2, python3x-jinja20:3.1.3-1.el8apRHSA-2024:1057
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-pygments, python3x-pygments0:2.17.2-1.el8apRHSA-2024:1057
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8receptor, receptorctl0:1.4.5-1.el8apRHSA-2024:1640
97 more for Red Hat in the JSON and on Red Hat's page.
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy, saltbundlepy-core3.11.15-90002.4.15.1SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-cffi1.17.1-90002.3.6.2SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-cryptography3.3.2-90002.3.6.2SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-cssselect1.3.0-90002.3.6.2SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-editables0.5-90002.3.3.2SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-exceptiongroup, saltbundlepy-exceptiongroup-test1.2.2-90002.3.3.2SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-flit-core3.12.0-90002.3.3.1SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-hatch-fancy-pypi-readme, saltbundlepy-hatch-fancy-pypi-readme-test25.1.0-90002.3.3.1SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-hatch-vcs, saltbundlepy-hatch-vcs-test0.5.0-90002.3.3.1SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-hatchling1.31.0-90002.3.3.1SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-idna3.10-90002.3.6.2SUSE-SU-2026:4582-1
SUSEEL-9:Update:Products:MultiLinuxManagerTools:Updatesaltbundlepy-iniconfig2.1.0-90002.3.3.1SUSE-SU-2026:4582-1
120 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.5, Leap 15.6python-Jinja23.1.2-150400.12.6.1SUSE-SU-2024:1864-1
openSUSELeap 15.5, Leap Micro 5.3, Leap Micro 5.4python-Jinja22.10.1-150000.3.13.1SUSE-SU-2024:1863-1
openSUSETumbleweedpython-Jinja23.1.3-1.1openSUSE-SU-2024:13581-1
openSUSETumbleweedpython-Jinja23.1.6-2.4openSUSE-SU-2026:11992-1
AlmaLinux8babel, python2-babel2.5.1-10.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8fence-agents-all, fence-agents-apc, fence-agents-aws and 44 more4.2.1-129.el8ALSA-2024:2968
AlmaLinux8python2, python2-libs, python2-test and 4 more2.7.18-17.module_el8.10.0+3783+2756348e.almaALSA-2024:2987
AlmaLinux8python2-Cython0.28.1-7.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-Cython0.28.1-7.module_el8.6.0+3162+01a09e5aALSA-2024:2987
AlmaLinux8python2-PyMySQL0.8.0-10.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-attrs17.4.0-10.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-backports1.0-16.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-backports1.0-16.module_el8.6.0+3162+01a09e5aALSA-2024:2987
AlmaLinux8python2-backports-ssl_match_hostname3.5.0.1-12.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-bson, python2-pymongo, python2-pymongo-gridfs3.7.0-1.module_el8.6.0+2781+fed64c13ALSA-2024:2987
AlmaLinux8python2-bson, python2-pymongo, python2-pymongo-gridfs3.7.0-1.module_el8.6.0+3162+01a09e5aALSA-2024:2987
33 more for AlmaLinux in the JSON.

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

The identified issue is classified as moderate due to a cross-site scripting (XSS) vulnerability in Jinja2. This flaw arises from the xmlattr filter, which permits keys with spaces, contrary to XML/HTML attribute standards. In scenarios where an application accepts user-input keys and renders them for other users, attackers can exploit this vulnerability to inject additional attributes, potentially resulting in XSS attacks. The misuse of the xmlattr filter facilitates the injection of arbitrary HTML attributes, allowing attackers to bypass auto-escaping mechanisms and potentially evade attribute validation checks, posing a moderate security risk.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2.4 for RHEL 8python3x-jinja2-0:3.1.3-1.el8apFixed 2024-02-29RHSA-2024:1057
Red Hat Ansible Automation Platform 2.4 for RHEL 8automation-controller-0:4.5.5-2.el8apFixed 2024-04-02RHSA-2024:1640
Red Hat Ansible Automation Platform 2.4 for RHEL 9python-jinja2-0:3.1.3-1.el9apFixed 2024-02-29RHSA-2024:1057
Red Hat Ansible Automation Platform 2.4 for RHEL 9automation-controller-0:4.5.5-2.el9apFixed 2024-04-02RHSA-2024:1640
Red Hat Ceph Storage 7.1rhceph/ceph-nvmeof-cli-rhel9:1.2.13-4Fixed 2024-06-13RHSA-2024:3927
Red Hat Ceph Storage 7.1rhceph/ceph-nvmeof-rhel9:1.2.13-4Fixed 2024-06-13RHSA-2024:3927
Red Hat Ceph Storage 7.1rhceph/grafana-rhel9:10.4.0-9Fixed 2024-06-13RHSA-2024:3927
Red Hat Ceph Storage 7.1rhceph/keepalived-rhel9:2.2.8-20Fixed 2024-06-13RHSA-2024:3927
Red Hat Ceph Storage 7.1rhceph/rhceph-7-rhel9:7-385Fixed 2024-06-13RHSA-2024:3927
Red Hat Ceph Storage 7.1rhceph/rhceph-haproxy-rhel9:2.4.22-21Fixed 2024-06-13RHSA-2024:3927
Red Hat Ansible Automation Platform 1.2ansible-towerOut of support scope
Red Hat Ansible Automation Platform 2ansible-lintNot affected
Red Hat Ansible Automation Platform 2python3-jinja2Not affected
Red Hat Ansible Automation Platform 2python3x-ansible-compatNot affected
Red Hat Ansible Automation Platform 2python3x-django-lifecycleNot affected
Red Hat Ansible Automation Platform 2python-ansible-compatNot affected
Red Hat Ansible Automation Platform 2python-django-lifecycleNot affected
Red Hat Ceph Storage 5cephadm-ansibleOut of support scope
Red Hat Ceph Storage 6cephadm-ansibleWill not fix
Red Hat Developer Hub 1rhdh/rhdh-hub-rhel9Not affected
35 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-22195.

Attack patterns (CAPEC)

  • CAPEC-63 Cross-Site Scripting (XSS) Likelihood: High · Severity: Very High
  • CAPEC-85 AJAX Footprinting Likelihood: High · Severity: Low
  • CAPEC-209 XSS Using MIME Type Mismatch Severity: Medium
  • CAPEC-588 DOM-Based XSS Likelihood: High · Severity: Very High
  • CAPEC-591 Reflected XSS Likelihood: High · Severity: Very High
  • CAPEC-592 Stored XSS Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON