DoS Vulnerability in REXML Package: ruby-rexml Affected by Entity Expansion Attack
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for ruby-rexml.