Skip to content

GRUB2 vulnerabilities - 2025/02/18

Daniel Kiper via Grub-devel grub-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest73 patches 28 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/73misc: Implement grub_strlcpy()include/grub/misc.h+39 -00 replies
2/73fs/ufs: Fix a heap OOB writegrub-core/fs/ufs.c+1 -10 replies
3/73fs/hfs: Fix stack OOB write with grub_strcpy()grub-core/fs/hfs.c+1 -10 replies
4/73fs/tar: Initialize name in grub_cpio_find_file()grub-core/fs/tar.c+5 -00 replies
5/73fs/tar: Integer overflow leads to heap OOB writegrub-core/fs/tar.c+18 -50 replies
6/73fs/f2fs: Set a grub_errno if mount failsgrub-core/fs/f2fs.c+3 -00 replies
7/73fs/hfsplus: Set a grub_errno if mount failsgrub-core/fs/hfsplus.c+1 -10 replies
8/73fs/iso9660: Set a grub_errno if mount failsgrub-core/fs/iso9660.c+3 -00 replies
9/73fs/iso9660: Fix invalid freegrub-core/fs/iso9660.c+12 -20 replies
10/73fs/jfs: Fix OOB read in jfs_getent()grub-core/fs/jfs.c+15 -20 replies
11/73fs/jfs: Fix OOB read caused by invalid dir slot indexgrub-core/fs/jfs.c+9 -00 replies
12/73fs/jfs: Use full 40 bits offset and address for a data extentgrub-core/fs/jfs.c+29 -120 replies
13/73fs/jfs: Inconsistent signed/unsigned types usage in return valuesgrub-core/fs/jfs.c+9 -60 replies
14/73fs/ext2: Fix out-of-bounds read for inline extentsgrub-core/fs/ext2.c+9 -11 reply
15/73fs/ntfs: Fix out-of-bounds readgrub-core/fs/ntfs.c+4 -10 replies
16/73fs/ntfs: Track the end of the MFT attribute buffergrub-core/fs/ntfs.c include/grub/ntfs.h+29 -60 replies
17/73fs/ntfs: Use a helper function to access attributesgrub-core/fs/ntfs.c include/grub/ntfs.h+58 -130 replies
18/73fs/ntfs: Implement attribute verificationgrub-core/fs/ntfs.c include/grub/ntfs.h+175 -07 replies
19/73fs/xfs: Fix out-of-bounds readgrub-core/fs/xfs.c+11 -00 replies
20/73fs/xfs: Ensuring failing to mount sets a grub_errnogrub-core/fs/xfs.c+3 -10 replies
21/73kern/file: Ensure file->data is setgrub-core/kern/file.c+3 -00 replies
22/73kern/file: Implement filesystem reference countinggrub-core/fs/affs.c grub-core/fs/bfs.c grub-core/fs/btrfs.c +28 more+40 -00 replies
23/73disk/cryptodisk: Require authentication after TPM unlock for CLI accessdocs/grub.texi grub-core/disk/cryptodisk.c grub-core/kern/main.c +6 more+172 -00 replies
24/73disk/loopback: Reference tracking for the loopbackgrub-core/disk/loopback.c include/grub/err.h+20 -10 replies
25/73kern/disk: Limit recursion depthgrub-core/kern/disk.c include/grub/err.h+22 -80 replies
26/73kern/partition: Limit recursion in part_iterate()grub-core/kern/partition.c+9 -10 replies
27/73script/execute: Limit the recursion depthgrub-core/script/execute.c+14 -00 replies
28/73net: Unregister net_default_ip and net_default_mac variables hooks on unloadgrub-core/net/net.c+2 -00 replies
29/73net: Remove variables hooks when interface is unregistedgrub-core/net/net.c include/grub/net.h+33 -100 replies
30/73net: Fix OOB write in grub_net_search_config_file()grub-core/net/net.c grub-core/normal/main.c include/grub/net.h+6 -50 replies
31/73net/tftp: Fix stack buffer overflow in tftp_open()grub-core/net/tftp.c+24 -140 replies
32/73video/readers/jpeg: Do not permit duplicate SOF0 markers in JPEGgrub-core/video/readers/jpeg.c+4 -00 replies
33/73kern/dl: Fix for an integer overflow in grub_dl_ref()grub-core/commands/minicmd.c grub-core/kern/dl.c include/grub/dl.h +1 more+19 -120 replies
34/73kern/dl: Use correct segment in grub_dl_set_mem_attrs()grub-core/kern/dl.c+1 -10 replies
35/73kern/dl: Check for the SHF_INFO_LINK flag in grub_dl_relocate_symbols()grub-core/kern/dl.c+3 -00 replies
36/73commands/extcmd: Missing check for failed allocationgrub-core/commands/extcmd.c+3 -00 replies
37/73commands/ls: Fix NULL dereferencegrub-core/commands/ls.c+5 -10 replies
38/73commands/pgp: Unregister the "check_signatures" hooks on module unloadgrub-core/commands/pgp.c+2 -00 replies
39/73normal: Remove variables hooks on module unloadgrub-core/normal/main.c+3 -10 replies
40/73gettext: Remove variables hooks on module unloadgrub-core/gettext/gettext.c+4 -00 replies
41/73gettext: Integer overflow leads to heap OOB write or readgrub-core/gettext/gettext.c+2 -20 replies
42/73gettext: Integer overflow leads to heap OOB writegrub-core/gettext/gettext.c+6 -10 replies
43/73commands/read: Fix an integer overflow when supplying more than 2^31 charactersgrub-core/commands/read.c+15 -40 replies
44/73commands/test: Stack overflow due to unlimited recursion depthgrub-core/commands/test.c+18 -30 replies
45/73commands/minicmd: Block the dump command in lockdown modegrub-core/commands/minicmd.c+2 -20 replies
46/73commands/memrw: Disable memory reading in lockdown modegrub-core/commands/memrw.c+12 -90 replies
47/73commands/hexdump: Disable memory reading in lockdown modegrub-core/commands/hexdump.c+6 -10 replies
48/73fs/bfs: Disable under lockdowngrub-core/fs/bfs.c+8 -30 replies
49/73fs: Disable many filesystems under lockdowngrub-core/fs/affs.c grub-core/fs/cbfs.c grub-core/fs/jfs.c +8 more+88 -339 replies
50/73disk: Use safe math macros to prevent overflowsgrub-core/disk/cryptodisk.c grub-core/disk/diskfilter.c grub-core/disk/ieee1275/obdisk.c +5 more+172 -340 replies
51/73disk: Prevent overflows when allocating memory for arraysgrub-core/disk/cryptodisk.c grub-core/disk/lvm.c+3 -50 replies
52/73disk: Check if returned pointer for allocated memory is NULLgrub-core/disk/ata.c grub-core/disk/ieee1275/obdisk.c grub-core/disk/ldm.c +2 more+30 -20 replies
53/73disk/ieee1275/ofdisk: Call grub_ieee1275_close() when grub_malloc() failsgrub-core/disk/ieee1275/ofdisk.c+4 -10 replies
54/73fs: Use safe math macros to prevent overflowsgrub-core/fs/archelp.c grub-core/fs/btrfs.c grub-core/fs/cpio_common.c +5 more+104 -190 replies
55/73fs: Prevent overflows when allocating memory for arraysgrub-core/fs/btrfs.c grub-core/fs/hfspluscomp.c grub-core/fs/squash4.c+13 -80 replies
56/73fs: Prevent overflows when assigning returned values from read_number()grub-core/fs/cpio_common.c grub-core/fs/tar.c+30 -110 replies
57/73fs/zfs: Use safe math macros to prevent overflowsgrub-core/fs/zfs/zfs.c+44 -60 replies
58/73fs/zfs: Prevent overflows when allocating memory for arraysgrub-core/fs/zfs/zfs.c+4 -40 replies
59/73fs/zfs: Check if returned pointer for allocated memory is NULLgrub-core/fs/zfs/zfs.c+26 -00 replies
60/73fs/zfs: Add missing NULL check after grub_strdup() callgrub-core/fs/zfs/zfs.c+2 -00 replies
61/73net: Use safe math macros to prevent overflowsgrub-core/net/bootp.c grub-core/net/dns.c grub-core/net/drivers/ieee1275/ofnet.c +1 more+75 -130 replies
62/73net: Prevent overflows when allocating memory for arraysgrub-core/net/dns.c grub-core/net/net.c+4 -40 replies
63/73net: Check if returned pointer for allocated memory is NULLgrub-core/net/net.c+5 -00 replies
64/73fs/sfs: Check if allocated memory is NULLgrub-core/fs/sfs.c+3 -00 replies
65/73script/execute: Fix potential underflow and NULL dereferencegrub-core/script/execute.c+3 -00 replies
66/73osdep/unix/getroot: Fix potential underflowgrub-core/osdep/linux/getroot.c+3 -00 replies
67/73misc: Ensure consistent overflow error messagesgrub-core/fs/ntfs.c grub-core/fs/ntfscomp.c grub-core/video/readers/png.c+3 -30 replies
68/73bus/usb/ehci: Define GRUB_EHCI_TOGGLE as grub_uint32_tgrub-core/bus/usb/ehci.c+1 -10 replies
69/73normal/menu: Use safe math to avoid an integer overflowgrub-core/normal/menu.c+2 -30 replies
70/73kern/partition: Add sanity check after grub_strtoul() callgrub-core/kern/partition.c+10 -20 replies
71/73kern/misc: Add sanity check after grub_strtoul() callgrub-core/kern/misc.c+7 -20 replies
72/73loader/i386/linux: Cast left shift to grub_uint32_tgrub-core/loader/i386/linux.c+1 -10 replies
73/73loader/i386/bsd: Use safe math to avoid underflowgrub-core/loader/i386/bsd.c+10 -40 replies

