DoS Vulnerability in REXML Package: ruby-rexml Affected by Deep Element Parsing Issue

ruby-rexml Updated 02 Oct 2025

Summary

22/08/2024
N/A
Yes i
Unrated
Not published

ALPINE-CVE-2024-43398: 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

REXML is an XML toolkit for Ruby, widely used for parsing and manipulating XML documents. It provides a simple and intuitive API for developers to work with XML data. However, prior to version 3.3.6, REXML was susceptible to a Denial of Service (DoS) vulnerability when parsing XML documents with deeply nested elements that share the same local name attributes. This vulnerability can lead to performance degradation or application crashes when handling untrusted XML inputs.

Vulnerability Detail

The vulnerability arises from the way REXML processes XML documents with many deep elements that have identical local name attributes. Attackers can craft malicious XML files that exploit this flaw, potentially causing the application to hang or crash while parsing. This issue is particularly concerning for applications that rely on REXML for parsing untrusted XML data, as it can lead to service interruptions and degraded user experience.

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 using alternative XML parsing APIs such as the stream parser API or SAX2 parser API, which are not affected by this vulnerability. This can help mitigate the risk while you plan for an upgrade.

Conclusion

The REXML package in Ruby has a critical DoS vulnerability that can affect applications parsing untrusted XML data. It is essential to update to version 3.3.6 or later to mitigate this risk. Additionally, consider using alternative parsing methods as a temporary workaround. Tools like Vulert can help monitor your application for such vulnerabilities.

See every vulnerability recorded for ruby-rexml →

Share this vulnerability

FAQ

The vulnerability is a Denial of Service (DoS) issue that occurs when REXML parses XML documents with many deeply nested elements sharing the same local name attributes.

If your application uses REXML versions prior to 3.3.6 and processes untrusted XML data, it may be vulnerable. You can check your application's dependencies using tools like Vulert.

Exploiting this vulnerability can lead to application crashes or performance issues, particularly when handling complex XML documents.

Yes, you can use Vulert to monitor and alert for open-source vulnerabilities in your software without needing to access the code directly.

As a temporary measure, consider using alternative XML parsing methods that are not affected by this vulnerability, such as stream or SAX2 parsing.

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