Amazon Linux 2023 : grub2-common, grub2-efi-aa64, grub2-efi-aa64-cdboot (ALAS2023-2023-020)

high Nessus Plugin ID 173192

Synopsis

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

Description

It is, therefore, affected by multiple vulnerabilities as referenced in the ALAS2023-2023-020 advisory.

- A crafted 16-bit grayscale PNG image may lead to a out-of-bounds write in the heap area. An attacker may take advantage of that to cause heap data corruption or eventually arbitrary code execution and circumvent secure boot protections. This issue has a high complexity to be exploited as an attacker needs to perform some triage over the heap layout to achieve signifcant results, also the values written into the memory are repeated three times in a row making difficult to produce valid payloads. This flaw affects grub2 versions prior grub-2.12. (CVE-2021-3695)

- A heap out-of-bounds write may heppen during the handling of Huffman tables in the PNG reader. This may lead to data corruption in the heap space. Confidentiality, Integrity and Availablity impact may be considered Low as it's very complex to an attacker control the encoding and positioning of corrupted Huffman entries to achieve results such as arbitrary code execution and/or secure boot circumvention. This flaw affects grub2 versions prior grub-2.12. (CVE-2021-3696)

- A crafted JPEG image may lead the JPEG reader to underflow its data pointer, allowing user-controlled data to be written in heap. To a successful to be performed the attacker needs to perform some triage over the heap layout and craft an image with a malicious format and payload. This vulnerability can lead to data corruption and eventual code execution or secure boot circumvention. This flaw affects grub2 versions prior grub-2.12. (CVE-2021-3697)

- A flaw in grub2 was found where its configuration file, known as grub.cfg, is being created with the wrong permission set allowing non privileged users to read its content. This represents a low severity confidentiality issue, as those users can eventually read any encrypted passwords present in grub.cfg.
This flaw affects grub2 2.06 and previous versions. This issue has been fixed in grub upstream but no version with the fix is currently released. (CVE-2021-3981)

- A buffer overflow was found in grub_font_construct_glyph(). A malicious crafted pf2 font can lead to an overflow when calculating the max_glyph_size value, allocating a smaller than needed buffer for the glyph, this further leads to a buffer overflow and a heap based out-of-bounds write. An attacker may use this vulnerability to circumvent the secure boot mechanism. (CVE-2022-2601)

- When rendering certain unicode sequences, grub2's font code doesn't proper validate if the informed glyph's width and height is constrained within bitmap size. As consequence an attacker can craft an input which will lead to a out-of-bounds write into grub2's heap, leading to memory corruption and availability issues. Although complex, arbitrary code execution could not be discarded. (CVE-2022-3775)

- grub2: Integer underflow in grub_net_recv_ip4_packets (CVE-2022-28733)

- grub2: Out-of-bound write when handling split HTTP headers (CVE-2022-28734)

- grub2: shim_lock verifier allows non-kernel files to be loaded (CVE-2022-28735)

- grub2: use-after-free in grub_cmd_chainloader() (CVE-2022-28736)

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

Solution

Run 'dnf update grub2 --releasever=2023.0.20230222 ' to update your system.

See Also

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

https://alas.aws.amazon.com/cve/html/CVE-2021-3695.html

https://alas.aws.amazon.com/cve/html/CVE-2021-3696.html

https://alas.aws.amazon.com/cve/html/CVE-2021-3697.html

https://alas.aws.amazon.com/cve/html/CVE-2021-3981.html

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

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

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

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

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

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

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

Plugin Details

Severity: High

ID: 173192

File Name: al2023_ALAS2023-2023-020.nasl

Version: 1.3

Type: local

Agent: unix

Published: 3/21/2023

Updated: 1/17/2024

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

Risk Information

VPR

Risk Factor: High

Score: 7.3

CVSS v2

Risk Factor: Medium

Base Score: 6.9

Temporal Score: 5.4

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

CVSS Score Source: CVE-2021-3696

CVSS v3

Risk Factor: High

Base Score: 8.6

Temporal Score: 7.7

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

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

CVSS Score Source: CVE-2022-2601

Vulnerability Information

CPE: p-cpe:/a:amazon:linux:grub2-debuginfo, p-cpe:/a:amazon:linux:grub2-efi-x64-cdboot, p-cpe:/a:amazon:linux:grub2-efi-aa64, p-cpe:/a:amazon:linux:grub2-tools-efi, p-cpe:/a:amazon:linux:grub2-efi-aa64-modules, p-cpe:/a:amazon:linux:grub2-efi-aa64-ec2, p-cpe:/a:amazon:linux:grub2-debugsource, p-cpe:/a:amazon:linux:grub2-emu, p-cpe:/a:amazon:linux:grub2-tools-extra, p-cpe:/a:amazon:linux:grub2-efi-aa64-cdboot, p-cpe:/a:amazon:linux:grub2-efi-x64-modules, p-cpe:/a:amazon:linux:grub2-pc-modules, p-cpe:/a:amazon:linux:grub2-tools-minimal-debuginfo, p-cpe:/a:amazon:linux:grub2-tools-extra-debuginfo, p-cpe:/a:amazon:linux:grub2-efi-x64, p-cpe:/a:amazon:linux:grub2-emu-debuginfo, p-cpe:/a:amazon:linux:grub2-common, p-cpe:/a:amazon:linux:grub2-tools-debuginfo, cpe:/o:amazon:linux:2023, p-cpe:/a:amazon:linux:grub2-pc, p-cpe:/a:amazon:linux:grub2-tools-minimal, p-cpe:/a:amazon:linux:grub2-tools, p-cpe:/a:amazon:linux:grub2-tools-efi-debuginfo, p-cpe:/a:amazon:linux:grub2-efi-x64-ec2, p-cpe:/a:amazon:linux:grub2-emu-modules

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: 2/17/2023

Vulnerability Publication Date: 7/30/2020

Reference Information

CVE: CVE-2021-3695, CVE-2021-3696, CVE-2021-3697, CVE-2021-3981, CVE-2022-2601, CVE-2022-28733, CVE-2022-28734, CVE-2022-28735, CVE-2022-28736, CVE-2022-3775

IAVA: 2020-A-0349