CVE-2024-34064
Reported by github_m · Published May 6, 2024
jinja2 is fixed in 3.1.4 (PyPI)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| jinja2 | PyPI | 3.1.4 |
| confluent-docker-utils | Chainguard | 0.0.77-r0 |
| reflex | Wolfi | 0.5.0-r0 |
| checkov | Chainguard | 3.0.34-r1 |
| reflex | Chainguard | 0.5.0-r0 |
| nemo | Chainguard | 1.23.0-r12 |
| kubeflow-volumes-web-app | Chainguard | 1.8.0-r6 |
| checkov | Wolfi | 3.0.34-r1 |
| py3-jinja2 | Chainguard | 3.1.4-r1 |
| kubeflow-jupyter-web-app | Chainguard | 1.8.0-r7 |
| python3-jinja2 | Amazon Linux | 2.11.3-1.amzn2023.0.4, 2.7.2-4.amzn2.0.4 |
| dask-gateway | Chainguard | 2024.1.0-r4 |
3 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| pallets | jinja | < 3.1.4 |
| chainguard | confluent-docker-utils | 0 |
| wolfi | reflex | 0 |
| chainguard | checkov | 0 |
| chainguard | reflex | 0 |
| chainguard | nemo | 0 |
| palletsprojects | jinja2 | |
| chainguard | kubeflow-volumes-web-app | 0 |
| wolfi | checkov | 0 |
| chainguard | py3-jinja2 | 0 |
| chainguard | kubeflow-jupyter-web-app | 0 |
| amazon:2023 | python3-jinja2 | 0 |
| chainguard | dask-gateway | 0 |
| wolfi | kubeflow-pipelines-visualization-server | 0 |
| amazon:2 | python3-jinja2 | 0 |
| PyPI | Jinja2 | 0 |
| chainguard | kubeflow-pipelines-visualization-server | 0 |
| pallets | jinja | 0 |
| chainguard | superset | 0 |
| wolfi | dask-gateway | 0 |
…and 8 more
Timeline
- May 6, 2024 CVE Published
- May 7, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (10 in total, the first dated here)
- Jan 11, 2026 Security Advisory (80 in total, the first dated here)
- Feb 4, 2026 CVE Updated
- Aug 10, 2026 Distribution Patch (71 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-34064
vulnetix vdb fixes CVE-2024-34064
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-34064/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/pallets/jinja/security/advisories/GHSA-h75v-3vvj-5mfj x_refsource_CONFIRM
- https://github.com/pallets/jinja/commit/0668239dc6b44ef38e7a6c9f91f312fd4ca581cb x_refsource_MISC
- https://nvd.nist.gov/vuln/detail/CVE-2024-34064 advisory
- https://github.com/advisories/GHSA-h75v-3vvj-5mfj advisory
- https://github.com/pallets/jinja url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/567XIGSZMABG6TSMYWD7MIYNJSUQQRUC url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GCLF44KY43BSVMTE6S53B4V5WP3FRRSE url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SSCBHIL6BYKR5NRCBXP4XMP2CEEKGFVS url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZALNWE3TXPPHVPSI3AZ5CTMSTAVN5UMS url
- https://lists.debian.org/debian-lts-announce/2024/12/msg00009.html url