DoS Vulnerability in REXML Package: ruby-rexml Affected by Entity Expansion Attack

ruby-rexml Updated 02 Oct 2025

Summary

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

ALPINE-CVE-2024-41946: REXML is an XML toolkit for Ruby. Affects ruby-rexml versions < 3.3.9-r0. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

REXML is an XML toolkit for Ruby, widely used for parsing and manipulating XML data. It provides a simple and efficient way to handle XML documents, making it a popular choice among Ruby developers. However, the REXML gem has been found 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, identified as CVE-2024-41946, exists in REXML versions prior to 3.3.3. It arises when the parser processes XML documents containing numerous entity expansions using the SAX2 or pull parser API. This can lead to resource exhaustion, causing the application to crash or become unresponsive. The severity of this vulnerability is reflected in its CVSS score of 7.5, indicating a high risk to applications relying on this library.

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 immediate updating is not feasible, consider implementing input validation to restrict the XML documents being processed. This can help mitigate the risk of triggering the vulnerability until a proper update can be applied.

Conclusion

The REXML vulnerability (CVE-2024-41946) poses a significant risk to applications using the ruby-rexml package. It is crucial to update to the latest version to protect against potential Denial of Service attacks. Regular monitoring and vulnerability management practices, such as using tools like Vulert, can help maintain application security.

See every vulnerability recorded for ruby-rexml →

Share this vulnerability

FAQ

The vulnerability is a Denial of Service (DoS) issue caused by excessive entity expansions in XML documents, which can exhaust system resources.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

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

Update the ruby-rexml package to version 3.3.3 or later to mitigate the vulnerability.

Implementing input validation on XML documents can serve as a temporary workaround until the package is updated.

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