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)
ReferencesDLA-3988-1
Debian Bugs1070712

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
jinja2 (PTS)bullseye2.11.3-1vulnerable
bullseye (security)2.11.3-1+deb11u2fixed
bookworm3.1.2-1vulnerable
sid, trixie3.1.3-1.1fixed

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

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
jinja2sourcebullseye2.11.3-1+deb11u1DLA-3988-1
jinja2source(unstable)3.1.3-1.11070712

Notes

[bookworm] - 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)

Search for package or bug name: Reporting problems