Red Hat VEX
RHVEX-CVE-2024-22195
jinja2: HTML attribute injection when passing user input as keys to xmlattr filter
Details
A cross-site scripting (XSS) flaw was found in Jinja2 due to the xmlattr filter allowing keys with spaces, contrary to XML/HTML attribute standards. If an application accepts user-input keys and renders them for other users, attackers can inject additional attributes, potentially leading to XSS. This misuse of the xmlattr filter enables the injection of arbitrary HTML attributes, bypassing auto-escaping and potentially circumventing attribute validation checks.
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| Red Hat:enterprise_linux:6 | python-jinja2 | All versions, no fix (out of support scope) |
| Red Hat:enterprise_linux:7 | python-jinja2 | All versions, no fix (out of support scope) |
References
- https://access.redhat.com/security/cve/CVE-2024-22195
- https://bugzilla.redhat.com/show_bug.cgi?id=2257854
- https://www.cve.org/CVERecord?id=CVE-2024-22195
- https://nvd.nist.gov/vuln/detail/CVE-2024-22195
- https://github.com/pallets/jinja/releases/tag/3.1.3
- https://github.com/pallets/jinja/security/advisories/GHSA-h5c8-rqwp-cp95