Reviews trailers per patch

All 73 patches have a Reviewed-by or Acked-by.

PatchDaniel KiperAlec BrownRoss Philipson
1/73R-b
2/73R-b
3/73R-b
4/73R-b
5/73R-b R-b
6/73R-b
7/73R-b
8/73R-b
9/73R-b
10/73R-b R-b
11/73R-b R-b
12/73R-b R-b R-b
13/73R-b R-b R-b
14/73R-b
15/73R-b
16/73R-b
17/73R-b
18/73R-b
19/73R-b
20/73R-b
21/73R-b
22/73R-b
23/73R-b
24/73R-b
25/73R-b
26/73R-b
27/73R-b
28/73R-b
29/73R-b
30/73R-b
31/73R-b
32/73R-b
33/73R-b
34/73R-b
35/73R-b
36/73R-b R-b
37/73R-b
38/73R-b
39/73R-b
40/73R-b
41/73R-b R-b
42/73R-b R-b
43/73R-b
44/73R-b
45/73R-b
46/73R-b
47/73R-b
48/73R-b
49/73R-b
50/73R-b
51/73R-b
52/73R-b
53/73R-b
54/73R-b
55/73R-b
56/73R-b
57/73R-b
58/73R-b
59/73R-b
60/73R-b
61/73R-b
62/73R-b
63/73R-b
64/73R-b R-b
65/73R-b
66/73R-b R-b
67/73R-b
68/73R-b
69/73R-b
70/73R-b
71/73R-b
72/73R-b
73/73R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [SECURITY PATCH 00/73] GRUB2 vulnerabilities - 2025/02/18

