VAITP Dataset

← Back to the dataset

CVE-2026-84161

Unbounded zlib decompression in storeAnalysisStats causes memory blowup.

  • CVSS 4.9
  • CWE-409
  • Resource Management
  • Remote

When an operator enables store.analysis_statistics_dir, a network client with PRODUCT_STORE permission for a product can call that product's storeAnalysisStatistics Thrift-over-HTTP method. CodeChecker 6.29.0 decodes the attacker-controlled Base64 string and passes the complete compressed input to one-shot zlib.decompress(). No maximum decompressed size is enforced. This gives a correctly authorized, non-superuser store account a high-ratio memory and persistent-disk amplification primitive. The complete output is first materialized as a Python bytes object and is then written to the configured statistics directory. A sufficiently scaled payload can exhaust the API worker or host memory and impair CodeChecker availability. The shipped value of store.analysis_statistics_dir is null, so the affected feature is disabled by default. The primary assessment does not rely on authentication being disabled. There is no authorization bypass and no path traversal in this report.

CVSS base score
4.9
Published
2026-11-06
OWASP
A04 Insecure Design
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
Python

Solution

Upgrade CodeChecker to version 6.30.0 or later, which includes the fix for the unbounded storeAnalysisStatistics decompression vulnerability.

Vulnerable code sample

import base64
import zlib
import os

def store_analysis_statistics(request, config, db):
    """
    Handles the Thrift-over-HTTP `storeAnalysisStatistics` call.
    `request.data` is a Base64‑encoded, zlib‑compressed byte string.
    """
    # Decode attacker‑controlled input
    compressed = base64.b64decode(request.data)

    # VULNERABLE: unbounded one‑shot decompression may exhaust memory
    decompressed = zlib.decompress(compressed)

    # Write the statistics file
    stats_dir = config.get('store.analysis_statistics_dir')
    if not stats_dir:
        return  # feature disabled
    os.makedirs(stats_dir, exist_ok=True)
    out_path = os.path.join(stats_dir, f"{request.product_id}.stats")
    with open(out_path, "wb") as f:
        f.write(decompressed)

    # Record that statistics were stored
    db.execute(
        "INSERT INTO analysis_stats (product_id, path) VALUES (%s, %s)",
        (request.product_id, out_path)
    )

Patched code sample

import base64
import zlib
import os

def store_analysis_statistics(request, config, db):
    """
    Handles the Thrift-over-HTTP `storeAnalysisStatistics` call.
    `request.data` is a Base64‑encoded, zlib‑compressed byte string.
    """
    # Decode attacker‑controlled input
    compressed = base64.b64decode(request.data)

    # FIX: stream decompress with size limit to prevent memory exhaustion
    max_size = 10 * 1024 * 1024  # 10 MiB
    decompressor = zlib.decompressobj()
    decompressed_chunks = []
    total_len = 0
    while compressed:
        chunk = decompressor.decompress(compressed, max_size - total_len)
        decompressed_chunks.append(chunk)
        total_len += len(chunk)
        if total_len > max_size:
            raise MemoryError("Decompressed data exceeds allowed size")
        compressed = decompressor.unconsumed_tail
    decompressed = b"".join(decompressed_chunks)

    # Write the statistics file
    stats_dir = config.get('store.analysis_statistics_dir')
    if not stats_dir:
        return  # feature disabled
    os.makedirs(stats_dir, exist_ok=True)
    out_path = os.path.join(stats_dir, f"{request.product_id}.stats")
    with open(out_path, "wb") as f:
        f.write(decompressed)

    # Record that statistics were stored
    db.execute(
        "INSERT INTO analysis_stats (product_id, path) VALUES (%s, %s)",
        (request.product_id, out_path)
    )

Cite this entry

@misc{vaitp:cve202684161,
  title        = {{Unbounded zlib decompression in storeAnalysisStats causes memory blowup.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-84161},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-84161/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.