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

CVE-2022-3704: Ruby on Rails XSS Vulnerability

CVE-2022-3704 is a cross-site scripting flaw in Ruby on Rails affecting the action_dispatch routing template. The vulnerability's validity is disputed by maintainers. This article covers technical details and mitigation.

Published: February 11, 2026

CVE-2022-3704 Overview

A Cross-Site Scripting (XSS) vulnerability has been identified in Ruby on Rails affecting the ActionPack middleware component. The vulnerability exists in the file actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb, where improper handling of innerHTML manipulation could potentially lead to cross-site scripting attacks.

Critical Impact

Disputed Vulnerability - The Rails maintainers have declared that there is no valid attack vector. This issue was reported as a security vulnerability by a non-member of the Rails team, and its real-world exploitability is doubted. However, a preventive patch has been applied to remove innerHTML usage.

Affected Products

  • Ruby on Rails (all versions prior to the patch)
  • ActionPack middleware component
  • Routes template functionality (_table.html.erb)

Discovery Timeline

  • 2022-10-26 - CVE-2022-3704 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-3704

Vulnerability Analysis

This vulnerability involves the use of innerHTML in the routes table template, which could potentially allow self-XSS attacks through manipulated input. The vulnerability is located in the setupMatchPaths() JavaScript function within the routes debugging template. The function used innerHTML to append content when no matching routes were found, which could theoretically be exploited if an attacker could control the content being inserted.

However, it's important to note that the Rails maintainers have disputed the security impact of this vulnerability. According to the official response in GitHub Issue #46244, there is no valid attack vector in practice, as the affected template is only used in development environments for route debugging purposes and the input sources are not attacker-controlled in normal circumstances.

Root Cause

The root cause stems from the use of innerHTML for DOM manipulation in the routes table template. While innerHTML is a common JavaScript method for modifying page content, it can introduce XSS vulnerabilities when used with untrusted data, as it parses and executes any embedded scripts or markup. The vulnerable code pattern replaced section content using innerHTML string concatenation rather than safer DOM manipulation methods.

Attack Vector

The attack requires network access and user interaction. An attacker would need to manipulate the route matching functionality to inject malicious JavaScript that executes when a user views the routes table in development mode. Given that this template is primarily used in development environments and requires authenticated access with low privileges, the practical exploitability is limited.

text
   // Enables path search functionality
   function setupMatchPaths() {
     // Check if there are any matched results in a section
-    function checkNoMatch(section, noMatchText) {
+    function checkNoMatch(section, trElement) {
       if (section.children.length <= 1) {
-        section.innerHTML += noMatchText;
+        section.appendChild(trElement);
       }
     }
 

Source: GitHub Commit Reference

The patch replaces the unsafe innerHTML assignment with the safer appendChild() method, which adds a DOM element directly without parsing HTML strings. This change ensures that any content is treated as a DOM node rather than executable HTML, effectively neutralizing potential XSS vectors.

Detection Methods for CVE-2022-3704

Indicators of Compromise

  • Unusual JavaScript execution in browser developer tools when viewing the routes table in development mode
  • Unexpected DOM modifications in the routes debugging interface
  • Suspicious route entries containing script tags or event handlers

Detection Strategies

  • Review ActionPack template files for usage of innerHTML in JavaScript code
  • Audit Rails applications for custom modifications to the _table.html.erb template
  • Monitor development environment logs for anomalous route table access patterns

Monitoring Recommendations

  • Implement Content Security Policy (CSP) headers to restrict inline script execution
  • Enable browser XSS protection headers for development environments
  • Review application logs for unusual access to the routes debugging endpoint

How to Mitigate CVE-2022-3704

Immediate Actions Required

  • Apply the security patch identified by commit hash be177e4566747b73ff63fd5f529fab564e475ed4
  • Update Ruby on Rails to the latest version that includes this fix
  • Review any customizations made to the ActionPack routes template
  • Ensure development environments are not exposed to untrusted networks

Patch Information

A patch has been released by the Rails team that addresses this issue by replacing innerHTML usage with the safer appendChild() DOM method. The fix is available in GitHub commit be177e4566747b73ff63fd5f529fab564e475ed4. Organizations should apply this patch or update to a Rails version that includes this commit.

Workarounds

  • Restrict access to Rails development routes debugging interface to trusted users only
  • Implement strict Content Security Policy (CSP) headers that disable inline JavaScript
  • Disable the routes debugging template in environments exposed to untrusted users
  • Consider using a reverse proxy to block access to development-only endpoints
bash
# Example: Add CSP header in Rails application
# config/application.rb
config.action_dispatch.default_headers = {
  'Content-Security-Policy' => "default-src 'self'; script-src 'self'"
}

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechRubyonrails

  • SeverityMEDIUM

  • CVSS Score5.4

  • EPSS Probability0.27%

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

  • CWE-79
  • Technical References
  • VulDB #212319
  • Vendor Resources
  • GitHub Commit Reference

  • GitHub Issue Discussion
  • Related CVEs
  • CVE-2026-33170: Ruby on Rails Active Support XSS Vulnerability

  • CVE-2022-32209: Rails Html Sanitizers XSS Vulnerability

  • CVE-2024-53985: Rails HTML Sanitizer XSS Vulnerability

  • CVE-2024-53986: Rails HTML Sanitizer XSS 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