CVE-2025-58767: REXML has DoS condition when parsing malformed XML file
Impact The REXML gems from 3.3.3 to 3.4.1 have a DoS vulnerability when parsing XML containing multiple XML declarations. If you need to parse untrusted XMLs, you may be impacted to these vulnerabilities. Patches REXML gems 3.4.2 or later include the patches to fix these vulnerabilities. Workarounds Don't parse untrusted XMLs.
Published Sep 17, 2025 · Updated Sep 19, 2025
Affected packages
rexml
- Ecosystem
- RubyGems
- Affected
- >= 3.3.3, <= 3.4.1
- Fixed in
- 3.4.2
- Check
bundle info rexml
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
The REXML gems from 3.3.3 to 3.4.1 have a DoS vulnerability when parsing XML containing multiple XML declarations. If you need to parse untrusted XMLs, you may be impacted to these vulnerabilities.
Patches
REXML gems 3.4.2 or later include the patches to fix these vulnerabilities.
Workarounds
Don't parse untrusted XMLs.
References
- https://www.ruby-lang.org/en/news/2025/09/18/dos-rexml-cve-2025-58767/ : An announcement on www.ruby-lang.org
Credited to sofiaaberegg.
References
- https://github.com/ruby/rexml/security/advisories/GHSA-c2f4-jgmc-q2r5
- https://github.com/ruby/rexml/commit/5859bdeac792687eaf93d8e8f0b7e3c1e2ed5c23
- https://www.ruby-lang.org/en/news/2025/09/18/dos-rexml-cve-2025-58767
- https://nvd.nist.gov/vuln/detail/CVE-2025-58767
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rexml/CVE-2025-58767.yml
- https://github.com/advisories/GHSA-c2f4-jgmc-q2r5
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More RubyGems vulnerabilities
All RubyGems entriesCVE-2024-49761
REXML ReDoS vulnerability
medium7.5Oct 28, 2024CVE-2024-43398
REXML denial of service vulnerability
high5.9Aug 22, 2024CVE-2024-41946
REXML DoS vulnerability
medium7.5Aug 2, 2024CVE-2024-41123
REXML DoS vulnerability
medium7.5Aug 1, 2024CVE-2024-39908
REXML denial of service vulnerability
medium4.3Jul 16, 2024CVE-2024-35176
REXML contains a denial of service vulnerability
medium5.3May 16, 2024
