The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • 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
    • Singularity Identity
      Identity Threat Detection and Response
    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
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • 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
      DFIR, Breach Readiness, & Compromise Assessments
    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
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • 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-2022-34305

CVE-2022-34305: Apache Tomcat XSS Vulnerability

CVE-2022-34305 is a cross-site scripting flaw in Apache Tomcat's Form authentication example that displays unfiltered user data. This post covers the technical details, affected versions, impact, and mitigation.

Published: February 18, 2026

CVE-2022-34305 Overview

CVE-2022-34305 is a Cross-Site Scripting (XSS) vulnerability affecting Apache Tomcat's examples web application. The Form authentication example in the examples web application displays user-provided data without proper filtering or sanitization, allowing attackers to inject malicious scripts that execute in the context of other users' browsers.

Critical Impact

Attackers can exploit this XSS vulnerability to steal session cookies, hijack user sessions, perform actions on behalf of authenticated users, or redirect victims to malicious websites through the vulnerable Form authentication example page.

Affected Products

  • Apache Tomcat 10.1.0-M1 to 10.1.0-M16
  • Apache Tomcat 10.0.0-M1 to 10.0.22
  • Apache Tomcat 9.0.30 to 9.0.64
  • Apache Tomcat 8.5.50 to 8.5.81

Discovery Timeline

  • 2022-06-23 - CVE-2022-34305 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-34305

Vulnerability Analysis

This Cross-Site Scripting vulnerability exists within the Form authentication example bundled with Apache Tomcat's examples web application. The root issue stems from the application's failure to properly sanitize or encode user-supplied input before rendering it back to the browser. When user-provided data is reflected in the HTML response without appropriate output encoding, it creates an opportunity for script injection attacks.

The vulnerability requires user interaction to exploit, as victims must be tricked into visiting a crafted URL or submitting a malicious form. Once triggered, the injected script executes within the security context of the vulnerable Tomcat application, potentially allowing session theft, credential harvesting, or other client-side attacks. The scope is changed, meaning the vulnerability can impact resources beyond its original security scope.

Root Cause

The Form authentication example in Tomcat's examples web application fails to implement proper output encoding for user-provided data. This is a classic reflected XSS pattern (CWE-79) where input from HTTP request parameters or form fields is directly embedded into the HTML response without sanitization. The lack of context-appropriate encoding (HTML entity encoding, JavaScript encoding, etc.) allows attackers to break out of the expected data context and inject executable script content.

Attack Vector

The attack vector is network-based, requiring no authentication or special privileges to exploit. An attacker crafts a malicious URL containing XSS payload targeting the Form authentication example page. The attacker then distributes this URL through phishing emails, social engineering, or by embedding it in other websites. When a victim clicks the link or is redirected to the malicious URL, the Tomcat server reflects the payload without sanitization, causing the victim's browser to execute the attacker's JavaScript code.

The exploitation flow typically involves injecting script tags or event handlers into URL parameters that are subsequently displayed on the authentication example page. The payload executes with the same origin as the Tomcat application, giving it access to cookies, session storage, and the ability to make authenticated requests.

Detection Methods for CVE-2022-34305

Indicators of Compromise

  • Unusual URL patterns in web server logs containing script tags, event handlers (e.g., onerror, onload), or JavaScript protocol handlers targeting the examples web application
  • HTTP requests to /examples/jsp/security/protected/ or related Form authentication example paths with encoded or obfuscated script payloads
  • Client-side error logs showing unexpected JavaScript execution or cross-origin requests originating from Tomcat pages

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect and block common XSS patterns in requests to the Tomcat examples application
  • Monitor web server access logs for requests containing characteristic XSS payload signatures such as <script>, javascript:, or encoded variants targeting example applications
  • Deploy browser-based security headers (Content-Security-Policy) and monitor for policy violations that may indicate XSS attempts

Monitoring Recommendations

  • Enable detailed access logging for the Tomcat examples web application and configure log analysis to flag suspicious request patterns
  • Set up alerts for unusual traffic patterns to the /examples/ directory, particularly the Form authentication example paths
  • Monitor for reports of session hijacking or unauthorized actions that could indicate successful XSS exploitation

How to Mitigate CVE-2022-34305

Immediate Actions Required

  • Upgrade Apache Tomcat to a patched version: 10.1.0-M17 or later for the 10.1.x branch, 10.0.23 or later for the 10.0.x branch, 9.0.65 or later for the 9.0.x branch, or 8.5.82 or later for the 8.5.x branch
  • Remove or disable the examples web application from production Tomcat deployments if not required for operations
  • Implement Content-Security-Policy headers to mitigate the impact of any XSS vulnerabilities

Patch Information

Apache has addressed this vulnerability in subsequent releases. Organizations should upgrade to the fixed versions as documented in the Apache Thread Discussion. Additional security advisories are available from Gentoo GLSA 202208-34 and the NetApp Security Advisory.

Workarounds

  • Remove or undeploy the examples web application (webapps/examples) from all Tomcat instances, especially in production environments
  • If the examples application must remain deployed, restrict access to it using Tomcat's security constraints or firewall rules to limit exposure to trusted networks only
  • Implement a reverse proxy with XSS filtering capabilities in front of Tomcat servers
bash
# Remove the examples web application from Tomcat
rm -rf $CATALINA_HOME/webapps/examples

# Or disable it by removing from server.xml or renaming the directory
mv $CATALINA_HOME/webapps/examples $CATALINA_HOME/webapps/examples.disabled

# Restart Tomcat to apply changes
$CATALINA_HOME/bin/shutdown.sh
$CATALINA_HOME/bin/startup.sh

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechApache Tomcat

  • SeverityMEDIUM

  • CVSS Score6.1

  • EPSS Probability20.87%

  • 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
  • OpenWall Security Mailing List

  • Apache Thread Discussion

  • Gentoo GLSA 202208-34

  • NetApp Security Advisory
  • Related CVEs
  • CVE-2022-45143: Apache Tomcat XSS Vulnerability

  • CVE-2016-20026: ZKTeco ZKBioSecurity RCE Vulnerability

  • CVE-2026-24734: Apache Tomcat Auth Bypass Vulnerability

  • CVE-2025-66614: Apache Tomcat Auth Bypass Vulnerability
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
  • 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

English