Hi all,

This patch set contains a bundle of fixes for various security flaws discovered, as part of a pro-active hardening effort, in the GRUB2 code recently. The most severe ones, i.e. potentially exploitable, have CVEs assigned and are listed at the end of this email.

Details of exactly what needs updating will be provided by the respective distros and vendors when updates become available.

Full mitigation against all CVEs will require updated shim with latest SBAT (Secure Boot Advanced Targeting) [1] data provided by distros and vendors. This time UEFI revocation list (dbx) will not be used and revocation of broken artifacts will be done with SBAT only. For information on how to apply the latest SBAT revocations, please see mokutil(1). Vendor shims may explicitly permit known older boot artifacts to boot.

Updated GRUB2, shim and other boot artifacts from all the affected vendors will be made available when the embargo lifts or some time thereafter.

I am posting all the GRUB2 upstream patches which fix all security bugs found and reported up until now. Major Linux distros carry or will carry soon one form or another of these patches. Now all the GRUB2 upstream patches are in the GRUB2 git repository [2] too.

I would like to thank Nils Langius, B Horn and Jonathan Bar Or for responsible disclosure and preparation of some patches needed to fix known issues.

Upstream fixing would not be possible without involvement of following people too:
- Alec Brown (Oracle),
- Daniel Axtens,
- Jan Setje-Eilers (Oracle),
- Lidong Chen (Oracle),
- Marco A Benatto (Red Hat),
- Michael Chang (SUSE),
- Ross Philipson (Oracle).

