CVE-2024-22195
Jinja vulnerable to Cross-Site Scripting (XSS)
Reported by github_m · Published January 11, 2024
Jinja2 is fixed in 3.1.3 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| Jinja2 | PyPI | 3.1.3 |
| python3-jinja2 | Amazon Linux | 2.11.3-1.amzn2023.0.3, 2.7.2-4.amzn2.0.3 |
| checkov | Chainguard | 3.0.34-r1 |
| python-jinja2 | Amazon Linux | 2.7.2-3.amzn2.0.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| pallets | jinja | < 3.1.3 |
| PyPI | Jinja2 | 0 |
| amazon:2023 | python3-jinja2 | 0 |
| chainguard | checkov | 0 |
| amazon:2 | python-jinja2 | 0 |
| amazon:2 | python3-jinja2 | 0 |
| pallets | jinja | 0 |
| chainguard | py3-jinja2 | 0 |
| chainguard | kubeflow-pipelines-visualization-server | 0 |
| wolfi | py3-jinja2 | 0 |
| chainguard | reflex | 0 |
| wolfi | kubeflow-pipelines-visualization-server | 0 |
| palletsprojects | jinja | |
| wolfi | reflex | 0 |
| wolfi | checkov | 0 |
Timeline
- Jan 11, 2024 CVE Published
- Jan 18, 2024 EPSS Score (30 in total, the first dated here)
- Feb 8, 2024 PoC Published
- Oct 4, 2024 Coalition ESS Score (9 in total, the first dated here)
- Jan 17, 2026 Security Advisory (76 in total, the first dated here)
- Aug 10, 2026 Distribution Patch (70 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-22195
vulnetix vdb fixes CVE-2024-22195
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-22195/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/pallets/jinja/security/advisories/GHSA-h5c8-rqwp-cp95 x_refsource_CONFIRM
- https://github.com/pallets/jinja/releases/tag/3.1.3 x_refsource_MISC
- https://nvd.nist.gov/vuln/detail/CVE-2024-22195 advisory
- https://github.com/advisories/GHSA-h5c8-rqwp-cp95 advisory
- https://github.com/pallets/jinja/commit/716795349a41d4983a9a4771f7d883c96ea17be7 patch
- https://github.com/pallets/jinja url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2 url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3 url
- https://lists.debian.org/debian-lts-announce/2024/12/msg00009.html url