Skip to content

GHSA-vmwr-mc7x-5vc3 CVE-2024-43398

REXML denial of service vulnerability

Medium RubyGems
Severity
0.0 / 10
Medium · CVSS 4.0
Exploit chance (EPSS)
1.21%
Chance of exploitation in the next 30 days. Higher than 68.30% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-776 Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
Fix
3.3.6
Upgrade rexml to this version or later

Description

Impact

The REXML gem before 3.3.6 has a DoS vulnerability when it parses an XML that has many deep elements that have same local name attributes.

If you need to parse untrusted XMLs with tree parser API like REXML::Document.new, you may be impacted to this vulnerability. If you use other parser APIs such as stream parser API and SAX2 parser API, this vulnerability is not affected.

Patches

The REXML gem 3.3.6 or later include the patch to fix the vulnerability.

Workarounds

Don't parse untrusted XMLs with tree parser API.

References

Affected versions

RubyGems

PackageVulnerableFixed in
rexml
< 3.3.6
3.3.6

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.6

bundler
bundle update rexml # Gemfile: gem "rexml", ">= 3.3.6"

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Attack vector
Network
Attack complexity
Low
Attack requirements
Present
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
None
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

CVSS 3.1 5.9

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')

The product uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.

How to prevent it
  • Operation: If possible, prohibit the use of DTDs or use an XML parser that limits the expansion of recursive DTD entities.
  • Implementation: Before parsing XML files with associated DTDs, scan for recursive entity declarations and do not continue parsing potentially explosive content.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
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-5866-49gr-22v4
REXML DoS vulnerability
High Also affects rexml
GHSA-r55c-59qm-vjw6
REXML DoS vulnerability
High Also affects rexml
GHSA-4xqq-m2hx-25v8
REXML denial of service vulnerability
Medium 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-3x94-m842-937c
PhpSpreadsheet: XmlScanner Bypass via ISO-2022 Escape Sequences Allows XXE and Denial of Service
High Same weakness, CWE-776
Is this in your code?

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