Thank you for your hard work!

Daniel

[1] https://github.com/rhboot/shim/blob/main/SBAT.md
https://github.com/rhboot/shim/blob/main/Delivering_Sbat_Revocations.md

[2] https://git.savannah.gnu.org/gitweb/?p=grub.git
https://git.savannah.gnu.org/git/grub.git

*******************************************************************************

CVE-2024-45774: reader/jpeg: Heap OOB Write during JPEG parsing CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.7

Extra SOF0 marker in JPEG file may lead to a out-of-bounds write. An attacker may leverage this by crafting a malicious JPEG file, leading the grub's JPEG parser to fail the bounds checking in its internal buffer resulting in a out-of-bounds memory write. The possibility of overwriting sensitve information in order to bypass secure boot protections are not discarded.

Reported-by Nils Langius

*******************************************************************************

CVE-2024-45775: commands/extcmd: Missing check for failed allocation CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:H - 5.2

In grub_extcmd_dispatcher() function grub2 calls grub_arg_list_alloc() to allocate memory for the grub's argument list, however it misses to check in case the memory allocation failed. Once the allocation failed, a NULL point will be processed by the parse_option() function leading grub to crash or in some rare scenarios corrupt the IVT data.

Reported-by Nils Langius

*******************************************************************************

CVE-2024-45776: grub-core/gettext: Integer overflow leads to Heap OOB Write and Read CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.7

When reading language .mo file in grub_mofile_open(), grub2 fails to verify to a integer overflow when allocating its internal buffer. A crafted .mo file may lead to the buffer size calculation to overflow leading to Out-of-bound reads and writes. An attacker may leverage this flaw to leak sensitive data or overwrite critical data possibly leading to the circumvention of secure boot protections.

Reported-by Nils Langius

*******************************************************************************

CVE-2024-45777: grub-core/gettext: Integer overflow leads to Heap OOB Write CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.7

The calculation of the translation buffer when reading a language .mo file in grub_gettext_getstr_from_position() may overflow leading to a Out-of-bound write. This may be leveraged by an attacker to overwrite senstive grub2's heap data, eventually leading to the circumvention of secure boot protections

Reported-by Nils Langius

*******************************************************************************

CVE-2024-45778: fs/bfs: Integer overflow in the BFS parser CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H - 4.1

There's a stack overflow when reading a BFS file system. A crafted BFS filesystem may lead to a uncontrolled loop causing grub2 to crash

Reported-by Nils Langius

*******************************************************************************

CVE-2024-45779: fs/bfs: Integer overflow leads to Heap OOB Read (Write?) in the BFS parser CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:H/A:N - 4.1

There's an integer overflow in the BFS file system driver. When reading a file with indirect extent map grub2 fails to validate the number of extent entries to be read. A crafted or corrupted BFS filesystem may cause a integer overflow during the file reading, leading to a Heap Ouf-of-Bounds read. As consequence sensitive data may be leaked or the grub2 to crash.

Reported-by Nils Langius

*******************************************************************************

CVE-2024-45780: fs/tar: Integer Overflow causes Heap OOB Write CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.7

When reading tar files, grub2 allocates an internal buffer for the file name however it fails to properly verify the allocation against possible Integer Overflows. It's possible to cause the allocation length to overflow with a crafted tar file leading to a head Out-of-bounds write, as consequence an attacker may leverage this to eventually circumvent secure boot protections.

Reported-by Nils Langius

*******************************************************************************

CVE-2024-45781: fs/ufs: OOB write in the heap CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.7

When reading a symbolic link's name from a UFS filesystem, grub2 fails to validate the string length taken as an input. The lack of validation may lead to a heap Out-of-bounds write, causing data integrity issues and eventually allowing an attacker to circumvent secure boot protections.

Reported-by B Horn

*******************************************************************************

