{"id":"CVE-2024-34064","published":"2024-05-06T14:41:39Z","modified":"2025-11-03T21:54:48Z","title":"Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter","vendor":"pallets","product":"jinja","tier":"tail","description":{"text":"Jinja is an extensible templating engine. The `xmlattr` filter in affected versions of Jinja accepts keys containing non-attribute characters. XML/HTML attributes cannot contain spaces, `/`, `>`, or `=`, as each would then be interpreted as starting 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. The fix for CVE-2024-22195 only addressed spaces but not other characters. Accepting keys as user input is now explicitly considered an unintended use case of the `xmlattr` filter, and code that does so without otherwise validating the input should be flagged as insecure, regardless of Jinja version. Accepting _values_ as user input continues to be safe. This vulnerability is fixed in 3.1.4.","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.00979,"percentile":0.63029,"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-h75v-3vvj-5mfj","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/pallets/jinja/commit/0668239dc6b44ef38e7a6c9f91f312fd4ca581cb","tags":["x_refsource_MISC"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SSCBHIL6BYKR5NRCBXP4XMP2CEEKGFVS/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GCLF44KY43BSVMTE6S53B4V5WP3FRRSE/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZALNWE3TXPPHVPSI3AZ5CTMSTAVN5UMS/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/567XIGSZMABG6TSMYWD7MIYNJSUQQRUC/","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2024/12/msg00009.html","tags":[]}],"priority":{"score":21.4,"factors":[{"name":"EPSS percentile","points":12.61},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":3.78}]},"exploitSources":{"pocGithub":{"count":7,"skipped":0,"earliest":"2026-03-09","earliestUrl":"https://github.com/SandBlastx/flask-vuln-v3","repos":[{"name":"SandBlastx/flask-vuln-v3","url":"https://github.com/SandBlastx/flask-vuln-v3","stars":0,"created":"2026-03-09"},{"name":"SandBlastx/flask-vuln-v4","url":"https://github.com/SandBlastx/flask-vuln-v4","stars":0,"created":"2026-03-09"},{"name":"SandBlastx/flask-vuln-baseline","url":"https://github.com/SandBlastx/flask-vuln-baseline","stars":0,"created":"2026-03-09"},{"name":"SandBlastx/flask-vuln-v1","url":"https://github.com/SandBlastx/flask-vuln-v1","stars":0,"created":"2026-03-09"},{"name":"SandBlastx/flask-vuln-v2","url":"https://github.com/SandBlastx/flask-vuln-v2","stars":0,"created":"2026-03-09"}]},"first":{"date":"2026-03-09","source":"PoC-in-GitHub","url":"https://github.com/SandBlastx/flask-vuln-v3"},"provenance":"source"},"vendorSlug":"pallets","affectedVersions":[{"vendor":"pallets","product":"jinja","versions":["< 3.1.4"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-05-09T17:53:36.420762Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"Jinja2","vulnerableRanges":["<3.1.4"],"patched":["3.1.4"],"from":["GHSA-h75v-3vvj-5mfj","PYSEC-2026-1474"],"provenance":"source"}],"summary":{"text":"The Jinja templating engine's xmlattr filter fails to reject attribute keys containing characters such as /, > and =, so a key that is user-controlled can break out of its attribute and inject additional markup into rendered HTML. An attacker needs the application to accept keys (not just values) as user input and render them on pages viewed by other users, and a victim must interact with the crafted page for the injection to take effect.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:27:06Z"},"euvd":{"id":"EUVD-2024-1641","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pallets-jinja-cve-2024-22195","parents":[{"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"]}]}],"children":[{"from":"CVE-2024-34064","to":"CVE-2025-27516","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Jinja2","fromFixed":"3.1.4","toFixed":"3.1.6","daysApart":303},{"kind":"same-code","provenance":"machine","files":["src/jinja2/filters.py"],"commits":["https://github.com/pallets/jinja/commit/0668239dc6b44ef38e7a6c9f91f312fd4ca581cb","https://github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2016-10745","published":"2019-04-08","fixed":"2.8.1","kev":false},{"cve":"CVE-2019-10906","published":"2019-04-06","fixed":"2.10.1","kev":false},{"cve":"CVE-2020-28493","published":"2021-02-01","fixed":"2.11.3","kev":false},{"cve":"CVE-2024-34064","published":"2024-05-06","fixed":"3.1.4","kev":false},{"cve":"CVE-2025-27516","published":"2025-03-05","fixed":"3.1.6","kev":false}],"package":"PyPI:Jinja2"}}