# CVE-2025-58767: REXML has a DoS condition when parsing malformed XML file

> Attackers can cause denial of service in applications using REXML by parsing malformed XML with multiple declarations.

- **Severity:** Low 1.2 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Sep 2025
- **Updated:** 17 Sep 2025
- **Also known as:** ALPINE-CVE-2025-58767, AZL-67611, AZL-67614, BELL-CVE-2025-58767, CLEANSTART-2026-LE84583, CLEANSTART-2026-SZ82695, CLSA-2026-1768814484, DEBIAN-CVE-2025-58767, ECHO-7954-8107-56ba, GHSA-c2f4-jgmc-q2r5, MINI-32f4-q38f-265p, MINI-5f99-r283-2wqp, MINI-5h4w-q34g-h7xr, MINI-6g55-h792-9q8v, MINI-6j48-8p6h-vrc3, MINI-899g-gjvg-6v3r, MINI-8m63-q8qf-32m8, MINI-9m43-p63c-cq92, MINI-c45x-3vgw-5c9v, MINI-f4qj-5987-x4x3, MINI-h2xp-95vc-wm58, MINI-j2vw-xgpx-r8c7, MINI-m86r-qphm-hjq2, MINI-mcmw-6hhq-fqj2, MINI-mcq5-4qg9-w4cg, MINI-qhrq-67q2-75xg, MINI-qrgc-hv33-22vq, MINI-rc45-4v34-5mgr, MINI-w4c2-mq72-v5cx, RHSA-2025:23140, UBUNTU-CVE-2025-58767, openSUSE-SU-2025:15828-1

## What is CVE-2025-58767?

CVE-2025-58767 is a low-severity denial of service vulnerability in ruby rexml, published on 17 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

REXML is an XML toolkit for Ruby. The REXML gems from 3.3.3 to 3.4.1 has a DoS vulnerability when parsing XML containing multiple XML declarations. If you need to parse untrusted XMLs, you may be impacted to these vulnerabilities. The REXML gem 3.4.2 or later include the patches to fix these vulnerabilities.

Weakness: CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2025-58767?

2 open source packages ship an affected version, including rexml. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rexml` | RubyGems | From 3.3.3 | 3.4.2 |
| `rexml` | RubyGems | From 3.3.3 | 3.4.2 |
| `ruby` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-bundled-gems` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-bundled-gems-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-debugsource` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-default-gems` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-devel` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-doc` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-libs` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `ruby-libs-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.3.10-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-bigdecimal` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.1.5-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-bigdecimal-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.1.5-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-bundler` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:2.5.22-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-io-console` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:0.7.1-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-io-console-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:0.7.1-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-irb` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:1.13.1-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-json` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:2.7.2-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-json-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:2.7.2-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-minitest` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.20.0-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-mysql2` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:0.5.5-1.module+el9.4.0+21222+faeeed2f |
| `rubygem-mysql2-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:0.5.5-1.module+el9.4.0+21222+faeeed2f |
| `rubygem-mysql2-debugsource` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:0.5.5-1.module+el9.4.0+21222+faeeed2f |
| `rubygem-mysql2-doc` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:0.5.5-1.module+el9.4.0+21222+faeeed2f |
| `rubygem-pg` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:1.5.4-1.module+el9.4.0+21222+faeeed2f |
| `rubygem-pg-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:1.5.4-1.module+el9.4.0+21222+faeeed2f |
| `rubygem-pg-debugsource` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:1.5.4-1.module+el9.4.0+21222+faeeed2f |
| `rubygem-pg-doc` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:1.5.4-1.module+el9.4.0+21222+faeeed2f |
| `rubygem-power_assert` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:2.0.3-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-psych` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.1.2-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-psych-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:5.1.2-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-racc` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:1.7.3-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-racc-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:1.7.3-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-rake` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:13.1.0-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-rbs` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.4.0-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-rbs-debuginfo` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.4.0-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-rdoc` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:6.6.3.1-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-rexml` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:3.4.4-5.module+el9.4.0+23769+ab06e946 |
| `rubygem-rss` | Red Hat:rhel_eus:9.4::appstream | All versions | 0:0.3.1-5.module+el9.4.0+23769+ab06e946 |

Products: Ruby-Lang Rexml.

## How do I fix CVE-2025-58767?

Upgrade rexml to 3.4.2 or later.

## Is CVE-2025-58767 being exploited?

There is no known exploitation of CVE-2025-58767 in the wild and no public exploit code.

## Other vulnerabilities in ruby rexml

- [CVE-2024-41123](https://insights.sbomify.com/CVE-2024-41123/): REXML DoS vulnerability (medium 5.3)
- [CVE-2024-41946](https://insights.sbomify.com/CVE-2024-41946/): REXML DoS vulnerability (medium 5.3)
- [CVE-2024-35176](https://insights.sbomify.com/CVE-2024-35176/): REXML contains a denial of service vulnerability (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-58767 and fix it if it is affected.

What it is: CVE-2025-58767 is a low-severity denial of service vulnerability in ruby rexml, published on 17 Sep 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-58767 in the wild and no public exploit code.

Affected packages and fixed versions:
- rexml (RubyGems): affected from 3.3.3; fixed in 3.4.2
- rexml (RubyGems): affected from 3.3.3; fixed in 3.4.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-58767/ (Markdown: https://insights.sbomify.com/CVE-2025-58767/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-58767
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-58767
- OSV: https://osv.dev/vulnerability/CVE-2025-58767

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-58767/
Summaries are generated and may contain mistakes; the official description above is the record.