CVE-2024-45782: fs/hfs: strcpy() using the volume name (fs/hfs.c:382) CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.7

When reading a HFS volume's name at grub_fs_mount(), the HFS filesystem driver performs a strcpy() using the user provided volume name as input without proper validating the volume name's length. This may read to a heap based Out-of-bounds write, impacting on grub's sensitive data integrity and eventually leading to secure boot protection bypass.

Reported-by B Horn

*******************************************************************************

CVE-2024-45783: fs/hfs+: refcount can be decremented twice CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H - 4.4

When failing to mount a HFS+ grub hfsplus filesystem driver doesn't properly set a ERRNO value. This may lead to a NULL pointer access.

Reported-by B Horn

*******************************************************************************

CVE-2025-0622: command/gpg: Use-after-free due to hooks not being removed on module unload CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.4

In some scenarios hooks created by loaded modules are not being removed when the related module is being unloaded. An attacker may leverage this by forcing the grub2 to call the hooks once the module which registered it was unloaded, leading to a Use-after-free vulnerability. If correctly exploited this vulnerability may result int Arbitrary Code Execution eventually allowing the attacker to by-pass secure boot protections.

Reported-by B Horn

*******************************************************************************

CVE-2025-0624: net: Out-of-bounds write in grub_net_search_config_file() CVSS:3.1/AV:A/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H - 7.5

During the network boot process when trying to search for the configuration file, grub copies data from a user controlled environment variable into an internal buffer using grub_strcpy() function. During this step it fails to consider the environment variable length when allocating the internal buffer, resulting in a out-of-bounds write. If correctly exploited this issue may result in remote code execution through the same network segment the grub is searching for the boot information, which can be used to by-pass secure boot protections.

Reported-by B Horn

*******************************************************************************

CVE-2025-0677: UFS: Integer overflow may lead to heap based out-of-bounds write when handling symlinks CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.4

When performing a symlink lookup the grub's UFS module check the inode's data size to allocate the internal buffer for reading the file content however it misses to check if the symlink data size has overflown. If that happens grub_malloc() may be called with a smaller value than needed, as consequence when further reading the data from disk into the buffer grub_ufs_lookup_symlink() function will write past the end of the allocated size. An attack may leverage that by crafting a malicious filesystem and as a result it will corrupt data stored in the heap, it's possible that arbitrary code execution may be achieved through it and to be used to by-pass secure boot mechanisms.

Reported-by Jonathan Bar Or

*******************************************************************************

CVE-2025-0678: squash4: Integer overflow may lead to heap based out-of-bounds write when reading data CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.4

When reading data from a squash4 filesystem, grub's squash4 fs module uses user-controlled parameters from the filesystem geometry to determine the internal buffers size, however it misses to properly check for integer overflows. A maliciouly crafted filesystem may lead some of those buffer size calculation to overflow, causing it to perform a grub_malloc() operation with a smaller size than expected. As a result the direct_read() will perform a heap based out-of-bounds write during data reading. This flaw may be leveraged to corrupt grub's internal critical data and may result in arbitrary code execution by-passing secure boot protections.

Reported-by Jonathan Bar Or

*******************************************************************************

CVE-2025-0684: reiserfs: Integer overflow when handling symlinks may lead to heap based out-of-bounds write when reading data CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.4

When performing a symlink lookup from a reiserfs filesystem, grub's reiserfs fs module uses user-controlled parameters from the filesystem geometry to determine the internal buffers size, however it misses to properly check for integer overflows. A maliciouly crafted filesystem may lead some of those buffer size calculation to overflow, causing it to perform a grub_malloc() operation with a smaller size than expected. As a result the grub_reiserfs_read_symlink() will call grub_reiserfs_read_real() with a overflown length parameter leading to a heap based out-of-bounds write during data reading. This flaw may be leveraged to corrupt grub's internal critical data and may result in arbitrary code execution by-passing secure boot protections.

Reported-by Jonathan Bar Or

*******************************************************************************

CVE-2025-0685: jfs: Integer overflow when handling symlinks may lead to heap based out-of-bounds write when reading data CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.4

