CVE-2021-28965 — Vulnerability in rexml — CVE Details
REXML round-trip instability
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (4.45%). Schedule for your next planned update.
Does your project use an affected rexml version?
Paste your Gemfile.lock to check it for CVE-2021-28965 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
The REXML gem before 3.2.5 in Ruby before 2.6.7, 2.7.x before 2.7.3, and 3.x before 3.0.1 does not properly address XML round-trip issues. An incorrect document can be produced after parsing and serializing.
Advisory Timeline
- First published April 30, 2021 (2036 days ago).
- Last revised January 27, 2025 — 1368 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install rexml -v 3.2.5
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| rexml RubyGems · Affected: 3.1.7.3, 3.1.8, 3.1.9, 3.1.9.1 (+5 more) | 3.2.5 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-115
- CWE-611XML External Entity (XXE)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-28965ADVISORY
- https://github.com/ruby/rexml/commit/2fe62e29094d95921d7e19abbd2e26b23d78dc5bWEB
- https://github.com/ruby/rexml/commit/3c137eb119550874b2b3e27d12b733ca67033377WEB
- https://github.com/ruby/rexml/commit/6a250d2cd1194c2be72becbdd9c3e770aa16e752WEB
- https://github.com/ruby/rexml/commit/9b311e59ae05749e082eb6bbefa1cb620d1a786eWEB
- https://github.com/ruby/rexml/commit/a659c63e37414506dfb0d4655e031bb7a2e73fc8WEB
- https://github.com/ruby/rexml/commit/f7bab8937513b1403cea5aff874cbf32fd5e8551WEB
- https://github.com/ruby/rexml/commit/f9d88e4948b4a43294c25dc0edb16815bd9d8618WEB
- https://hackerone.com/reports/1104077WEB
- https://github.com/ruby/rexmlPACKAGE
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rexml/CVE-2021-28965.ymlWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WTVFTLFVCSUE5CXHINJEUCKSHU4SWDMTWEB
- https://rubygems.org/gems/rexmlWEB
- https://security.netapp.com/advisory/ntap-20210528-0003WEB
- https://www.ruby-lang.org/en/news/2021/04/05/xml-round-trip-vulnerability-in-rexml-cve-2021-28965WEB
Frequently Asked Questions
- What is CVE-2021-28965?
- REXML round-trip instability. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2021-28965?
- CVE-2021-28965 affects rexml. It has a 4.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-28965 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top 10% of EPSS-scored vulnerabilities — 92.2% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2026-126366HIGH
msgpack-ruby JRuby decoder makes uncapped header-count allocations; a 5-byte message forces multi-GiB OOM
- CVE-2024-43398HIGH
REXML denial of service vulnerability
- CVE-2026-126081HIGH
Action Pack: Possible Strong Parameters Bypass in Parameters#each_key
- CVE-2024-49761MEDIUM
REXML ReDoS vulnerability
- CVE-2024-41946MEDIUM
REXML DoS vulnerability
- CVE-2024-41123MEDIUM
REXML DoS vulnerability
- CVE-2024-35176MEDIUM
REXML contains a denial of service vulnerability