CVE-2021-28965
REXML round-trip instability
Also known as BIT-ruby-2021-28965, BIT-ruby-min-2021-28965, GHSA-8cr8-4vfw-mr7h
Mitigation
- Upgrade rexml to 3.2.5 or later.
Who should check
- Projects that depend on RubyGems package rexml (< 3.2.5)
- Anyone running n/a (versions: see the vendor advisory)
Vulnerability facts
- Affected
- rexml < 3.2.5
- Fixed in
- 3.2.5
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 7.5 (v3.1, NVD)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: High
- Availability impact: None
- EPSS
- 4.45% chance of exploitation in 30 days (percentile 92, 2026-11-26)
- CWE
- CWE-115, CWE-611
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| RubyGems rexml | < 3.2.5 | 3.2.5 | osv |
| n/a | — | — | nvd |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-28965. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-28965.md Affected: rexml < 3.2.5 Fixed in: 3.2.5 Steps: 1. Search this machine and project for rexml (RubyGems), n/a: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
- https://github.com/ruby/rexml/commit/2fe62e29094d95921d7e19abbd2e26b23d78dc5b
- https://github.com/ruby/rexml/commit/3c137eb119550874b2b3e27d12b733ca67033377
- https://github.com/ruby/rexml/commit/6a250d2cd1194c2be72becbdd9c3e770aa16e752
- https://github.com/ruby/rexml/commit/9b311e59ae05749e082eb6bbefa1cb620d1a786e
- https://github.com/ruby/rexml/commit/a659c63e37414506dfb0d4655e031bb7a2e73fc8
- https://github.com/ruby/rexml/commit/f7bab8937513b1403cea5aff874cbf32fd5e8551
- https://github.com/ruby/rexml/commit/f9d88e4948b4a43294c25dc0edb16815bd9d8618
Other
- https://security.netapp.com/advisory/ntap-20210528-0003/
- https://hackerone.com/reports/1104077
- https://github.com/ruby/rexml
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rexml/CVE-2021-28965.yml
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WTVFTLFVCSUE5CXHINJEUCKSHU4SWDMT
- https://rubygems.org/gems/rexml
- https://security.netapp.com/advisory/ntap-20210528-0003
- https://www.ruby-lang.org/en/news/2021/04/05/xml-round-trip-vulnerability-in-rexml-cve-2021-28965
FAQ
Is CVE-2021-28965 being exploited?
There is no confirmed exploitation: CVE-2021-28965 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 4.45% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-28965?
High: CVSS 7.5 (v3.1, scored by NVD). Remote, no login needed.
Which versions are affected by CVE-2021-28965?
rexml < 3.2.5.
Is there a fix for CVE-2021-28965?
Yes. Fixed in 3.2.5. Upgrade rexml to 3.2.5 or later.
How do I check if I'm affected by CVE-2021-28965?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.