Jinja vulnerable to Cross-Site Scripting (XSS)
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Partial Red Hat: 35 fixed, 9 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-79.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pallets | jinja | before 3.1.3 | 3.1.3 | Patch available | CNA |
| — | jinja2 (PyPI) | before 3.1.3 | 3.1.3 | Patch available | GHSA-h5c8-rqwp-cp95 |
- jinja Vendorpallets Affected before 3.1.3 Fixed in 3.1.3 Patch available CNA
- jinja2 (PyPI) Vendor— Affected before 3.1.3 Fixed in 3.1.3 Patch available GHSA-h5c8-rqwp-cp95
Remediation
- Fix · CNA jinja (pallets) Fixed in 3.1.3
- Fix · GHSA-h5c8-rqwp-cp95 jinja2 (PyPI) Fixed in 3.1.3 Advisory →
Red Hat 13 advisories
- RHSA-2024:3927 Released 2024-06-13 · Red Hat rating ModerateRed Hat Ceph Storage 7.1 container image security, and bug fix update
- Red Hat Ceph Storage 7.1 Tools rhceph/ceph-nvmeof-cli-rhel9, rhceph/ceph-nvmeof-rhel9, rhceph/grafana-rhel9 +5
- RHSA-2024:2733 Released 2024-05-22 · Red Hat rating ModerateRed Hat OpenStack Platform 17.1 (openstack-ansible-core) security update
- Red Hat OpenStack Platform 17.1 openstack-ansible-core-2.14.2-4.3.el9ost
- RHSA-2024:2987 Released 2024-05-22 · Red Hat rating Moderatepython27:2.7 security update
- Red Hat Enterprise Linux AppStream (v. 8) Cython-0.28.1-7.module+el8.9.0+19487+7dc18407.src::python27:2.7, PyYAML-3.12-16.module+el8.9.0+19487+7dc18407.src::python27:2.7, babel-2.5.1-10.module+el8.9.0+19487+7dc18407.noarch::python27:2.7 +47
Show 10 more Red Hat advisories
- RHSA-2024:2968 Released 2024-05-22 · Red Hat rating Moderatefence-agents security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 8) fence-agents-4.2.1-129.el8, fence-agents-all-4.2.1-129.el8, fence-agents-amt-ws-4.2.1-129.el8 +40
- Red Hat Enterprise Linux HighAvailability (v. 8) fence-agents-aliyun-4.2.1-129.el8, fence-agents-aws-4.2.1-129.el8, fence-agents-azure-arm-4.2.1-129.el8 +2
- Red Hat Enterprise Linux ResilientStorage (v. 8) fence-agents-aliyun-4.2.1-129.el8, fence-agents-aws-4.2.1-129.el8, fence-agents-azure-arm-4.2.1-129.el8 +2
- RHSA-2024:3102 Released 2024-05-22 · Red Hat rating Moderatepython-jinja2 security update
- Red Hat Enterprise Linux AppStream (v. 8) python-jinja2-2.10.1-4.el8, python3-jinja2-2.10.1-4.el8
- RHSA-2024:2132 Released 2024-04-30 · Red Hat rating Moderatefence-agents security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 9) fence-agents-4.10.0-62.el9, fence-agents-common-4.10.0-62.el9, fence-agents-compute-4.10.0-62.el9 +11
- Red Hat Enterprise Linux HighAvailability (v. 9) fence-agents-aliyun-4.10.0-62.el9, fence-agents-all-4.10.0-62.el9, fence-agents-amt-ws-4.10.0-62.el9 +39
- Red Hat Enterprise Linux ResilientStorage (v. 9) fence-agents-aliyun-4.10.0-62.el9, fence-agents-all-4.10.0-62.el9, fence-agents-amt-ws-4.10.0-62.el9 +39
- RHSA-2024:2348 Released 2024-04-30 · Red Hat rating Moderatepython-jinja2 security update
- Red Hat Enterprise Linux AppStream (v. 9) python-jinja2-2.11.3-5.el9, python3-jinja2-2.11.3-5.el9
- RHSA-2024:2010 Released 2024-04-23 · Red Hat rating ImportantSatellite 6.15.0 release
- Red Hat Satellite 6.15 for RHEL 8 foreman-3.9.1.6-1.el8sat, foreman-cli-3.9.1.6-1.el8sat, foreman-debug-3.9.1.6-1.el8sat +28
- RHSA-2024:1878 Released 2024-04-18 · Red Hat rating ModerateRHUI 4.8 Release - Security Updates, Bug Fixes, and Enhancements
- RHUI 4 for RHEL 8 python-aiohttp-3.9.2-1.el8ui, python-cryptography-41.0.6-1.el8ui, python-django-4.2.11-1.el8ui +7
- RHSA-2024:1640 Released 2024-04-02 · Red Hat rating ModerateRed Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update
- Red Hat Ansible Automation Platform 2.4 for RHEL 8 automation-controller-venv-tower-4.5.5-2.el8ap, python39-aiohttp-3.9.3-1.el8ap, python39-django-4.2.11-1.el8ap +4
- Red Hat Ansible Automation Platform 2.4 for RHEL 9 automation-controller-venv-tower-4.5.5-2.el9ap, python-aiohttp-3.9.3-1.el9ap, python-django-4.2.11-1.el9ap +4
- RHSA-2024:1536 Released 2024-03-27 · Red Hat rating ModerateSatellite 6.14.3 Async Security Update
- Red Hat Satellite 6.14 for RHEL 8 python-aiohttp-3.9.2-0.1.el8pc, python-django-3.2.22-1.el8pc, python-galaxy-importer-0.4.18-2.el8pc +5
- RHSA-2024:1155 Released 2024-03-05 · Red Hat rating Moderatefence-agents security update
- Red Hat Enterprise Linux AppStream EUS (v.9.0) fence-agents-4.10.0-20.el9_0.11, fence-agents-common-4.10.0-20.el9_0.11, fence-agents-compute-4.10.0-20.el9_0.11 +12
- Red Hat Enterprise Linux High Availability EUS (v.9.0) fence-agents-aliyun-4.10.0-20.el9_0.11, fence-agents-all-4.10.0-20.el9_0.11, fence-agents-amt-ws-4.10.0-20.el9_0.11 +39
- Red Hat Enterprise Linux Resilient Storage EUS (v.9.0) fence-agents-aliyun-4.10.0-20.el9_0.11, fence-agents-all-4.10.0-20.el9_0.11, fence-agents-amt-ws-4.10.0-20.el9_0.11 +39
- RHSA-2024:1057 Released 2024-02-29 · Red Hat rating ImportantRed Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update
- Red Hat Ansible Automation Platform 2.4 for RHEL 8 ansible-automation-platform-installer-2.4-6.el8ap, ansible-rulebook-1.0.5-1.el8ap, automation-eda-controller-1.0.5-1.el8ap +14
- Red Hat Ansible Automation Platform 2.4 for RHEL 9 ansible-automation-platform-installer-2.4-6.el9ap, ansible-rulebook-1.0.5-1.el9ap, automation-eda-controller-1.0.5-1.el9ap +14
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Ansible Automation Platform 1.2 | Affected | No fix planned: Out of support scope |
| Red Hat Ceph Storage 5 | Affected | No fix planned: Out of support scope |
| Red Hat Ceph Storage 6 | Affected | No fix planned: Will not fix |
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Quay 3 | Affected | No fix yet |
| Red Hat Satellite 6 | Affected | No fix yet |
| Red Hat Software Collections | Affected | No fix planned: Will not fix |
| Red Hat Storage 3 | Affected | No fix planned: Out of support scope |
| RHUI 4 for RHEL 8 | Fixed | RHSA-2024:1878 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | Fixed | RHSA-2024:1057, RHSA-2024:1640 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 9 | Fixed | RHSA-2024:1057, RHSA-2024:1640 |
| Red Hat Ceph Storage 7.1 Tools | Fixed | RHSA-2024:3927 |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2024:2968, RHSA-2024:2987, RHSA-2024:3102 |
| Red Hat Enterprise Linux AppStream (v. 9) | Fixed | RHSA-2024:2132, RHSA-2024:2348 |
| Red Hat Enterprise Linux AppStream AUS (v.8.4) | Fixed | — |
| Red Hat Enterprise Linux AppStream E4S (v.8.4) | Fixed | — |
| Red Hat Enterprise Linux AppStream EUS (v.8.6) | Fixed | — |
| Red Hat Enterprise Linux AppStream EUS (v.8.8) | Fixed | — |
| Red Hat Enterprise Linux AppStream EUS (v.9.0) | Fixed | RHSA-2024:1155 |
| Red Hat Enterprise Linux AppStream EUS (v.9.2) | Fixed | — |
| Red Hat Enterprise Linux AppStream TUS (v.8.4) | Fixed | — |
| Red Hat Enterprise Linux High Availability (v. 8) | Fixed | — |
| Red Hat Enterprise Linux High Availability (v. 9) | Fixed | — |
| Red Hat Enterprise Linux High Availability AUS (v.8.4) | Fixed | — |
| Red Hat Enterprise Linux High Availability EUS (v.8.6) | Fixed | — |
| Red Hat Enterprise Linux High Availability EUS (v.8.8) | Fixed | — |
| Red Hat Enterprise Linux High Availability EUS (v.9.0) | Fixed | RHSA-2024:1155 |
| Red Hat Enterprise Linux High Availability EUS (v.9.2) | Fixed | — |
| Red Hat Enterprise Linux HighAvailability (v. 8) | Fixed | RHSA-2024:2968 |
| Red Hat Enterprise Linux HighAvailability (v. 9) | Fixed | RHSA-2024:2132 |
| Red Hat Enterprise Linux HighAvailability E4S (v.8.4) | Fixed | — |
| Red Hat Enterprise Linux HighAvailability TUS (v.8.4) | Fixed | — |
| Red Hat Enterprise Linux Resilient Storage (v. 8) | Fixed | — |
| Red Hat Enterprise Linux Resilient Storage (v. 9) | Fixed | — |
| Red Hat Enterprise Linux Resilient Storage EUS (v.8.6) | Fixed | — |
| Red Hat Enterprise Linux Resilient Storage EUS (v.8.8) | Fixed | — |
| Red Hat Enterprise Linux Resilient Storage EUS (v.9.0) | Fixed | RHSA-2024:1155 |
| Red Hat Enterprise Linux Resilient Storage EUS (v.9.2) | Fixed | — |
| Red Hat Enterprise Linux ResilientStorage (v. 8) | Fixed | RHSA-2024:2968 |
| Red Hat Enterprise Linux ResilientStorage (v. 9) | Fixed | RHSA-2024:2132 |
| Red Hat OpenStack Platform 17.1 | Fixed | RHSA-2024:2733 |
| Red Hat Satellite 6.14 for RHEL 8 | Fixed | RHSA-2024:1536 |
| Red Hat Satellite 6.15 for RHEL 8 | Fixed | RHSA-2024:2010 |
Not affected: 12 products
- RHUI 4 for RHEL 8
- Red Hat Ansible Automation Platform 2
- Red Hat Ansible Automation Platform 2.4 for RHEL 8
- Red Hat Ansible Automation Platform 2.4 for RHEL 9
- Red Hat Developer Hub 1
- Red Hat Discovery 1
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat OpenShift Container Platform 4
- Red Hat OpenStack Platform 18.0
- Red Hat Satellite 6.14 for RHEL 8
- Red Hat Satellite 6.15 for RHEL 8
Timeline
- 2026-10-02 Threatist record created from CVE-2024-22195
- 2026-10-03 Alias added: GHSA-h5c8-rqwp-cp95
- 2026-10-27 Affected versions changed · Red Hat
References
Advisory 2
Other 11
- https://github.com/pallets/jinja/releases/tag/3.1.3
- https://lists.fedoraproject.org/archives/list/[email protected]/message/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2/
- https://lists.debian.org/debian-lts-announce/2024/01/msg00010.html
- https://lists.fedoraproject.org/archives/list/[email protected]/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP/
- https://github.com/pallets/jinja/commit/716795349a41d4983a9a4771f7d883c96ea17be7
- https://github.com/pallets/jinja
- https://lists.debian.org/debian-lts-announce/2024/12/msg00009.html
- https://lists.fedoraproject.org/archives/list/[email protected]/message/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2
- https://lists.fedoraproject.org/archives/list/[email protected]/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP
- https://lists.fedoraproject.org/archives/list/[email protected]/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3
More pallets Jinja vulnerabilities
- TI-2019-08127 In Pallets Jinja before 2.10.1, str.format_map allows a sandbox escape. CVSS 3.1HIGH 8.6
- TI-2016-08785 In Pallets Jinja before 2.8.1, str.format allows a sandbox escape. CVSS 3.0HIGH 8.6
- TI-2020-17297 Regular expression denial of service (ReDoS) in jinja2 CVSS 3.1MEDIUM 5.3
- TI-2025-20348 Jinja sandbox breakout through attr filter selecting format method CVSS 4.0MEDIUM 5.4
- TI-2024-37287 Jinja has a sandbox breakout through indirect reference to format method CVSS 4.0MEDIUM 5.4
- TI-2024-37171 Jinja has a sandbox breakout through malicious filenames CVSS 4.0MEDIUM 5.4
Sources
- CVE-2024-22195 · CVE Program
- CVE-2024-22195 · NVD
- FIRST EPSS
- GHSA-h5c8-rqwp-cp95 · GitHub Advisory Database · CC BY 4.0
- CVE-2024-22195 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences