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-34064

CVE-2024-34064: Palletsprojects Jinja XSS Vulnerability

CVE-2024-34064 is an XSS vulnerability in Palletsprojects Jinja affecting the xmlattr filter, allowing attackers to inject malicious attributes. This article covers the technical details, affected versions, and mitigation.

Published: January 28, 2026

CVE-2024-34064 Overview

CVE-2024-34064 is a Cross-Site Scripting (XSS) vulnerability in Jinja, an extensible templating engine widely used in Python web applications. The vulnerability exists in the xmlattr filter, which accepts keys containing non-attribute characters that should be disallowed. XML/HTML attributes cannot contain spaces, /, >, or =, as each would 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 visible to other users, an attacker could exploit this flaw to inject malicious attributes and execute XSS attacks.

This vulnerability is a bypass of the incomplete fix for CVE-2024-22195, which only addressed spaces but not other dangerous characters. The Pallets project has explicitly stated that accepting keys as user input is now considered an unintended use case of the xmlattr filter.

Critical Impact

Applications using Jinja's xmlattr filter that accept user-controlled keys can be exploited to perform XSS attacks, potentially leading to session hijacking, credential theft, or malicious content injection affecting other users.

Affected Products

  • Palletsprojects Jinja versions prior to 3.1.4
  • Fedoraproject Fedora 39
  • Fedoraproject Fedora 40

Discovery Timeline

  • 2024-05-06 - CVE-2024-34064 published to NVD
  • 2025-11-03 - Last updated in NVD database

Technical Details for CVE-2024-34064

Vulnerability Analysis

The xmlattr filter in Jinja is designed to convert Python dictionaries into XML/HTML attribute strings for use in templates. The vulnerability stems from insufficient validation of attribute key characters. While the previous fix for CVE-2024-22195 added validation to reject keys containing whitespace, it failed to account for other characters that have special meaning in HTML attribute parsing contexts.

According to the HTML specification's attribute name state, characters such as / (solidus), > (greater-than sign), and = (equals sign) can cause the parser to transition from processing an attribute name to processing a value or starting a new element. When user-controlled input is used as attribute keys without proper sanitization, attackers can craft malicious inputs that break out of the intended attribute context and inject arbitrary attributes, including event handlers that execute JavaScript code.

The attack requires user interaction, as victims must visit a page containing the attacker's injected payload. Successful exploitation can result in unauthorized disclosure of sensitive information and limited integrity impact through content manipulation.

Root Cause

The root cause is improper input validation in the xmlattr filter's key processing logic. The original regular expression only checked for whitespace characters but did not validate against other characters that have special meaning in HTML attribute parsing. The regex pattern r"\s" was insufficient and needed to be expanded to r"[\s/>=]" to properly reject all characters that could be used to escape the attribute context.

Attack Vector

The attack vector is network-based and requires an application that:

  1. Uses Jinja's xmlattr filter to generate HTML attributes
  2. Accepts user input as attribute keys (not just values)
  3. Renders the output in pages viewable by other users

An attacker can submit specially crafted key values containing characters like /, >, or = to break out of the attribute context and inject malicious attributes such as onclick, onmouseover, or other JavaScript event handlers.

The security patch updated the validation regex in src/jinja2/filters.py:

python
# Check for characters that would move the parser state from key to value.
# https://html.spec.whatwg.org/#attribute-name-state
_attr_key_re = re.compile(r"[\s/>=]", flags=re.ASCII)

Source: GitHub Commit

The changelog documents the fix:

text
+   The ``xmlattr`` filter does not allow keys with ``/`` solidus, ``>``
+    greater-than sign, or ``=`` equals sign, in addition to disallowing spaces.
+    Regardless of any validation done by Jinja, user input should never be used
+    as keys to this filter, or must be separately validated first.
+    GHSA-h75v-3vvj-5mfj

Source: GitHub Commit

Detection Methods for CVE-2024-34064

Indicators of Compromise

  • Unusual HTTP requests containing special characters (/, >, =) in parameter values that are used as dictionary keys in templates
  • Web application logs showing attribute injection patterns in user-supplied data
  • Client-side JavaScript execution from unexpected attribute event handlers

Detection Strategies

  • Review application code for uses of the xmlattr filter where user input is used as dictionary keys rather than values
  • Implement Web Application Firewall (WAF) rules to detect attribute injection patterns in request parameters
  • Use static application security testing (SAST) tools to identify vulnerable xmlattr usage patterns in Jinja templates

Monitoring Recommendations

  • Monitor web application logs for suspicious patterns indicating XSS attack attempts targeting attribute contexts
  • Implement Content Security Policy (CSP) headers to detect and block unauthorized script execution
  • Deploy runtime application self-protection (RASP) solutions to detect attribute injection attacks

How to Mitigate CVE-2024-34064

Immediate Actions Required

  • Upgrade Jinja to version 3.1.4 or later immediately
  • Audit all uses of the xmlattr filter in your codebase to identify instances where user input is passed as keys
  • Implement server-side input validation to reject user-supplied attribute keys containing dangerous characters

Patch Information

The vulnerability is fixed in Jinja version 3.1.4. The patch modifies the xmlattr filter to reject keys containing /, >, or = characters in addition to the previously disallowed whitespace characters. Security advisories and patches are available through the GitHub Security Advisory and the official commit.

Fedora users should apply updates from the Fedora Package Announcements for their respective distributions.

Workarounds

  • Never use user-supplied input as keys to the xmlattr filter; only use it for values
  • If user-controlled keys are required, implement strict allowlist validation before passing to xmlattr
  • Apply Content Security Policy headers to mitigate the impact of successful XSS attacks
bash
# Upgrade Jinja to the patched version
pip install --upgrade Jinja2>=3.1.4

# Verify the 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 Score5.4

  • EPSS Probability1.15%

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

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Debian LTS Announcement
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-h75v-3vvj-5mfj
  • Related CVEs
  • CVE-2025-27516

  • CVE-2024-56326

  • CVE-2024-56201

  • CVE-2024-22195
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