Amazon Linux AMI : golang (ALAS-2023-1731)

critical Nessus Plugin ID 174620

Synopsis

The remote Amazon Linux AMI host is missing a security update.

Description

The version of golang installed on the remote host is prior to 1.18.6-1.43. It is, therefore, affected by multiple vulnerabilities as referenced in the ALAS-2023-1731 advisory.

Code injection in Cmd.Start in os/exec before Go 1.17.11 and Go 1.18.3 allows execution of any binaries in the working directory named either ..com or ..exe by calling Cmd.Run, Cmd.Start, Cmd.Output, or Cmd.CombinedOutput when Cmd.Path is unset. (CVE-2022-30580)

Infinite loop in Read in crypto/rand before Go 1.17.11 and Go 1.18.3 on Windows allows attacker to cause an indefinite hang by passing a buffer larger than 1 << 32 - 1 bytes. (CVE-2022-30634)

An uncontrolled resource consumption flaw was found in Golang math/big. A too-short encoded message can cause a panic in Float.GobDecode and Rat.GobDecode in math/big in Go, potentially allowing an attacker to create a denial of service, impacting availability. (CVE-2022-32189)

An attacker can cause excessive memory growth in a Go server accepting HTTP/2 requests. HTTP/2 server connections contain a cache of HTTP header keys sent by the client. While the total number of entries in this cache is capped, an attacker sending very large keys can cause the server to allocate approximately 64 MiB per open connection. (CVE-2022-41717)

The Go project has described this issue as follows:

On Windows, the filepath.Clean function could transform an invalid path such as a/../c:/b into the valid path c:\b. This transformation of a relative (if invalid) path into an absolute path could enable a directory traversal attack. The filepath.Clean function will now transform this path into the relative (but still invalid) path .\c:\b. (CVE-2022-41722)

http2/hpack: avoid quadratic complexity in hpack decoding (CVE-2022-41723)

RESERVEDNOTE: https://groups.google.com/g/golang-announce/c/V0aBFqaFs_E (CVE-2022-41724)

