A Leader in the 2025 Gartner® Magic Quadrant™ for Endpoint Protection Platforms. Five years running.A Leader in the Gartner® Magic Quadrant™Read the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI Security Portfolio
      Leading the Way in AI-Powered Security Solutions
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly ingest data from on-prem, cloud or hybrid environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Identity Security
    • Singularity Identity
      Identity Threat Detection and Response
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-class Expertise and Threat Intelligence.
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      Digital Forensics, IRR & Breach Readiness
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive solutions for seamless security operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • Partner Locator
      Your go-to source for our top partners in your region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-22195

CVE-2024-22195: Palletsprojects Jinja XSS Vulnerability

CVE-2024-22195 is an XSS flaw in Palletsprojects Jinja that allows attackers to inject arbitrary HTML attributes via the xmlattr filter, bypassing auto escaping. This article covers technical details, impact, and mitigation.

Updated: January 22, 2026

CVE-2024-22195 Overview

CVE-2024-22195 is a Cross-Site Scripting (XSS) vulnerability affecting Jinja, the popular extensible templating engine for Python. The vulnerability exists in the xmlattr filter, which can be abused to inject arbitrary HTML attribute keys and values into rendered HTML templates. This injection bypasses Jinja's auto-escaping mechanism, potentially enabling attackers to execute malicious scripts in the context of a user's browser session.

Critical Impact

Attackers can inject arbitrary HTML attributes into rendered templates, bypassing auto-escaping and leading to Cross-Site Scripting attacks. This may also allow bypass of blacklist-based attribute validation checks.

Affected Products

  • Palletsprojects Jinja (versions prior to 3.1.3)

Discovery Timeline

  • 2024-01-11 - CVE CVE-2024-22195 published to NVD
  • 2025-11-03 - Last updated in NVD database

Technical Details for CVE-2024-22195

Vulnerability Analysis

This vulnerability stems from improper handling of user-controlled input within the Jinja xmlattr filter. Jinja uses special placeholders in templates that allow developers to write code similar to Python syntax. While Jinja implements auto-escaping to prevent XSS attacks, the xmlattr filter provides a bypass mechanism.

The xmlattr filter is designed to convert a dictionary of attributes into a space-separated list of key="value" pairs for HTML/XML attributes. However, when attacker-controlled data flows into this filter, it becomes possible to inject arbitrary HTML attribute keys and values that the auto-escaping mechanism does not properly sanitize.

This attack vector is particularly dangerous because it can bypass not only Jinja's built-in protections but also application-level attribute validation checks that rely on blacklist-based filtering approaches.

Root Cause

The root cause of this vulnerability lies in the xmlattr filter's insufficient validation and sanitization of attribute names and values. The filter processes dictionary data and outputs HTML attributes without adequately ensuring that the attribute names and values cannot be used to inject malicious content. When combined with attacker-controlled input, this allows the injection of event handler attributes (such as onclick, onerror, etc.) or other dangerous HTML attributes that can execute JavaScript code.

Attack Vector

The attack is network-based and requires user interaction. An attacker would need to craft malicious input that gets processed through a Jinja template using the xmlattr filter. When a victim visits a page that renders this template with the attacker's payload, the injected HTML attributes become part of the DOM, potentially triggering script execution.

The attacker could exploit this by:

  1. Identifying an application that uses Jinja templates with the xmlattr filter on user-controlled data
  2. Crafting a payload containing malicious HTML attributes (e.g., event handlers)
  3. Submitting the payload through the application's input mechanisms
  4. When the template renders for any user viewing that content, the injected attributes execute the malicious script

The vulnerability mechanism allows injection of arbitrary HTML attributes through the xmlattr filter. When user-controlled data containing specially crafted dictionary keys or values is passed to this filter, it can result in the injection of event handler attributes or other malicious HTML constructs. For detailed technical analysis, see the GitHub Security Advisory.

Detection Methods for CVE-2024-22195

Indicators of Compromise

  • Unusual HTML attributes appearing in rendered pages, particularly event handlers not expected by the application
  • Web application firewall logs showing attempts to inject HTML attribute patterns through input fields
  • Client-side errors or unexpected JavaScript execution reported by browser security monitoring
  • Suspicious dictionary structures in application logs containing attribute-like key-value pairs

Detection Strategies

  • Review Jinja templates for usage of the xmlattr filter with user-controlled input
  • Implement Content Security Policy (CSP) headers to detect and block inline script execution
  • Deploy web application firewall rules to identify HTML attribute injection patterns
  • Audit application code for data flows from user input to Jinja template rendering with xmlattr

Monitoring Recommendations

  • Enable verbose logging for template rendering operations in production environments
  • Monitor CSP violation reports for indicators of XSS exploitation attempts
  • Implement real-time alerting for unusual patterns in rendered HTML output
  • Track dependency versions and receive alerts when vulnerable Jinja versions are detected in your environment

How to Mitigate CVE-2024-22195

Immediate Actions Required

  • Upgrade Jinja to version 3.1.3 or later immediately
  • Audit all Jinja templates for usage of the xmlattr filter with user-controlled input
  • Implement strict Content Security Policy headers as a defense-in-depth measure
  • Review and strengthen input validation for any data that flows into template rendering

Patch Information

Palletsprojects has released Jinja version 3.1.3 which addresses this vulnerability. The fix ensures proper sanitization of attribute names and values when using the xmlattr filter. Users should upgrade to this version or later as soon as possible.

For more information, see the GitHub Release Note for version 3.1.3 and the GitHub Security Advisory.

Linux distribution users should check for updates:

  • Debian users: See the Debian LTS Announcement
  • Fedora users: Check the Fedora Package Announcements

Workarounds

  • Avoid using the xmlattr filter with user-controlled data until the patch can be applied
  • Implement allowlist-based validation for any attributes that must be dynamically rendered
  • Apply strict input sanitization before data reaches template rendering contexts
  • Use alternative rendering approaches that do not rely on the vulnerable xmlattr filter
bash
# Upgrade Jinja to patched version
pip install --upgrade Jinja2>=3.1.3

# Verify installed version
pip show Jinja2 | grep Version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechJinja

  • SeverityMEDIUM

  • CVSS Score6.1

  • EPSS Probability0.11%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Release Note

  • GitHub Security Advisory

  • Debian LTS Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Debian LTS Announcement
  • Related CVEs
  • CVE-2025-27516

  • CVE-2024-56326

  • CVE-2024-56201

  • CVE-2024-34064
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • English
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use