GHSA-4xqq-m2hx-25v8 CVE-2024-39908
REXML denial of service vulnerability
- Severity
- 0.0 / 10
- Medium · CVSS 4.0
- Exploit chance (EPSS)
- 1.49%
- Chance of exploitation in the next 30 days. Higher than 74.16% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-400 Uncontrolled Resource Consumption
- Fix
3.3.2- Upgrade rexml to this version or later
Description
Impact
The REXML gem before 3.3.1 has some DoS vulnerabilities when it parses an XML that has many specific characters such as <, 0 and %>.
If you need to parse untrusted XMLs, you may be impacted to these vulnerabilities.
Patches
The REXML gem 3.3.2 or later include the patches to fix these vulnerabilities.
Workarounds
Don't parse untrusted XMLs.
References
- https://github.com/ruby/rexml/security/advisories/GHSA-vg3r-rm7w-2xgh : This is a similar vulnerability
- https://www.ruby-lang.org/en/news/2024/07/16/dos-rexml-cve-2024-39908/
Affected versions
RubyGems
| Package | Vulnerable | Fixed in |
|---|---|---|
| rexml | < 3.3.2 |
3.3.2 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
rexml RubyGems → 3.3.2
- bundler
bundle update rexml # Gemfile: gem "rexml", ">= 3.3.2"
Severity breakdown
CVSS 4.0 0.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- None
- Integrity (vulnerable system)
- None
- Availability (vulnerable system)
- Low
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
CVSS 3.1 4.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Weakness
CWE-400: Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource.
How to prevent it
- Architecture and Design: Design throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
- Architecture and Design: Mitigation of resource exhaustion attacks requires that the target system either: recognizes the attack and denies that user further access for a given amount of time, or uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed. The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question. The second solution is simply difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.
- Architecture and Design: Ensure that protocols have specific limits of scale placed on them.
- Implementation: Ensure that all failures in resource allocation place the system into a safe posture.
References
Advisories
Packages
Other links
- github.com/ruby/rexml/security/advisories/GHSA-4xqq-m2hx-25v8
- github.com/ruby/rexml/releases/tag/v3.3.2
- github.com/rubysec/ruby-advisory-db/blob/master/gems/rexml/CVE-2024-39908.yml
- lists.debian.org/debian-lts-announce/2025/01/msg00011.html
- security.netapp.com/advisory/ntap-20250117-0008
- ruby-lang.org/en/news/2024/07/16/dos-rexml-cve-2024-39908
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-r55c-59qm-vjw6 REXML DoS vulnerability | High | Linked by the source |
| GHSA-c2f4-jgmc-q2r5 REXML has DoS condition when parsing malformed XML file | Medium | Also affects rexml |
| GHSA-2rxp-v6pw-ch6m REXML ReDoS vulnerability | High | Also affects rexml |
| GHSA-vmwr-mc7x-5vc3 REXML denial of service vulnerability | Medium | Also affects rexml |
| GHSA-5866-49gr-22v4 REXML DoS vulnerability | High | Also affects rexml |
| GHSA-vg3r-rm7w-2xgh REXML contains a denial of service vulnerability | Medium | Also affects rexml |
| GHSA-8cr8-4vfw-mr7h REXML round-trip instability | High | Also affects rexml |
| GHSA-cggf-277g-3q54 pypdf has possible large memory usage when parsing page tree | High | Same weakness, CWE-400 |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor