
Cloud Vulnerability DB
A community-led vulnerabilities database
Jinja2, a widely used Python templating engine with over 33 million weekly downloads, was found to contain a Cross-Site Scripting (XSS) vulnerability identified as CVE-2024-22195. The vulnerability was discovered in January 2024 and affects all versions prior to 3.1.3. The vulnerability exists in the xmlattr filter functionality, which incorrectly handles HTML attribute keys containing spaces, potentially allowing for arbitrary HTML attribute injection (Snyk Blog, GitHub Advisory).
The vulnerability stems from the xmlattr filter's acceptance of keys containing spaces, which violates XML/HTML attribute standards. When user input is passed as attribute keys and rendered in pages visible to other users, attackers could exploit this to inject additional attributes and execute cross-site scripting attacks. The vulnerability has been assigned a CVSS v3.1 base score of 6.1 (Medium) by NVD and 5.4 (Medium) by GitHub, with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N (NVD, GitHub Advisory).
The vulnerability could allow attackers to perform cross-site scripting (XSS) attacks by injecting malicious HTML attributes into templates. This could lead to the execution of unauthorized JavaScript code in users' browsers, potentially compromising user data and session information. The impact is particularly significant for applications that accept user input as attribute keys in the xmlattr filter (GitHub Advisory).
The vulnerability has been fixed in Jinja2 version 3.1.3. Users are strongly advised to upgrade to this version immediately. For those unable to upgrade immediately, it's recommended to implement strict validation of attribute keys if accepting user input, particularly ensuring no spaces are present in attribute keys. Organizations should also verify that their attribute validation checks are not solely based on blacklists (GitHub Release, Debian Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."