CVE-2026-22184 — Critical Buffer Overflow in zlib’s untgz Utility

CVE-2026-22184 is a critical software vulnerability found in the zlib compression library (versions up to and including 1.3.1.2) in the untgz utility. The issue arises because the function TGZfname() copies an attacker-controlled archive name into a fixed-size 1024-byte global buffer using an unsafe strcpy() call without checking the length of the input. This can cause an out-of-bounds write when a longer name is supplied.


Technical Impact

  • Vulnerability Type: Global buffer overflow (CWE-120)
  • Component Affected: untgz utility of zlib library ≤ 1.3.1.2
  • Cause: strcpy() copies unbounded input into fixed buffer → memory corruption

Possible consequences include:

  • Memory Corruption — program state becomes unstable
  • Denial of Service (DoS) — crash of affected process
  • Potential Arbitrary Code Execution — depending on compiler, OS architecture, build flags, and memory layout
    (Attackers may leverage this to run malicious code)

Severity

  • CVSS v4.0 Base Score: 9.3 (Critical)
  • Attack Vector: Network (AV:N)
  • Privileges Required: None
  • User Interaction: None
  • Remote Exploitability: Possible depending on context

Because this vulnerability doesn’t require privileges or user interaction, it’s considered trivially exploitable if the vulnerable tool is accessible to a potential attacker.


Where It’s Found / Triggered

The flaw is specifically in the untgz utility — a tool commonly used to unpack .tar.gz / .tgz archives. Attackers can craft a file name that triggers the overflow simply by supplying a longer name when the tool is invoked.

Note: This vulnerability is in zlib’s optional contributed utilities and may not be present in every distribution by default, but is included in many builds and packages.


Mitigation & Recommendations

Update / Patch:

  • Apply vendor patches once available. At the time of discovery there may be no patch for all distributions.

Temporary Workarounds:

  • Avoid invoking untgz on untrusted input.
  • Enforce input validation and length restrictions when calling zlib utilities.
  • Use OS level protections like DEP/NX, ASLR, and stack canaries.

Audit Systems:

  • Check servers and build environments for zlib ≤1.3.1.2 and related unpacking tools.
  • Run vulnerability scanners (e.g., Nessus, OpenVAS) to detect presence.

CWE / Root Cause Classification

  • CWE-120: Buffer Copy without Checking Size of Input (“Classic Buffer Overflow”) — a common and well-understood memory safety flaw.