# CVE-2021-28965: REXML round-trip instability

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 4.45% (percentile 92, 2026-11-26)
- **CWE:** CWE-115, CWE-611
- **Aliases:** BIT-ruby-2021-28965, BIT-ruby-min-2021-28965, GHSA-8cr8-4vfw-mr7h
- **Published:** 2021-04-21T06:55:24.000Z
- **Modified:** 2026-06-17T03:47:05.853Z

## Who should check

- Projects that depend on RubyGems package rexml (\< 3.2.5)
- Anyone running n/a (versions: see the vendor advisory)

## 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

- RubyGems `rexml`: affected \< 3.2.5; fixed 3.2.5 (osv)
- n/a: see vendor advisory (nvd)

## Mitigation

- Upgrade rexml to 3.2.5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

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

## References

- vendor: <https://www.ruby-lang.org/en/news/2021/04/05/xml-round-trip-vulnerability-in-rexml-cve-2021-28965/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WTVFTLFVCSUE5CXHINJEUCKSHU4SWDMT/>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-28965>
- patch: <https://github.com/ruby/rexml/commit/2fe62e29094d95921d7e19abbd2e26b23d78dc5b>
- patch: <https://github.com/ruby/rexml/commit/3c137eb119550874b2b3e27d12b733ca67033377>
- patch: <https://github.com/ruby/rexml/commit/6a250d2cd1194c2be72becbdd9c3e770aa16e752>
- patch: <https://github.com/ruby/rexml/commit/9b311e59ae05749e082eb6bbefa1cb620d1a786e>
- patch: <https://github.com/ruby/rexml/commit/a659c63e37414506dfb0d4655e031bb7a2e73fc8>
- patch: <https://github.com/ruby/rexml/commit/f7bab8937513b1403cea5aff874cbf32fd5e8551>
- patch: <https://github.com/ruby/rexml/commit/f9d88e4948b4a43294c25dc0edb16815bd9d8618>
- other: <https://security.netapp.com/advisory/ntap-20210528-0003/>
- other: <https://hackerone.com/reports/1104077>
- other: <https://github.com/ruby/rexml>
- other: <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rexml/CVE-2021-28965.yml>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WTVFTLFVCSUE5CXHINJEUCKSHU4SWDMT>
- other: <https://rubygems.org/gems/rexml>
- other: <https://security.netapp.com/advisory/ntap-20210528-0003>
- other: <https://www.ruby-lang.org/en/news/2021/04/05/xml-round-trip-vulnerability-in-rexml-cve-2021-28965>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-28965>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-8cr8-4vfw-mr7h> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-28965> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-28965>
