Golang < 1.19.10 / 1.20.x < 1.20.5 Multiple Vulnerabilities

critical Nessus Plugin ID 177342

Synopsis

An application installed on the remote Windows host is affected by multiple vulnerabilities.

Description

The version of Golang Go installed on the remote host is affected by multiple vulnerabilities:

- The go command may generate unexpected code at build time when using cgo. This may result in unexpected behavior when running a go program which uses cgo. This may occur when running an untrusted module which contains directories with newline characters in their names. Modules which are retrieved using the go command, i.e. via 'go get', are not affected (modules retrieved using GOPATH-mode, i.e. GO111MODULE=off, may be affected). (CVE-2023-29402)

- The go command may execute arbitrary code at build time when using cgo. This may occur when running 'go get' on a malicious module, or when running any other command which builds untrusted code. This is can by triggered by linker flags, specified via a '#cgo LDFLAGS' directive. The arguments for a number of flags which are non-optional are incorrectly considered optional, allowing disallowed flags to be smuggled through the LDFLAGS sanitization. This affects usage of both the gc and gccgo compilers. (CVE-2023-29404)

- The go command may execute arbitrary code at build time when using cgo. This may occur when running 'go get' on a malicious module, or when running any other command which builds untrusted code. This is can by triggered by linker flags, specified via a '#cgo LDFLAGS' directive. Flags containing embedded spaces are mishandled, allowing disallowed flags to be smuggled through the LDFLAGS sanitization by including them in the argument of another flag. This only affects usage of the gccgo compiler. (CVE-2023-29405) Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Upgrade to Golang Go version 1.19.10, 1.20.5, or later.

See Also

https://github.com/golang/go/issues/60167

https://github.com/golang/go/issues/60305

https://github.com/golang/go/issues/60306

http://www.nessus.org/u?e05d2017

Plugin Details

Severity: Critical

ID: 177342

File Name: golang_1_20_5.nasl

Version: 1.6

Type: local

Agent: windows

Family: Windows

Published: 6/15/2023

Updated: 12/8/2023

Supported Sensors: Nessus Agent, Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 6.7

CVSS v2

Risk Factor: Critical

Base Score: 10

Temporal Score: 7.4

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

CVSS Score Source: CVE-2023-29405

CVSS v3

Risk Factor: Critical

Base Score: 9.8

Temporal Score: 8.5

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:U/RL:O/RC:C

Vulnerability Information

CPE: cpe:/a:golang:go

Required KB Items: SMB/Registry/Enumerated, installed_sw/Golang Go Programming Language

Exploit Ease: No known exploits are available

Patch Publication Date: 6/6/2023

Vulnerability Publication Date: 6/6/2023

Reference Information

CVE: CVE-2023-29402, CVE-2023-29404, CVE-2023-29405

IAVB: 2023-B-0040-S, 2023-B-0080-S