Golang: net/http, mime/multipart: denial of service from excessive resource consumption (https://groups.google.com/g/golang-announce/c/V0aBFqaFs_E) (CVE-2022-41725)

The ScalarMult and ScalarBaseMult methods of the P256 Curve may return an incorrect result if called with some specific unreduced scalars (a scalar larger than the order of the curve). This does not impact usages of crypto/ecdsa or crypto/ecdh. (CVE-2023-24532)

HTTP and MIME header parsing could allocate large amounts of memory, even when parsing small inputs.

Certain unusual patterns of input data could cause the common function used to parse HTTP and MIME headers to allocate substantially more memory than required to hold the parsed headers. An attacker can exploit this behavior to cause an HTTP server to allocate large amounts of memory from a small request, potentially leading to memory exhaustion and a denial of service. (CVE-2023-24534)

Multipart form parsing can consume large amounts of CPU and memory when processing form inputs containing very large numbers of parts. This stems from several causes: 1. mime/multipart.Reader.ReadForm limits the total memory a parsed multipart form can consume. ReadForm can undercount the amount of memory consumed, leading it to accept larger inputs than intended. 2. Limiting total memory does not account for increased pressure on the garbage collector from large numbers of small allocations in forms with many parts. 3.
ReadForm can allocate a large number of short-lived buffers, further increasing pressure on the garbage collector. The combination of these factors can permit an attacker to cause an program that parses multipart forms to consume large amounts of CPU and memory, potentially resulting in a denial of service.
This affects programs that use mime/multipart.Reader.ReadForm, as well as form parsing in the net/http package with the Request methods FormFile, FormValue, ParseMultipartForm, and PostFormValue. With fix, ReadForm now does a better job of estimating the memory consumption of parsed forms, and performs many fewer short-lived allocations. In addition, the fixed mime/multipart.Reader imposes the following limits on the size of parsed forms: 1. Forms parsed with ReadForm may contain no more than 1000 parts. This limit may be adjusted with the environment variable GODEBUG=multipartmaxparts=. 2. Form parts parsed with NextPart and NextRawPart may contain no more than 10,000 header fields. In addition, forms parsed with ReadForm may contain no more than 10,000 header fields across all parts. This limit may be adjusted with the environment variable GODEBUG=multipartmaxheaders=. (CVE-2023-24536)

Calling any of the Parse functions on Go source code which contains //line directives with very large line numbers can cause an infinite loop due to integer overflow. (CVE-2023-24537)

Templates did not properly consider backticks (`) as Javascript string delimiters, and as such didnot escape them as expected. Backticks are used, since ES6, for JS template literals. If a templatecontained a Go template action within a Javascript template literal, the contents of the action couldbe used to terminate the literal, injecting arbitrary Javascript code into the Go template. (CVE-2023-24538)

Tenable has extracted the preceding description block directly from the tested product security advisory.

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Run 'yum update golang' to update your system.

See Also

https://alas.aws.amazon.com/ALAS-2023-1731.html

https://alas.aws.amazon.com/cve/html/CVE-2022-30580.html

https://alas.aws.amazon.com/cve/html/CVE-2022-30634.html

https://alas.aws.amazon.com/cve/html/CVE-2022-32189.html

https://alas.aws.amazon.com/cve/html/CVE-2022-41717.html

https://alas.aws.amazon.com/cve/html/CVE-2022-41722.html

https://alas.aws.amazon.com/cve/html/CVE-2022-41723.html

https://alas.aws.amazon.com/cve/html/CVE-2022-41724.html

https://alas.aws.amazon.com/cve/html/CVE-2022-41725.html

https://alas.aws.amazon.com/cve/html/CVE-2023-24532.html

https://alas.aws.amazon.com/cve/html/CVE-2023-24534.html

https://alas.aws.amazon.com/cve/html/CVE-2023-24536.html

https://alas.aws.amazon.com/cve/html/CVE-2023-24537.html

https://alas.aws.amazon.com/cve/html/CVE-2023-24538.html

https://alas.aws.amazon.com/faqs.html

Plugin Details

Severity: Critical

ID: 174620

File Name: ala_ALAS-2023-1731.nasl

Version: 1.3

Type: local

Agent: unix

Published: 4/21/2023

Updated: 12/11/2024

Supported Sensors: Agentless Assessment, Continuous Assessment, Frictionless Assessment Agent, Frictionless Assessment AWS, Nessus Agent, Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 6.7

CVSS v2

Risk Factor: Critical

Base Score: 10

Temporal Score: 7.8

Vector: CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C

CVSS Score Source: CVE-2023-24538

CVSS v3

Risk Factor: Critical

Base Score: 9.8

Temporal Score: 8.8

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

Temporal Vector: CVSS:3.0/E:P/RL:O/RC:C

Vulnerability Information

CPE: cpe:/o:amazon:linux, p-cpe:/a:amazon:linux:golang-shared, p-cpe:/a:amazon:linux:golang-docs, p-cpe:/a:amazon:linux:golang-misc, p-cpe:/a:amazon:linux:golang-bin, p-cpe:/a:amazon:linux:golang-src, p-cpe:/a:amazon:linux:golang-race, p-cpe:/a:amazon:linux:golang-tests, p-cpe:/a:amazon:linux:golang

Required KB Items: Host/local_checks_enabled, Host/AmazonLinux/release, Host/AmazonLinux/rpm-list

Exploit Available: true

Exploit Ease: Exploits are available

Patch Publication Date: 4/13/2023

Vulnerability Publication Date: 6/7/2022

Reference Information

CVE: CVE-2022-30580, CVE-2022-30634, CVE-2022-32189, CVE-2022-41717, CVE-2022-41722, CVE-2022-41723, CVE-2022-41724, CVE-2022-41725, CVE-2023-24532, CVE-2023-24534, CVE-2023-24536, CVE-2023-24537, CVE-2023-24538

IAVB: 2022-B-0059-S, 2023-B-0012-S, 2023-B-0022-S