Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2021-28965

CVE-2021-28965: Ruby-lang Rexml XXE Vulnerability

CVE-2021-28965 is an XXE vulnerability in Ruby-lang Rexml that causes XML round-trip issues, producing incorrect documents after parsing. This article covers technical details, affected Ruby versions, and mitigation.

Published: March 6, 2026

CVE-2021-28965 Overview

CVE-2021-28965 is an XML round-trip vulnerability in the REXML gem, a pure Ruby XML processing library bundled with Ruby. The vulnerability exists in REXML versions before 3.2.5 and affects Ruby versions before 2.6.7, 2.7.x before 2.7.3, and 3.x before 3.0.1. When an XML document is parsed and then serialized back to XML, the resulting document may differ from the original, potentially producing an incorrect document that could bypass security controls or corrupt data integrity.

Critical Impact

Applications relying on REXML for XML parsing and serialization may produce incorrect documents, potentially leading to data integrity issues, security bypass scenarios, or application logic errors when processed downstream.

Affected Products

  • Ruby-lang REXML (versions before 3.2.5)
  • Ruby-lang Ruby (versions before 2.6.7, 2.7.x before 2.7.3, 3.x before 3.0.1)
  • Fedora Project Fedora 34

Discovery Timeline

  • 2021-04-05 - Ruby-lang publishes security advisory
  • 2021-04-21 - CVE CVE-2021-28965 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-28965

Vulnerability Analysis

This vulnerability stems from improper handling of XML round-trip operations within the REXML library. XML round-tripping refers to the process of parsing an XML document into an internal representation and then serializing it back to XML format. In a secure implementation, this process should be idempotent—the output should faithfully represent the original input structure and content.

The flaw in REXML causes the library to produce an incorrect document after the parse-and-serialize cycle. This non-idempotent behavior can have significant security implications, particularly in scenarios where XML documents are used for authentication, authorization, digital signatures, or data exchange between systems.

Root Cause

The root cause lies in REXML's internal handling of certain XML constructs during the parsing and serialization phases. The library fails to properly preserve specific XML elements, attributes, or formatting during the round-trip process. This implementation deficiency results in data loss or transformation that changes the semantic meaning of the document.

The vulnerability is categorized as an "Other" weakness type (NVD-CWE-Other), indicating it doesn't fit neatly into standard CWE classifications but represents a fundamental failure in the library's core XML processing functionality.

Attack Vector

The attack vector for this vulnerability is network-based, requiring no privileges or user interaction. An attacker could exploit this vulnerability in scenarios where:

  1. An application accepts XML input from untrusted sources
  2. The application parses the XML using REXML and then re-serializes it
  3. The resulting document is used for security-sensitive operations such as signature verification, access control decisions, or data validation

The vulnerability enables attackers to craft XML documents that, when round-tripped through REXML, produce output that differs from the original in ways that could bypass security controls. For example, a digitally signed XML document might have its signature invalidated after round-tripping, or security-relevant content might be altered.

The vulnerability manifests during the XML parsing and serialization cycle within REXML. When maliciously crafted XML is processed, the library may fail to preserve critical document structure or content. For detailed technical analysis and exploitation scenarios, refer to the Ruby XML Vulnerability Notice.

Detection Methods for CVE-2021-28965

Indicators of Compromise

  • Unexpected differences between incoming XML documents and their serialized outputs in application logs
  • XML signature validation failures in systems that use REXML for XML processing
  • Anomalous XML documents in data pipelines that appear to have been modified during processing

Detection Strategies

  • Audit Ruby application dependencies to identify REXML versions below 3.2.5 using gem list rexml or bundler dependency analysis
  • Review Ruby version across systems to identify installations below 2.6.7, 2.7.3, or 3.0.1 respectively
  • Implement XML input/output comparison testing in development environments to detect round-trip discrepancies
  • Monitor application logs for XML-related errors or unexpected behavior in document processing workflows

Monitoring Recommendations

  • Enable verbose logging for XML processing operations in Ruby applications using REXML
  • Implement integrity checks that compare XML documents before and after REXML processing in sensitive workflows
  • Monitor gem and Ruby version updates across the environment to ensure patched versions are deployed
  • Track security advisories from Ruby-lang for REXML and core Ruby security updates

How to Mitigate CVE-2021-28965

Immediate Actions Required

  • Upgrade REXML gem to version 3.2.5 or later immediately
  • Update Ruby to version 2.6.7, 2.7.3, or 3.0.1 or later depending on your Ruby version branch
  • Review applications that use REXML for XML processing to assess potential impact
  • Consider switching to alternative XML processing libraries such as Nokogiri for security-critical applications

Patch Information

Ruby-lang has released patched versions addressing this vulnerability. The REXML gem version 3.2.5 and later contains the fix. Additionally, Ruby versions 2.6.7, 2.7.3, and 3.0.1 include the updated REXML library. Organizations should upgrade to these versions immediately.

For detailed patch information, refer to the Ruby XML Vulnerability Notice. Fedora users should apply updates via the standard package management system as documented in the Fedora Package Announcement.

Workarounds

  • Implement input validation to sanitize XML documents before processing with REXML
  • Use alternative XML parsing libraries such as Nokogiri that are not affected by this vulnerability
  • Add application-level verification to compare XML documents before and after round-tripping for critical operations
  • Avoid using REXML for security-sensitive XML operations until the system can be patched
bash
# Update REXML gem to patched version
gem update rexml

# Verify installed REXML version
gem list rexml

# Update Ruby to patched version (example using rbenv)
rbenv install 3.0.1
rbenv global 3.0.1

# Verify Ruby version
ruby --version

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

  • Vulnerability Details
  • TypeXXE

  • Vendor/TechRuby

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.36%

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

  • NetApp Security Advisory
  • Vendor Resources
  • Ruby XML Vulnerability Notice
  • Related CVEs
  • CVE-2025-61594: Ruby-lang Uri Information Disclosure Bug

  • CVE-2024-27282: Ruby Regex Information Disclosure Flaw

  • CVE-2024-27280: Ruby StringIO Buffer Overflow Vulnerability

  • CVE-2023-36617: Ruby-lang URI DoS 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