Vulnerabilities in pkg:gem/rexml

PACKAGE
Advisory Identifier: GHSA-2rxp-v6pw-ch6m
Advisory Summary

CVE-2024-49761 is a MODERATE (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Rexml libraries in the RubyGems ecosystem. The issue involves rexml redos vulnerability. Remediation is available by upgrading affected packages to version 3.3.9.

8 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/rexml

8 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/rexml. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-2rxp-v6pw-ch6m CVE-2024-49761 MODERATE REXML ReDoS vulnerability
GHSA-vmwr-mc7x-5vc3 CVE-2024-43398 HIGH REXML denial of service vulnerability
GHSA-5866-49gr-22v4 CVE-2024-41946 MODERATE REXML DoS vulnerability
GHSA-r55c-59qm-vjw6 CVE-2024-41123 MODERATE REXML DoS vulnerability
GHSA-4xqq-m2hx-25v8 CVE-2024-39908 MODERATE REXML denial of service vulnerability
GHSA-vg3r-rm7w-2xgh CVE-2024-35176 MODERATE REXML contains a denial of service vulnerability
GHSA-c2f4-jgmc-q2r5 CVE-2025-58767 LOW REXML has DoS condition when parsing malformed XML file
GHSA-8cr8-4vfw-mr7h CVE-2021-28965 HIGH REXML round-trip instability

CVE-2024-49761 at a Glance

CVE Identifier CVE-2024-49761
GHSA Identifier GHSA-2rxp-v6pw-ch6m
Severity MODERATE
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Rexml
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
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-49761

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.9
Upgrade rexml to 3.3.9
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-49761, 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.9), 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-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. 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.9 has a ReDoS vulnerability when it parses an XML that has many digits between `&#` and `x...;` in a hex numeric character reference (`&#x...;`). This does not happen with Ruby 3.2 or later. Ruby 3.1 is the only affected maintained Ruby. Note that Ruby 3.1 will reach EOL on 2025-03. ### Patches The REXML gem 3.3.9 or later include the patch to fix the vulnerability. ### Workarounds Use Ruby 3.2 or later instead of Ruby 3.1. ### References * https://www.ruby-lang.org/en/news/2024/10/28/redos-rexml-cve-2024-49761/: An announce on www.ruby-lang.org

CVE-2024-49761 Affected Rexml Versions

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

References

Frequently Asked Questions

What is CVE-2024-49761?
CVE-2024-49761 is a security vulnerability in Rexml involving REXML ReDoS vulnerability under CWE-1333: Inefficient Regular Expression Complexity.
Which Rexml versions are affected?
Affected versions include releases prior to 3.3.9 across affected packages: rexml.
What version fixes CVE-2024-49761?
Upgrading to 3.3.9 (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.9. Upgrade your dependency to 3.3.9 or later.
What is the CVSS score of CVE-2024-49761?
CVE-2024-49761 has a CVSS v3.1 base score of 7.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-49761?
CVE-2024-49761 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check RubyGems dependencies for CVE-2024-49761?
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-2rxp-v6pw-ch6m",
  "modified" : "2025-11-03T22:49:25Z",
  "published" : "2024-10-28T14:10:18Z",
  "aliases" : [ "CVE-2024-49761" ],
  "summary" : "REXML ReDoS vulnerability",
  "details" : "### Impact\n\nThe REXML gem before 3.3.9 has a ReDoS vulnerability when it parses an XML that has many digits between `&#` and `x...;` in a hex numeric character reference (`&#x...;`).\n\nThis does not happen with Ruby 3.2 or later. Ruby 3.1 is the only affected maintained Ruby. Note that Ruby 3.1 will reach EOL on 2025-03.\n\n### Patches\n\nThe REXML gem 3.3.9 or later include the patch to fix the vulnerability.\n\n### Workarounds\n\nUse Ruby 3.2 or later instead of Ruby 3.1.\n\n### References\n\n* https://www.ruby-lang.org/en/news/2024/10/28/redos-rexml-cve-2024-49761/: An announce on www.ruby-lang.org",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rexml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rexml/security/advisories/GHSA-2rxp-v6pw-ch6m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-49761"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/rexml/commit/ce59f2eb1aeb371fe1643414f06618dbe031979f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/rexml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rexml/CVE-2024-49761.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/01/msg00011.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20241227-0004"
  }, {
    "type" : "WEB",
    "url" : "https://www.ruby-lang.org/en/news/2024/10/28/redos-rexml-cve-2024-49761"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-28T14:10:18Z",
    "nvd_published_at" : "2024-10-28T15:15:05Z"
  }
}