{"id":"CVE-2024-22195","aliases":["CVE-2024-22195","GHSA-h5c8-rqwp-cp95","PYSEC-2026-1473"],"related":[],"kind":"vulnerability","state":"published","title":"Jinja vulnerable to Cross-Site Scripting (XSS)","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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"The `xmlattr` filter in affected versions of Jinja accepts keys containing spaces. XML/HTML attributes cannot contain spaces, as each would then be interpreted as a separate attribute. If an application accepts keys (as opposed to only values) as user input, and renders these in pages that other users see as well, an attacker could use this to inject other attributes and perform XSS. Note that accepting keys as user input is not common or a particularly intended use case of the `xmlattr` filter, and an application doing so should already be verifying what keys are provided regardless of this fix.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Jinja es un motor de plantillas extensible. Los marcadores de posición especiales en la plantilla permiten escribir código similar a la sintaxis de Python. Es posible inyectar atributos HTML arbitrarios en la plantilla HTML renderizada, lo que podría generar cross site scripting (XSS). Se puede abusar del filtro Jinja `xmlattr` para inyectar claves y valores de atributos HTML arbitrarios, evitando el mecanismo de escape automático y potencialmente conduciendo a XSS. También es posible omitir las comprobaciones de validación de atributos si están basadas en listas negras.","source":"nvd"}],"published":"2024-01-11T02:25:44.239Z","modified":"2026-09-10T03:50:00.236Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 3.1.3","status":"affected"}],"vendor":"pallets","product":"jinja","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.3"}],"ecosystem":"PyPI","package":"jinja2","purl":"pkg:pypi/jinja2","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.3"}],"vendor":"palletsprojects","product":"jinja","cpe":"cpe:2.3:a:palletsprojects:jinja:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.3"}],"ecosystem":"PyPI","package":"jinja2","purl":"pkg:pypi/jinja2","source":"pysec"}],"references":[{"url":"https://github.com/pallets/jinja/security/advisories/GHSA-h5c8-rqwp-cp95","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pallets/jinja/releases/tag/3.1.3","tags":["release-notes","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2/","tags":["x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/01/msg00010.html","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3/","tags":["x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP/","tags":["x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/12/msg00009.html","tags":["web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-22195","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pallets/jinja/commit/716795349a41d4983a9a4771f7d883c96ea17be7","tags":["fix","web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pallets/jinja","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/jinja2","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-h5c8-rqwp-cp95","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-01-11T19:50:04.135Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-22195","url":"https://www.cve.org/CVERecord?id=CVE-2024-22195","licence":"CVE Terms of Use","modified":"2025-11-03T21:53:45.551Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h5c8-rqwp-cp95","url":"https://github.com/advisories/GHSA-h5c8-rqwp-cp95","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:00.236Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-22195","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-22195","licence":"Public domain","modified":"2026-06-17T07:10:54.907Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1473","url":"https://osv.dev/vulnerability/PYSEC-2026-1473","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:13.853Z"}],"updatedAt":"2026-11-25T22:58:36.024Z","epss":{"score":0.00892,"percentile":0.60484,"date":"2026-12-01T12:00:22.000Z"}}