CVE-2024-43398: Rexml Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-vmwr-mc7x-5vc3
CVSS 5.9
CWE-776
Published
Advisory Summary

CVE-2024-43398 is a HIGH (CVSS 5.9) denial of service vulnerability (CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) affecting Rexml libraries in the RubyGems ecosystem. The issue involves rexml denial of service vulnerability. Remediation is available by upgrading affected packages to version 3.3.6.

CVE-2024-43398 at a Glance

CVE Identifier CVE-2024-43398
GHSA Identifier GHSA-vmwr-mc7x-5vc3
Severity HIGH
CVSS v3.1 Base Score 5.9
CWE Classification CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
Affected Product Rexml
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2024-43398

To remediate this vulnerability, upgrade all affected Rexml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rexml fixed: 3.3.6
Upgrade rexml to 3.3.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rexml

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-43398, inspect your project dependencies for Rexml:

inspect dependencies for rexml

Analyze the terminal output to locate any version of Rexml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.6), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion'), where 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. In Rexml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 * https://www.ruby-lang.org/en/news/2024/08/22/dos-rexml-cve-2024-43398/ : An announce on www.ruby-lang.org

CVE-2024-43398 Affected Rexml Versions

1 component(s)
Fixed Versions:
3.3.6
Product / Package Ecosystem Affected Versions Fixed Version
rexml
RubyGems
< 3.3.6
3.3.6

References

Frequently Asked Questions

What is CVE-2024-43398?
CVE-2024-43398 is a security vulnerability in Rexml involving REXML denial of service vulnerability under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion').
Which Rexml versions are affected?
Affected versions include releases prior to 3.3.6 across affected packages: rexml.
What version fixes CVE-2024-43398?
Upgrading to 3.3.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rexml affected?
Yes, rexml is affected in releases prior to 3.3.6. Upgrade your dependency to 3.3.6 or later.
What is the CVSS score of CVE-2024-43398?
CVE-2024-43398 has a CVSS v3.1 base score of 5.9 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-43398?
CVE-2024-43398 is classified under 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 can I check RubyGems dependencies for CVE-2024-43398?
Run the dependency tree command: 'inspect dependencies for rexml'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vmwr-mc7x-5vc3",
  "modified" : "2025-11-03T22:47:47Z",
  "published" : "2024-08-22T16:40:46Z",
  "aliases" : [ "CVE-2024-43398" ],
  "summary" : "REXML denial of service vulnerability",
  "details" : "### Impact\n\nThe 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.\n\nIf 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.\n\n### Patches\n\nThe REXML gem 3.3.6 or later include the patch to fix the vulnerability.\n\n### Workarounds\n\nDon't parse untrusted XMLs with tree parser API.\n\n### References\n\n* https://www.ruby-lang.org/en/news/2024/08/22/dos-rexml-cve-2024-43398/ : An announce on www.ruby-lang.org",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rexml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rexml/security/advisories/GHSA-vmwr-mc7x-5vc3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-43398"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rexml/commit/7cb5eaeb221c322b9912f724183294d8ce96bae3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/rexml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rexml/releases/tag/v3.3.6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rexml/CVE-2024-43398.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/01/msg00011.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20250103-0006"
  }, {
    "type" : "WEB",
    "url" : "https://www.ruby-lang.org/en/news/2024/08/22/dos-rexml-cve-2024-43398"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-776" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-22T16:40:46Z",
    "nvd_published_at" : "2024-08-22T15:15:16Z"
  }
}