When reading data from a jfs filesystem, grub's jfs filesystem module uses user-controlled parameters from the filesystem geometry to determine the internal buffers size, however it misses to properly check for integer overflows. A maliciouly crafted filesystem may lead some of those buffer size calculation to overflow, causing it to perform a grub_malloc() operation with a smaller size than expected. As a result the grub_jfs_lookup_symlink() function will write past of the internal buffer length during grub_jfs_read_file(). This flaw may be leveraged to corrupt grub's internal critical data and may result in arbitrary code execution by-passing secure boot protections.

Reported-by Jonathan Bar Or

*******************************************************************************

CVE-2025-0686: romfs: Integer overflow when handling symlinks may lead to heap based out-of-bounds write when reading data CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.4

When performing a symlink lookup from a romfs filesystem, grub's romfs filesystem module uses user-controlled parameters from the filesystem geometry to determine the internal buffers size, however it misses to properly check for integer overflows. A maliciouly crafted filesystem may lead some of those buffer size calculation to overflow, causing it to perform a grub_malloc() operation with a smaller size than expected. As a result the grub_romfs_read_symlink() may cause a out-of-bounds writes when calling grub_disk_read() function. This flaw may be leveraged to corrupt grub's internal critical data and may result in arbitrary code execution by-passing secure boot protections.

Reported-by Jonathan Bar Or

*******************************************************************************

CVE-2025-0689: udf: Heap based buffer overflow in grub_udf_read_block() may lead to arbitrary code execution CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.4

When reading data from disk, the grub's UDF filesystem module utilizes the user controlled data length metadata to allocate its internal buffers. In certain scenarios, while iterating through disk sectors, it assumes the read size from the disk is always smaller than the allocated buffer size which is not guaranteed. A crafted filesystem image may lead to a heap-based buffer overflow resulting in critical data to be corrupted, resulting in the risk of arbitrary code execution by-passing secure boot protections.

Reported-by Jonathan Bar Or

*******************************************************************************

CVE-2025-0690: read: Integer overflow may lead to out-of-bounds write CVSS:3.1/AV:P/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H - 6.1

The read command is used to read the keyboard input from the user, while reads it keeps the input length in a 32-bit integer value which is further used to reallocate the line buffer to accept the next character. During this process, with a line big enough it's possible to make this variable to overflow leading to a out-of-bounds write in the heap based buffer. This flaw may be leveraged to corrupt grub's internal critical data and secure boot bypass is not discarded as consequence.

Reported-by Jonathan Bar Or

*******************************************************************************

CVE-2025-1118: commands/dump: The dump command is not in lockdown when secure boot is enabled CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N - 4.4

The grub's dump command is not blocked when grub is in lockdown mode. This allows the user to read any memory information, an attacker may leverage that in order to extract signatures, salts and other sensitive information from the memory.

Reported-by B Horn
Reported-by Jonathan Bar Or

*******************************************************************************

CVE-2025-1125: fs/hfs: Interger overflow may lead to heap based out-of-bounds write CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H - 6.4

When reading data from a hfs filesystem, grub's hfs filesystem module uses user-controlled parameters from the filesystem metadata to calculate the internal buffers size, however it misses to properly check for integer overflows. A maliciouly crafted filesystem may lead some of those buffer size calculation to overflow, causing it to perform a grub_malloc() operation with a smaller size than expected. As a result the hfsplus_open_compressed_real() function will write past of the internal buffer length. This flaw may be leveraged to corrupt grub's internal critical data and may result in arbitrary code execution by-passing secure boot protections.

Reported-by Jonathan Bar Or

