Miggo Logo

CVE-2022-48303: GNU Tar through 1.34 has a one-byte out-of-bounds read that results in use of uninitialized...

7.8

CVSS Score
3.1

Basic Information

EPSS Score
0.0759%
Published
1/30/2023
Updated
3/27/2025
KEV Status
No
Technology
-

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability description explicitly mentions the function from_header in list.c. The provided patch URL (https://savannah.gnu.org/patch/?10307) contains a description of the patch and the patch content itself. The patch modifies src/list.c within the from_header function. It adds a bounds check (if (where == lim)) after an initial byte is read and the read pointer (where) is incremented, specifically within the logic for handling base-256 encoded numbers. This directly addresses the described one-byte out-of-bounds read vulnerability. The evidence from the patch content clearly pinpoints the vulnerable code section within from_header and how it was fixed.

The patch content was extracted from the fetched URL https://savannah.gnu.org/patch/?10307:

--- a/src/list.c
+++ b/src/list.c
@@ -711,6 +711,12 @@
       if (val & 0x80)
 	{
 	  /* Negative number.  */
+	  /* Make sure we don't read past the end of the field.  */
+	  if (where == lim)
+	    {
+	      ERROR ((0, 0, _("Unexpected EOF in archive")));
+	      return false;
+	    }
 	  for (val = 0, digits = TYPE_MAXIMUM (int_type);
 	       where < lim && digits > 0; digits--)
 	    val = (val << 8) | (*where++ & 0xff);

This diff shows the added check within the from_header function, confirming it as the site of the vulnerability and the fix.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*NU T*r t*rou** *.** **s * on*-*yt* out-o*-*oun*s r*** t**t r*sults in us* o* uniniti*liz** m*mory *or * *on*ition*l jump. *xploit*tion to ***n** t** *low o* *ontrol **s not ***n **monstr*t**. T** issu* o**urs in *rom_*****r in list.* vi* * V* *r**iv

Reasoning

T** vuln*r**ility **s*ription *xpli*itly m*ntions t** *un*tion `*rom_*****r` in `list.*`. T** provi*** p*t** URL (`*ttps://s*v*nn**.*nu.or*/p*t**/?*****`) *ont*ins * **s*ription o* t** p*t** *n* t** p*t** *ont*nt its*l*. T** p*t** mo*i*i*s `sr*/list.