Vulnerabilites related to Go standard library - archive/tar
cve-2022-2879
Vulnerability from cvelistv5
Published
2022-10-14 00:00
Modified
2025-02-13 16:32
Severity ?
Summary
Reader.Read does not set a limit on the maximum size of file headers. A maliciously crafted archive could cause Read to allocate unbounded amounts of memory, potentially causing resource exhaustion or panics. After fix, Reader.Read limits the maximum size of header blocks to 1 MiB.
Impacted products
Vendor Product Version
Go standard library archive/tar Version: 0   
Version: 1.19.0-0   
Create a notification for this product.
Show details on NVD website


{
   containers: {
      adp: [
         {
            providerMetadata: {
               dateUpdated: "2024-08-03T00:52:59.498Z",
               orgId: "af854a3a-2127-422b-91ae-364da2661108",
               shortName: "CVE",
            },
            references: [
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://go.dev/issue/54853",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://go.dev/cl/439355",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://groups.google.com/g/golang-announce/c/xtuG5faxtaU",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://pkg.go.dev/vuln/GO-2022-1037",
               },
               {
                  tags: [
                     "x_transferred",
                  ],
                  url: "https://security.gentoo.org/glsa/202311-09",
               },
            ],
            title: "CVE Program Container",
         },
      ],
      cna: {
         affected: [
            {
               collectionURL: "https://pkg.go.dev",
               defaultStatus: "unaffected",
               packageName: "archive/tar",
               product: "archive/tar",
               programRoutines: [
                  {
                     name: "Reader.next",
                  },
                  {
                     name: "parsePAX",
                  },
                  {
                     name: "Writer.writePAXHeader",
                  },
                  {
                     name: "Reader.Next",
                  },
                  {
                     name: "Writer.WriteHeader",
                  },
               ],
               vendor: "Go standard library",
               versions: [
                  {
                     lessThan: "1.18.7",
                     status: "affected",
                     version: "0",
                     versionType: "semver",
                  },
                  {
                     lessThan: "1.19.2",
                     status: "affected",
                     version: "1.19.0-0",
                     versionType: "semver",
                  },
               ],
            },
         ],
         credits: [
            {
               lang: "en",
               value: "Adam Korczynski (ADA Logics)",
            },
            {
               lang: "en",
               value: "OSS-Fuzz",
            },
         ],
         descriptions: [
            {
               lang: "en",
               value: "Reader.Read does not set a limit on the maximum size of file headers. A maliciously crafted archive could cause Read to allocate unbounded amounts of memory, potentially causing resource exhaustion or panics. After fix, Reader.Read limits the maximum size of header blocks to 1 MiB.",
            },
         ],
         problemTypes: [
            {
               descriptions: [
                  {
                     description: "CWE 400: Uncontrolled Resource Consumption",
                     lang: "en",
                  },
               ],
            },
         ],
         providerMetadata: {
            dateUpdated: "2023-11-25T11:10:09.147Z",
            orgId: "1bb62c36-49e3-4200-9d77-64a1400537cc",
            shortName: "Go",
         },
         references: [
            {
               url: "https://go.dev/issue/54853",
            },
            {
               url: "https://go.dev/cl/439355",
            },
            {
               url: "https://groups.google.com/g/golang-announce/c/xtuG5faxtaU",
            },
            {
               url: "https://pkg.go.dev/vuln/GO-2022-1037",
            },
            {
               url: "https://security.gentoo.org/glsa/202311-09",
            },
         ],
         title: "Unbounded memory consumption when reading headers in archive/tar",
      },
   },
   cveMetadata: {
      assignerOrgId: "1bb62c36-49e3-4200-9d77-64a1400537cc",
      assignerShortName: "Go",
      cveId: "CVE-2022-2879",
      datePublished: "2022-10-14T00:00:00.000Z",
      dateReserved: "2022-08-17T00:00:00.000Z",
      dateUpdated: "2025-02-13T16:32:38.510Z",
      state: "PUBLISHED",
   },
   dataType: "CVE_RECORD",
   dataVersion: "5.1",
}