# CVE-2024-34064: Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter

- Severity: Medium 5.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.98%, higher than 63% of CVEs (2026-12-01)
- Published: 2024-05-06T14:20:59.000Z
- Modified: 2026-09-10T03:50:13.786Z
- Also known as: GHSA-h75v-3vvj-5mfj, PYSEC-2026-1474
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- pallets jinja: < 3.1.4
- jinja2 (PyPI): before 3.1.4
- palletsprojects jinja: before 3.1.4
- fedoraproject fedora: 39; 40

## Every score

- GitHub_M: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- CISA-ADP: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- PyPA Advisory Database: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`

## References

- <https://github.com/pallets/jinja/security/advisories/GHSA-h75v-3vvj-5mfj> (vendor-advisory, web)
- <https://github.com/pallets/jinja/commit/0668239dc6b44ef38e7a6c9f91f312fd4ca581cb> (fix, patch, web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SSCBHIL6BYKR5NRCBXP4XMP2CEEKGFVS/> (mailing-list)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GCLF44KY43BSVMTE6S53B4V5WP3FRRSE/> (mailing-list)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZALNWE3TXPPHVPSI3AZ5CTMSTAVN5UMS/> (mailing-list)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/567XIGSZMABG6TSMYWD7MIYNJSUQQRUC/> (mailing-list)
- <https://lists.debian.org/debian-lts-announce/2024/12/msg00009.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-34064> (advisory)
- <https://github.com/pallets/jinja> (package)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/567XIGSZMABG6TSMYWD7MIYNJSUQQRUC> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GCLF44KY43BSVMTE6S53B4V5WP3FRRSE> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SSCBHIL6BYKR5NRCBXP4XMP2CEEKGFVS> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZALNWE3TXPPHVPSI3AZ5CTMSTAVN5UMS> (web)
- <https://pypi.org/project/jinja2> (package)
- <https://github.com/advisories/GHSA-h75v-3vvj-5mfj> (advisory)

## Sources

- CVE List: [CVE-2024-34064](https://www.cve.org/CVERecord?id=CVE-2024-34064), CVE Terms of Use, modified 2025-11-03
- GitHub Advisory Database: [GHSA-h75v-3vvj-5mfj](https://github.com/advisories/GHSA-h75v-3vvj-5mfj), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-34064](https://nvd.nist.gov/vuln/detail/CVE-2024-34064), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1474](https://osv.dev/vulnerability/PYSEC-2026-1474), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2024-34064 · Whole record: https://cve.day/CVE-2024-34064.json · Rebuilt by cve.day 2026-11-25T22:58:39.995Z