*******************************************************************************

 docs/grub.texi                         |  30 ++++
 grub-core/bus/usb/ehci.c               |   2 +-
 grub-core/commands/extcmd.c            |   3 +
 grub-core/commands/hexdump.c           |   7 +-
 grub-core/commands/ls.c                |   6 +-
 grub-core/commands/memrw.c             |  21 +--
 grub-core/commands/minicmd.c           |   6 +-
 grub-core/commands/pgp.c               |   2 +
 grub-core/commands/read.c              |  19 ++-
 grub-core/commands/test.c              |  21 ++-
 grub-core/disk/ata.c                   |   4 +-
 grub-core/disk/cryptodisk.c            | 124 +++++++++++++--
 grub-core/disk/diskfilter.c            |   9 +-
 grub-core/disk/ieee1275/obdisk.c       |  49 +++++-
 grub-core/disk/ieee1275/ofdisk.c       |  64 ++++++--
 grub-core/disk/ldm.c                   |  42 ++++-
 grub-core/disk/loopback.c              |  18 +++
 grub-core/disk/luks2.c                 |   7 +-
 grub-core/disk/lvm.c                   |  20 ++-
 grub-core/disk/memdisk.c               |   9 +-
 grub-core/disk/plainmount.c            |   9 +-
 grub-core/fs/affs.c                    |  10 +-
 grub-core/fs/archelp.c                 |   9 +-
 grub-core/fs/bfs.c                     |  10 +-
 grub-core/fs/btrfs.c                   |  39 ++++-
 grub-core/fs/cbfs.c                    |  10 +-
 grub-core/fs/cpio.c                    |   1 +
 grub-core/fs/cpio_be.c                 |   1 +
 grub-core/fs/cpio_common.c             |  34 +++-
 grub-core/fs/erofs.c                   |  10 +-
 grub-core/fs/ext2.c                    |  11 +-
 grub-core/fs/f2fs.c                    |  21 ++-
 grub-core/fs/fat.c                     |   1 +
 grub-core/fs/hfs.c                     |   3 +-
 grub-core/fs/hfsplus.c                 |   3 +-
 grub-core/fs/hfspluscomp.c             |   9 +-
 grub-core/fs/iso9660.c                 |  18 ++-
 grub-core/fs/jfs.c                     |  92 ++++++++---
 grub-core/fs/minix.c                   |  10 +-
 grub-core/fs/newc.c                    |   1 +
 grub-core/fs/nilfs2.c                  |  10 +-
 grub-core/fs/ntfs.c                    | 273 ++++++++++++++++++++++++++++++---
 grub-core/fs/ntfscomp.c                |  11 +-
 grub-core/fs/odc.c                     |   1 +
 grub-core/fs/proc.c                    |   1 +
 grub-core/fs/reiserfs.c                |  10 +-
 grub-core/fs/romfs.c                   |  10 +-
 grub-core/fs/sfs.c                     |  13 +-
 grub-core/fs/squash4.c                 |  21 ++-
 grub-core/fs/tar.c                     |  48 ++++--
 grub-core/fs/udf.c                     |  10 +-
 grub-core/fs/ufs.c                     |  12 +-
 grub-core/fs/xfs.c                     |  33 +++-
 grub-core/fs/zfs/zfs.c                 |  87 +++++++++--
 grub-core/gettext/gettext.c            |  15 +-
 grub-core/kern/disk.c                  |  27 +++-
 grub-core/kern/dl.c                    |  22 ++-
 grub-core/kern/file.c                  |  10 ++
 grub-core/kern/main.c                  |  12 ++
 grub-core/kern/misc.c                  |   9 +-
 grub-core/kern/partition.c             |  22 ++-
 grub-core/loader/i386/bsd.c            |  14 +-
 grub-core/loader/i386/linux.c          |   2 +-
 grub-core/net/bootp.c                  |  16 +-
 grub-core/net/dns.c                    |  13 +-
 grub-core/net/drivers/ieee1275/ofnet.c |  20 ++-
 grub-core/net/net.c                    |  93 +++++++++--
 grub-core/net/tftp.c                   |  38 +++--
 grub-core/normal/auth.c                |  30 ++++
 grub-core/normal/main.c                |  10 +-
 grub-core/normal/menu.c                |   5 +-
 grub-core/normal/menu_entry.c          |   4 +
 grub-core/osdep/linux/getroot.c        |   3 +
 grub-core/script/execute.c             |  17 ++
 grub-core/video/readers/jpeg.c         |   4 +
 grub-core/video/readers/png.c          |   2 +-
 include/grub/auth.h                    |   1 +
 include/grub/cryptodisk.h              |   3 +
 include/grub/dl.h                      |   8 +-
 include/grub/err.h                     |   4 +-
 include/grub/fs.h                      |   4 +
 include/grub/misc.h                    |  41 +++++
 include/grub/net.h                     |  13 +-
 include/grub/ntfs.h                    |  25 +++
 util/misc.c                            |   4 +-
 85 files changed, 1524 insertions(+), 272 deletions(-)

