Critical Vulnerability in XZ Utils: Heap Use After Free and Null Pointer Dereference

xz Updated 02 Oct 2025

Summary

03/04/2025
N/A
Yes i
Unrated
Not published

CVE-2025-31115: XZ Utils provide a general-purpose data-compression library plus command-line tools. Affects xz across 2 version ranges.

< 5.4.3-r1 < d5a2ffe41bb77b918a8c96084885d4dbe4bf6480

Fixed in 5.4.3-r1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

XZ Utils is a widely-used data-compression library that provides efficient compression and decompression tools. It is particularly known for its multithreaded capabilities, allowing for faster processing of .xz files. However, versions 5.3.3alpha to 5.8.0 contain a significant vulnerability in the multithreaded decoder, which can lead to severe application crashes and security risks.

Vulnerability Detail

The vulnerability arises from a bug in the multithreaded .xz decoder within liblzma, where invalid input can cause heap use after free and writing to an address based on a null pointer plus an offset. This can lead to application crashes and potential exploitation by attackers, making it critical for users of the lzma_stream_decoder_mt function to address this issue promptly.

How To Fix

Minimum fixed version

5.4.3-r1

This is the first release that contains the fix.

sudo apk add --upgrade xz

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid using the multithreaded decoder function lzma_stream_decoder_mt until they can update to the patched version. This may involve modifying the application code to use the single-threaded decoder instead.

Conclusion

The vulnerability in XZ Utils poses significant risks to applications using the affected versions. It is crucial for users to update to version 5.8.1 or later to mitigate these risks. For those unable to update immediately, a temporary workaround is available.

See every vulnerability recorded for xz →

Share this vulnerability

FAQ

Versions 5.3.3alpha to 5.8.0 of XZ Utils are affected by this vulnerability.

The vulnerability can lead to application crashes, heap corruption, and potential exploitation by malicious actors.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Yes, a standalone patch is available that can be applied to all affected releases, although no new release packages will be made from the old stable branches.

If immediate updating is not possible, avoid using the multithreaded decoder function lzma_stream_decoder_mt as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for xz.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

5.4.3-r1

This is the first release that contains the fix.

sudo apk add --upgrade xz

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback