Skip to main content

CVE-2025-58058: CWE-770: Allocation of Resources Without Limits or Throttling in ulikunitz xz

Medium
VulnerabilityCVE-2025-58058cvecve-2025-58058cwe-770
Published: Thu Aug 28 2025 (08/28/2025, 21:54:05 UTC)
Source: CVE Database V5
Vendor/Project: ulikunitz
Product: xz

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.

AI-Powered Analysis

AILast updated: 08/28/2025, 22:17:46 UTC

Technical Analysis

CVE-2025-58058 is a medium-severity vulnerability identified in the 'xz' package developed by ulikunitz, a pure Go implementation for reading and writing xz-compressed files. The vulnerability arises in versions prior to 0.5.14 due to improper handling of data placed before an LZMA-encoded byte stream. Specifically, the xz package reads the header of the LZMA stream without detecting if extraneous data precedes the actual compressed content. According to the LZMA specification, the header lacks a magic number or checksum that would allow early detection of such malformed input. Consequently, the package allocates the full decoding buffer immediately after reading the header, based on the expected decompressed size. If data is prepended to the stream, this allocation can be significantly larger than necessary, leading to excessive memory consumption. Although the code eventually recognizes the malformed stream during decompression, the memory allocation has already occurred, potentially causing resource exhaustion or denial of service (DoS) conditions. This vulnerability is classified under CWE-770, which concerns allocation of resources without limits or throttling. The issue was addressed and patched in version 0.5.14 of the xz package. The CVSS v3.1 base score is 5.3, reflecting a network-exploitable vulnerability that requires no privileges or user interaction, with impact limited to availability (memory exhaustion), and no impact on confidentiality or integrity. No known exploits are currently reported in the wild.

Potential Impact

For European organizations, the primary impact of CVE-2025-58058 is the risk of denial of service through memory exhaustion when processing maliciously crafted xz-compressed files using vulnerable versions of the ulikunitz xz package. Organizations that rely on software or services incorporating this package for handling compressed data—such as backup solutions, data ingestion pipelines, or file processing utilities—may experience service disruptions or crashes. This could affect availability of critical systems, especially in environments processing large volumes of compressed data or exposed to untrusted inputs (e.g., public-facing upload portals). While the vulnerability does not compromise data confidentiality or integrity, the availability impact could interrupt business operations or degrade service quality. Given the medium severity and absence of known exploits, the immediate risk is moderate; however, the potential for exploitation in automated or targeted DoS attacks exists if attackers supply crafted xz files. European organizations should assess their software supply chain and dependencies to identify usage of the affected package versions and prioritize patching to prevent service interruptions.

Mitigation Recommendations

1. Upgrade: Immediately update the ulikunitz xz package to version 0.5.14 or later, where the vulnerability is patched. 2. Input Validation: Implement strict validation and sanitization of all incoming compressed files, especially those from untrusted sources, to detect and reject malformed or suspicious xz streams before processing. 3. Resource Limits: Configure memory usage limits and timeouts on processes handling decompression to prevent excessive resource consumption from malformed inputs. 4. Monitoring and Alerting: Deploy monitoring to detect abnormal memory usage or crashes in services handling xz files, enabling rapid response to potential exploitation attempts. 5. Dependency Auditing: Conduct thorough audits of software dependencies and container images to identify and remediate vulnerable versions of the xz package. 6. Isolation: Run decompression operations in isolated environments or sandboxes to contain potential DoS impacts and prevent cascading failures in critical systems.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-08-22T14:30:32.221Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68b0d208ad5a09ad006ff0bc

Added to database: 8/28/2025, 10:02:48 PM

Last enriched: 8/28/2025, 10:17:46 PM

Last updated: 8/29/2025, 12:34:43 AM

Views: 4

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats