Denial of Service Vulnerability in REXML Gem 3.3.2 for Ruby Packages

ruby-rexml Updated 02 Oct 2025

Summary

01/08/2024
N/A
Yes i
High
7.5

CVE-2024-41946: REXML is an XML toolkit for Ruby. Affects ruby-rexml across 2 version ranges.

< 3.3.9-r0 < 033d1909a8f259d5a7c53681bcaf14f13bcf0368

Fixed in 3.3.9-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

REXML is an XML toolkit for Ruby, widely used for parsing and manipulating XML documents. It provides a simple and efficient way to handle XML data, making it a popular choice among Ruby developers. However, the REXML gem version 3.3.2 has been identified to have a critical vulnerability that can lead to Denial of Service (DoS) when processing XML files with excessive entity expansions.

Vulnerability Detail

The vulnerability in REXML arises from its handling of XML documents that contain numerous entity expansions. When using the SAX2 or pull parser API, an attacker can craft a malicious XML file that exploits this flaw, leading to resource exhaustion and potentially crashing the application. This vulnerability is particularly concerning as it can be triggered with minimal input, making it easy for attackers to launch a DoS attack.

How To Fix

Minimum fixed version

3.3.9-r0

This is the first release that contains the fix.

sudo apk add --upgrade ruby-rexml

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading is not immediately possible, a temporary workaround is to implement input validation to restrict the processing of XML files that may contain excessive entity expansions. This can help reduce the risk of triggering the vulnerability until a proper fix is applied.

Conclusion

The REXML gem version 3.3.2 has a critical Denial of Service vulnerability that can be exploited through malicious XML files. Upgrading to version 3.3.3 or later is essential to protect your applications from potential attacks. Implementing input validation can serve as a temporary measure until the upgrade is completed.

See every vulnerability recorded for ruby-rexml →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

REXML gem version 3.3.2 is affected by this vulnerability. Versions 3.3.3 and later have the patch.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By using the Vulert playground, you can check if your application is affected by this vulnerability without any signup.

The primary impact of this vulnerability is Denial of Service (DoS), which can lead to application crashes and unavailability for users.

Yes, implementing input validation to restrict XML processing can help mitigate the risk until you can upgrade to a secure version.

Related vulnerabilities

Recent vulnerabilities recorded for ruby-rexml.

How To Fix

Minimum fixed version

3.3.9-r0

This is the first release that contains the fix.

sudo apk add --upgrade ruby-rexml

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback