Lucene search

K
nessusUbuntu Security Notice (C) 2024 Canonical, Inc. / NASL script (C) 2024 and is owned by Tenable, Inc. or an Affiliate thereof.UBUNTU_USN-6574-1.NASL
HistoryJan 11, 2024 - 12:00 a.m.

Ubuntu 20.04 LTS / 22.04 LTS / 23.04 / 23.10 : Go vulnerabilities (USN-6574-1)

2024-01-1100:00:00
Ubuntu Security Notice (C) 2024 Canonical, Inc. / NASL script (C) 2024 and is owned by Tenable, Inc. or an Affiliate thereof.
www.tenable.com
11
ubuntu
20.04
22.04
23.04
23.10
go
vulnerabilities
xss
cve-2023-39318
cve-2023-39319
//line directives
http/2
denial of service
git protocol
cve-2023-44487
cve-2023-45285

8.1 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

HIGH

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

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

8.3 High

AI Score

Confidence

Low

0.732 High

EPSS

Percentile

98.1%

The remote Ubuntu 20.04 LTS / 22.04 LTS / 23.04 / 23.10 host has packages installed that are affected by multiple vulnerabilities as referenced in the USN-6574-1 advisory.

  • The html/template package does not properly handle HTML-like comment tokens, nor hashbang #! comment tokens, in <script> contexts. This may cause the template parser to improperly interpret the contents of <script> contexts, causing actions to be improperly escaped. This may be leveraged to perform an XSS attack. (CVE-2023-39318)

  • The html/template package does not apply the proper rules for handling occurrences of <script,

#%NASL_MIN_LEVEL 80900
##
# (C) Tenable, Inc.
#
# The descriptive text and package checks in this plugin were
# extracted from Ubuntu Security Notice USN-6574-1. The text
# itself is copyright (C) Canonical, Inc. See
# <https://ubuntu.com/security/notices>. Ubuntu(R) is a registered
# trademark of Canonical, Inc.
##

include('compat.inc');

if (description)
{
  script_id(187937);
  script_version("1.1");
  script_set_attribute(attribute:"plugin_modification_date", value:"2024/02/09");

  script_cve_id(
    "CVE-2023-39318",
    "CVE-2023-39319",
    "CVE-2023-39323",
    "CVE-2023-39325",
    "CVE-2023-39326",
    "CVE-2023-44487",
    "CVE-2023-45285"
  );
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2023/10/31");
  script_xref(name:"USN", value:"6574-1");
  script_xref(name:"CEA-ID", value:"CEA-2024-0004");

  script_name(english:"Ubuntu 20.04 LTS / 22.04 LTS / 23.04 / 23.10 : Go vulnerabilities (USN-6574-1)");

  script_set_attribute(attribute:"synopsis", value:
"The remote Ubuntu host is missing one or more security updates.");
  script_set_attribute(attribute:"description", value:
"The remote Ubuntu 20.04 LTS / 22.04 LTS / 23.04 / 23.10 host has packages installed that are affected by multiple
vulnerabilities as referenced in the USN-6574-1 advisory.

  - The html/template package does not properly handle HTML-like  comment tokens, nor hashbang #! comment
    tokens, in <script> contexts. This may cause the template parser to improperly interpret the contents of
    <script> contexts, causing actions to be improperly escaped. This may be leveraged to perform an XSS
    attack. (CVE-2023-39318)

  - The html/template package does not apply the proper rules for handling occurrences of <script, <!--,
    and </script within JS literals in <script> contexts. This may cause the template parser to improperly
    consider script contexts to be terminated early, causing actions to be improperly escaped. This could be
    leveraged to perform an XSS attack. (CVE-2023-39319)

  - Line directives (//line) can be used to bypass the restrictions on //go:cgo_ directives, allowing
    blocked linker and compiler flags to be passed during compilation. This can result in unexpected execution
    of arbitrary code when running go build. The line directive requires the absolute path of the file in
    which the directive lives, which makes exploiting this issue significantly more complex. (CVE-2023-39323)

  - A malicious HTTP/2 client which rapidly creates requests and immediately resets them can cause excessive
    server resource consumption. While the total number of requests is bounded by the
    http2.Server.MaxConcurrentStreams setting, resetting an in-progress request allows the attacker to create
    a new request while the existing one is still executing. With the fix applied, HTTP/2 servers now bound
    the number of simultaneously executing handler goroutines to the stream concurrency limit
    (MaxConcurrentStreams). New requests arriving when at the limit (which can only happen after the client
    has reset an existing, in-flight request) will be queued until a handler exits. If the request queue grows
    too large, the server will terminate the connection. This issue is also fixed in golang.org/x/net/http2
    for users manually configuring HTTP/2. The default stream concurrency limit is 250 streams (requests) per
    HTTP/2 connection. This value may be adjusted using the golang.org/x/net/http2 package; see the
    Server.MaxConcurrentStreams setting and the ConfigureServer function. (CVE-2023-39325)

  - A malicious HTTP sender can use chunk extensions to cause a receiver reading from a request or response
    body to read many more bytes from the network than are in the body. A malicious HTTP client can further
    exploit this to cause a server to automatically read a large amount of data (up to about 1GiB) when a
    handler fails to read the entire body of a request. Chunk extensions are a little-used HTTP feature which
    permit including additional metadata in a request or response body sent using the chunked encoding. The
    net/http chunked encoding reader discards this metadata. A sender can exploit this by inserting a large
    metadata segment with each byte transferred. The chunk reader now produces an error if the ratio of real
    body to encoded bytes grows too small. (CVE-2023-39326)

  - The HTTP/2 protocol allows a denial of service (server resource consumption) because request cancellation
    can reset many streams quickly, as exploited in the wild in August through October 2023. (CVE-2023-44487)

  - Using go get to fetch a module with the .git suffix may unexpectedly fallback to the insecure git://
    protocol if the module is unavailable via the secure https:// and git+ssh:// protocols, even if
    GOINSECURE is not set for said module. This only affects users who are not using the module proxy and are
    fetching modules directly (i.e. GOPROXY=off). (CVE-2023-45285)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version
number.");
  script_set_attribute(attribute:"see_also", value:"https://ubuntu.com/security/notices/USN-6574-1");
  script_set_attribute(attribute:"solution", value:
"Update the affected packages.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:N/A:N");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2023-45285");
  script_set_attribute(attribute:"cvss3_score_source", value:"CVE-2023-39323");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2023/09/07");
  script_set_attribute(attribute:"patch_publication_date", value:"2024/01/11");
  script_set_attribute(attribute:"plugin_publication_date", value:"2024/01/11");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:20.04:-:lts");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:22.04:-:lts");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:23.04");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:23.10");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:golang-1.20");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:golang-1.20-go");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:golang-1.20-src");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:golang-1.21");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:golang-1.21-go");
  script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:golang-1.21-src");
  script_set_attribute(attribute:"generated_plugin", value:"current");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Ubuntu Local Security Checks");

  script_copyright(english:"Ubuntu Security Notice (C) 2024 Canonical, Inc. / NASL script (C) 2024 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/cpu", "Host/Ubuntu", "Host/Ubuntu/release", "Host/Debian/dpkg-l");

  exit(0);
}

include('debian_package.inc');

if ( ! get_kb_item('Host/local_checks_enabled') ) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
var os_release = get_kb_item('Host/Ubuntu/release');
if ( isnull(os_release) ) audit(AUDIT_OS_NOT, 'Ubuntu');
os_release = chomp(os_release);
if (! ('20.04' >< os_release || '22.04' >< os_release || '23.04' >< os_release || '23.10' >< os_release)) audit(AUDIT_OS_NOT, 'Ubuntu 20.04 / 22.04 / 23.04 / 23.10', 'Ubuntu ' + os_release);
if ( ! get_kb_item('Host/Debian/dpkg-l') ) audit(AUDIT_PACKAGE_LIST_MISSING);

var cpu = get_kb_item('Host/cpu');
if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
if ('x86_64' >!< cpu && cpu !~ "^i[3-6]86$" && 's390' >!< cpu && 'aarch64' >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, 'Ubuntu', cpu);

var pkgs = [
    {'osver': '20.04', 'pkgname': 'golang-1.20', 'pkgver': '1.20.3-1ubuntu0.1~20.04.1'},
    {'osver': '20.04', 'pkgname': 'golang-1.20-go', 'pkgver': '1.20.3-1ubuntu0.1~20.04.1'},
    {'osver': '20.04', 'pkgname': 'golang-1.20-src', 'pkgver': '1.20.3-1ubuntu0.1~20.04.1'},
    {'osver': '20.04', 'pkgname': 'golang-1.21', 'pkgver': '1.21.1-1~ubuntu20.04.2'},
    {'osver': '20.04', 'pkgname': 'golang-1.21-go', 'pkgver': '1.21.1-1~ubuntu20.04.2'},
    {'osver': '20.04', 'pkgname': 'golang-1.21-src', 'pkgver': '1.21.1-1~ubuntu20.04.2'},
    {'osver': '22.04', 'pkgname': 'golang-1.20', 'pkgver': '1.20.3-1ubuntu0.1~22.04.1'},
    {'osver': '22.04', 'pkgname': 'golang-1.20-go', 'pkgver': '1.20.3-1ubuntu0.1~22.04.1'},
    {'osver': '22.04', 'pkgname': 'golang-1.20-src', 'pkgver': '1.20.3-1ubuntu0.1~22.04.1'},
    {'osver': '22.04', 'pkgname': 'golang-1.21', 'pkgver': '1.21.1-1~ubuntu22.04.2'},
    {'osver': '22.04', 'pkgname': 'golang-1.21-go', 'pkgver': '1.21.1-1~ubuntu22.04.2'},
    {'osver': '22.04', 'pkgname': 'golang-1.21-src', 'pkgver': '1.21.1-1~ubuntu22.04.2'},
    {'osver': '23.04', 'pkgname': 'golang-1.20', 'pkgver': '1.20.3-1ubuntu0.2'},
    {'osver': '23.04', 'pkgname': 'golang-1.20-go', 'pkgver': '1.20.3-1ubuntu0.2'},
    {'osver': '23.04', 'pkgname': 'golang-1.20-src', 'pkgver': '1.20.3-1ubuntu0.2'},
    {'osver': '23.04', 'pkgname': 'golang-1.21', 'pkgver': '1.21.1-1~ubuntu23.04.2'},
    {'osver': '23.04', 'pkgname': 'golang-1.21-go', 'pkgver': '1.21.1-1~ubuntu23.04.2'},
    {'osver': '23.04', 'pkgname': 'golang-1.21-src', 'pkgver': '1.21.1-1~ubuntu23.04.2'},
    {'osver': '23.10', 'pkgname': 'golang-1.20', 'pkgver': '1.20.8-1ubuntu0.23.10.1'},
    {'osver': '23.10', 'pkgname': 'golang-1.20-go', 'pkgver': '1.20.8-1ubuntu0.23.10.1'},
    {'osver': '23.10', 'pkgname': 'golang-1.20-src', 'pkgver': '1.20.8-1ubuntu0.23.10.1'},
    {'osver': '23.10', 'pkgname': 'golang-1.21', 'pkgver': '1.21.1-1ubuntu0.23.10.1'},
    {'osver': '23.10', 'pkgname': 'golang-1.21-go', 'pkgver': '1.21.1-1ubuntu0.23.10.1'},
    {'osver': '23.10', 'pkgname': 'golang-1.21-src', 'pkgver': '1.21.1-1ubuntu0.23.10.1'}
];

var flag = 0;
foreach package_array ( pkgs ) {
  var osver = NULL;
  var pkgname = NULL;
  var pkgver = NULL;
  if (!empty_or_null(package_array['osver'])) osver = package_array['osver'];
  if (!empty_or_null(package_array['pkgname'])) pkgname = package_array['pkgname'];
  if (!empty_or_null(package_array['pkgver'])) pkgver = package_array['pkgver'];
  if (osver && pkgname && pkgver) {
    if (ubuntu_check(osver:osver, pkgname:pkgname, pkgver:pkgver)) flag++;
  }
}

if (flag)
{
  security_report_v4(
    port       : 0,
    severity   : SECURITY_HOLE,
    extra      : ubuntu_report_get()
  );
  exit(0);
}
else
{
  var tested = ubuntu_pkg_tests_get();
  if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
  else audit(AUDIT_PACKAGE_NOT_INSTALLED, 'golang-1.20 / golang-1.20-go / golang-1.20-src / golang-1.21 / etc');
}
VendorProductVersionCPE
canonicalubuntu_linux23.10cpe:/o:canonical:ubuntu_linux:23.10
canonicalubuntu_linuxgolang-1.20p-cpe:/a:canonical:ubuntu_linux:golang-1.20
canonicalubuntu_linux20.04cpe:/o:canonical:ubuntu_linux:20.04:-:lts
canonicalubuntu_linuxgolang-1.20-srcp-cpe:/a:canonical:ubuntu_linux:golang-1.20-src
canonicalubuntu_linuxgolang-1.21-gop-cpe:/a:canonical:ubuntu_linux:golang-1.21-go
canonicalubuntu_linux23.04cpe:/o:canonical:ubuntu_linux:23.04
canonicalubuntu_linux22.04cpe:/o:canonical:ubuntu_linux:22.04:-:lts
canonicalubuntu_linuxgolang-1.21-srcp-cpe:/a:canonical:ubuntu_linux:golang-1.21-src
canonicalubuntu_linuxgolang-1.20-gop-cpe:/a:canonical:ubuntu_linux:golang-1.20-go
canonicalubuntu_linuxgolang-1.21p-cpe:/a:canonical:ubuntu_linux:golang-1.21

8.1 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

HIGH

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

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

8.3 High

AI Score

Confidence

Low

0.732 High

EPSS

Percentile

98.1%