CVE-2024-34064

NameCVE-2024-34064
DescriptionJinja 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
Debian Bugs1070712

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
jinja2 (PTS)jessie, jessie (lts)2.7.3-1+deb8u1vulnerable
stretch (lts), stretch2.8-1+deb9u1vulnerable
buster (security), buster, buster (lts)2.10-2+deb10u1vulnerable
bullseye2.11.3-1vulnerable
bookworm3.1.2-1vulnerable
sid, trixie3.1.3-1vulnerable

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
jinja2source(unstable)(unfixed)1070712

Notes

[bookworm] - jinja2 <no-dsa> (Minor issue)
[bullseye] - jinja2 <no-dsa> (Minor issue)
[buster] - jinja2 <postponed> (Minor issue)
https://github.com/pallets/jinja/security/advisories/GHSA-h75v-3vvj-5mfj
Fixed by: https://github.com/pallets/jinja/commit/d655030770081e2dfe46f90e27620472a502289d (3.1.4)
[stretch] - jinja2 <postponed> (Minor issue)
[jessie] - jinja2 <postponed> (Minor issue)

Search for package or bug name: Reporting problems