{"id":"CVE-2024-22195","published":"2024-01-11T02:25:44Z","modified":"2025-11-03T21:53:45Z","title":"Jinja vulnerable to Cross-Site Scripting (XSS)","vendor":"pallets","product":"jinja","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00971,"percentile":0.60581,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/pallets/jinja/security/advisories/GHSA-h5c8-rqwp-cp95","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/pallets/jinja/releases/tag/3.1.3","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2/","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2024/01/msg00010.html","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP/","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2024/12/msg00009.html","tags":[]}],"priority":{"score":15.9,"factors":[{"name":"EPSS percentile","points":12.12},{"name":"CVSS severity","points":3.78}]},"vendorSlug":"pallets","affectedVersions":[{"vendor":"pallets","product":"jinja","versions":["< 3.1.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-01-11T19:50:04.135839Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"jinja2","vulnerableRanges":["<3.1.3"],"patched":["3.1.3"],"from":["GHSA-h5c8-rqwp-cp95","PYSEC-2026-1473"],"provenance":"source"}],"summary":{"text":"The flaw is in Jinja, the Pallets templating engine, where the xmlattr filter fails to properly neutralize input, allowing arbitrary HTML attribute keys and values to be injected into rendered templates. An attacker who can supply input to a template that uses this filter can bypass auto-escaping to inject script via attributes, potentially leading to cross-site scripting; this requires network access and a victim to interact with the crafted content, and blacklist-based attribute validation may also be circumvented.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:30:32Z"},"euvd":{"id":"EUVD-2024-0365","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pallets-jinja-cve-2024-22195","children":[{"from":"CVE-2024-22195","to":"CVE-2024-34064","relation":"incomplete-fix","confidence":"high","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"incomplete-fix","quote":"The fix for CVE-2024-22195 only addressed spaces but not other characters.","from":"CVE.org","in":"CVE-2024-34064"},{"kind":"same-code","provenance":"machine","files":["src/jinja2/filters.py"],"commits":["https://github.com/pallets/jinja/commit/716795349a41d4983a9a4771f7d883c96ea17be7","https://github.com/pallets/jinja/commit/0668239dc6b44ef38e7a6c9f91f312fd4ca581cb"],"basis":"shared function","functions":["do_items","do_xmlattr"]}]},{"from":"CVE-2024-22195","to":"CVE-2025-27516","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/jinja2/filters.py"],"commits":["https://github.com/pallets/jinja/commit/716795349a41d4983a9a4771f7d883c96ea17be7","https://github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2024-22195","published":"2024-01-11","fixed":"3.1.3","kev":false},{"cve":"CVE-2024-56201","published":"2024-12-23","fixed":"3.1.5","kev":false,"link":{"from":"CVE-2024-22195","to":"CVE-2024-56201","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:jinja2","fromFixed":"3.1.3","toFixed":"3.1.5","daysApart":347}]}},{"cve":"CVE-2024-56326","published":"2024-12-23","fixed":"3.1.5","kev":false,"link":{"from":"CVE-2024-22195","to":"CVE-2024-56326","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:jinja2","fromFixed":"3.1.3","toFixed":"3.1.5","daysApart":347}]}}],"package":"PyPI:jinja2"}}