# CVE-2025-58058: github.com/ulikunitz/xz leaks memory when decoding a corrupted multiple LZMA archives

> An attacker can cause excessive memory consumption and potential denial of service by providing corrupted LZMA archives to the Go xz library.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Aug 2025
- **Updated:** 29 Aug 2025
- **Also known as:** AZL-66713, AZL-66716, AZL-66720, AZL-66723, AZL-66725, AZL-66728, AZL-66731, AZL-66735, AZL-66741, AZL-66744, AZL-66747, AZL-66750, AZL-66753, AZL-66759, AZL-66762, CLEANSTART-2026-CV85257, CLEANSTART-2026-UK11362, DEBIAN-CVE-2025-58058, GHSA-jc7w-c686-c4v9, GO-2025-3922, MINI-25m5-597x-42cp, MINI-27x9-386c-9fx4, MINI-2hxp-px8v-3f44, MINI-2rjq-464j-rpq2, MINI-37qr-c383-w4px, MINI-44hh-6vj2-rjpf, MINI-4wg6-qcgh-h7hv, MINI-59cc-8g88-j84r, MINI-5rpx-h4gq-846q, MINI-66h2-qmff-p2qf, MINI-66j6-8xc5-mph2, MINI-698g-w7qp-6r65, MINI-6v7c-rcj5-96v6, MINI-6vc4-vrw7-mgr9, MINI-7839-mg7g-ph45, MINI-7cjq-rj25-69g7, MINI-7r5q-rvwc-9v6f, MINI-8823-vm3v-x256, MINI-92w4-m4gv-chw8, MINI-93rw-p4h2-9vrh, MINI-9gxr-xf5r-jpf3, MINI-9qqx-rcr4-wmh3, MINI-f3g2-9v68-pgcf, MINI-f57v-q6hx-wwgp, MINI-f6h7-r3xg-5jr5, MINI-hgpw-4pmg-4v4f, MINI-hr8m-q6xr-2wj7, MINI-j4wm-mr96-9xrv, MINI-m4rq-gh8p-22g5, MINI-m8qr-h74g-9xpj, MINI-mpp4-2gcv-9cpj, MINI-mvrf-6m8c-g9c5, MINI-r57r-2h8w-r2p4, MINI-rhr5-vw3m-897v, MINI-v5pr-jcc5-8h54, MINI-wpgp-w94w-v4rx, MINI-xcj5-ppmq-mvpw, MINI-xrxv-qjjg-g582, SUSE-SU-2025:03448-1, UBUNTU-CVE-2025-58058, openSUSE-SU-2025:15503-1, openSUSE-SU-2025:15509-1, openSUSE-SU-2025:15515-1, openSUSE-SU-2025:15537-1, openSUSE-SU-2025:15542-1, openSUSE-SU-2025:20031-1

## What is CVE-2025-58058?

CVE-2025-58058 is a medium-severity denial of service vulnerability in ulikunitz xz, published on 28 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

xz is a pure golang package for reading and writing xz-compressed files. Prior to version 0.5.14, it is possible to put data in front of an LZMA-encoded byte stream without detecting the situation while reading the header. This can lead to increased memory consumption because the current implementation allocates the full decoding buffer directly after reading the header. The LZMA header doesn't include a magic number or has a checksum to detect such an issue according to the specification. Note that the code recognizes the issue later while reading the stream, but at this time the memory allocation has already been done. This issue has been patched in version 0.5.14.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling)

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

3 open source packages ship an affected version, including github.com/ulikunitz/xz.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/ulikunitz/xz` | Go | All versions | 0.5.15 |
| `github.com/ulikunitz/xz` | Go | All versions | 0.5.15 |
| `github.com/ulikunitz/xz` | Go | All versions | 0.5.15 |
| `warewulf4` | SUSE:Linux Enterprise Module for HPC 15 SP6 | All versions | 4.6.4-150500.6.37.1 |
| `warewulf4` | SUSE:Linux Enterprise Module for HPC 15 SP7 | All versions | 4.6.4-150500.6.37.1 |
| `warewulf4` | openSUSE:Leap 15.6 | All versions | 4.6.4-150500.6.37.1 |
| `warewulf4` | openSUSE:Leap 16.0 | All versions | 4.6.4-bp160.1.1 |
| `regclient` | openSUSE:Tumbleweed | All versions | 0.9.2-1.1 |
| `sbctl` | openSUSE:Tumbleweed | All versions | 0.17-2.1 |
| `tailscale` | openSUSE:Tumbleweed | All versions | 1.86.5-1.1 |
| `trivy` | openSUSE:Tumbleweed | All versions | 0.66.0-1.1 |
| `warewulf4` | openSUSE:Tumbleweed | All versions | 4.6.4-1.1 |

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

Upgrade github.com/ulikunitz/xz to 0.5.15 or later.

## Is CVE-2025-58058 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-58058 exists.

## Fix prompt for AI coding agents

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

What it is: CVE-2025-58058 is a medium-severity denial of service vulnerability in ulikunitz xz, published on 28 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-58058 exists.

Affected packages and fixed versions:
- github.com/ulikunitz/xz (Go): affected all versions; fixed in 0.5.15
- github.com/ulikunitz/xz (Go): affected all versions; fixed in 0.5.15
- github.com/ulikunitz/xz (Go): affected all versions; fixed in 0.5.15

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-58058/ (Markdown: https://insights.sbomify.com/CVE-2025-58058/index.md)
```

## Sources

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

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