Cyber Security News

Critical zlib Flaw Let Attackers Can Trigger a Buffer Overflow via untgz

A severe buffer overflow vulnerability has been discovered in the zlib untgz utility, affecting version 1.3.1.2, allowing attackers to trigger memory corruption via maliciously crafted command-line arguments.

The vulnerability resides in the TGZfname() function, where an unbounded strcpy() call copies user-supplied archive names directly into a fixed-size global buffer of 1024 bytes without any length validation.

When an attacker supplies an archive name exceeding 1024 bytes, the utility writes data beyond the buffer boundaries, causing a global buffer overflow.

What makes this flaw particularly concerning is its trivial exploitability. The vulnerable code executes before any archive parsing or validation, meaning attackers can trigger the overflow by providing a long filename as a command-line argument, with no complex exploitation required.

The root cause stems from several coding weaknesses: the archive name is derived directly from argv[] without sanitization, no bounds checking validates the input length before copying, and the buffer is a global static array rather than stack-allocated memory. The overflow occurs immediately upon function entry.

Security researchers at SEC demonstrated the vulnerability using AddressSanitizer (ASAN), which detected a global buffer overflow when the untgz utility processed a 4096-byte input string.

The ASAN output confirmed a write of 2001 bytes at the vulnerable memory address, with the stack trace pointing to the strcpy() call at line 136 of untgz.c.

The potential impact ranges from denial-of-service crashes to memory corruption of adjacent global objects and undefined behavior.

In certain conditions, depending on the compiler, architecture, build flags, and memory layout, attackers could potentially achieve arbitrary code execution.

Since the overflow affects global memory, corruption may persist and influence later program behavior.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

2 days ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

2 days ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

2 days ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

2 days ago