CVE-2024-22195
MEDIUM 6.1CVSS 3.1Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
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.
- Published
- 11 Jan 2024
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- GHSA-h5c8-rqwp-cp95PYSEC-2026-1473
- Sources
- NVDJSONOSV GHSA-h5c8-rqwp-cp95JSONOSV PYSEC-2026-1473JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| OSV | PyPA | CVSS 3.1 | MEDIUM 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | palletsprojects | jinjacpe:2.3:a:palletsprojects:jinja:*:*:*:*:*:*:*:* |
< 3.1.3 | 3.1.3 |
| OSV | PyPI | jinja2 | < 3.1.3 | 3.1.3 |
References
- https://github.com/pallets/jinja/releases/tag/3.1.3 · Release Notes, WEB
- https://github.com/pallets/jinja/security/advisories/GHSA-h5c8-rqwp-cp95 · Third Party Advisory, WEB
- https://lists.debian.org/debian-lts-announce/2024/01/msg00010.html · WEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2/ · WEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP/ · WEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3/ · WEB
- https://lists.debian.org/debian-lts-announce/2024/12/msg00009.html · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-22195 · ADVISORY
- https://github.com/pallets/jinja/commit/716795349a41d4983a9a4771f7d883c96ea17be7 · WEB, FIX
- https://github.com/pallets/jinja · PACKAGE
- https://pypi.org/project/jinja2 · PACKAGE
- https://github.com/advisories/GHSA-h5c8-rqwp-cp95 · ADVISORY
History
- 25 Nov 2026 20:37 UTC · NVD: first stored (published 11 Jan 2024)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 7 Jul 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 11 Jan 2024)