Alec Brown (10):
disk: Use safe math macros to prevent overflows
disk: Prevent overflows when allocating memory for arrays
disk: Check if returned pointer for allocated memory is NULL disk/ieee1275/ofdisk: Call grub_ieee1275_close() when grub_malloc() fails
net: Check if returned pointer for allocated memory is NULL fs/sfs: Check if allocated memory is NULL
bus/usb/ehci: Define GRUB_EHCI_TOGGLE as grub_uint32_t normal/menu: Use safe math to avoid an integer overflow loader/i386/linux: Cast left shift to grub_uint32_t loader/i386/bsd: Use safe math to avoid underflow

B Horn (31):
misc: Implement grub_strlcpy()
fs/ufs: Fix a heap OOB write
fs/hfs: Fix stack OOB write with grub_strcpy()
fs/tar: Initialize name in grub_cpio_find_file()
fs/f2fs: Set a grub_errno if mount fails
fs/hfsplus: Set a grub_errno if mount fails
fs/iso9660: Set a grub_errno if mount fails
fs/ntfs: Track the end of the MFT attribute buffer
fs/ntfs: Use a helper function to access attributes
fs/ntfs: Implement attribute verification
fs/xfs: Ensuring failing to mount sets a grub_errno
kern/file: Ensure file->data is set
kern/file: Implement filesystem reference counting disk/loopback: Reference tracking for the loopback
kern/disk: Limit recursion depth
kern/partition: Limit recursion in part_iterate() script/execute: Limit the recursion depth
net: Unregister net_default_ip and net_default_mac variables hooks on unload
net: Remove variables hooks when interface is unregisted
net: Fix OOB write in grub_net_search_config_file()
net/tftp: Fix stack buffer overflow in tftp_open()
kern/dl: Fix for an integer overflow in grub_dl_ref()
kern/dl: Use correct segment in grub_dl_set_mem_attrs() kern/dl: Check for the SHF_INFO_LINK flag in grub_dl_relocate_symbols() commands/ls: Fix NULL dereference
commands/pgp: Unregister the "check_signatures" hooks on module unload
normal: Remove variables hooks on module unload
gettext: Remove variables hooks on module unload commands/minicmd: Block the dump command in lockdown mode commands/memrw: Disable memory reading in lockdown mode commands/hexdump: Disable memory reading in lockdown mode

Daniel Axtens (3):
video/readers/jpeg: Do not permit duplicate SOF0 markers in JPEG fs/bfs: Disable under lockdown
fs: Disable many filesystems under lockdown

Jonathan Bar Or (1):
commands/read: Fix an integer overflow when supplying more than 2^31 characters

Lidong Chen (23):
fs/tar: Integer overflow leads to heap OOB write
fs/jfs: Fix OOB read in jfs_getent()
fs/jfs: Fix OOB read caused by invalid dir slot index fs/jfs: Use full 40 bits offset and address for a data extent fs/jfs: Inconsistent signed/unsigned types usage in return values commands/extcmd: Missing check for failed allocation
gettext: Integer overflow leads to heap OOB write or read
gettext: Integer overflow leads to heap OOB write commands/test: Stack overflow due to unlimited recursion depth
fs: Use safe math macros to prevent overflows
fs: Prevent overflows when allocating memory for arrays
fs: Prevent overflows when assigning returned values from read_number() fs/zfs: Use safe math macros to prevent overflows
fs/zfs: Prevent overflows when allocating memory for arrays fs/zfs: Check if returned pointer for allocated memory is NULL fs/zfs: Add missing NULL check after grub_strdup() call
net: Use safe math macros to prevent overflows
net: Prevent overflows when allocating memory for arrays script/execute: Fix potential underflow and NULL dereference osdep/unix/getroot: Fix potential underflow
misc: Ensure consistent overflow error messages kern/partition: Add sanity check after grub_strtoul() call kern/misc: Add sanity check after grub_strtoul() call

Michael Chang (5):
fs/iso9660: Fix invalid free
fs/ext2: Fix out-of-bounds read for inline extents
fs/ntfs: Fix out-of-bounds read
fs/xfs: Fix out-of-bounds read
disk/cryptodisk: Require authentication after TPM unlock for CLI access

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel