CVE-2024-2312
Medium · 6.7CVSS
6.7
EPSS
0.4%
Published
Apr 5, 2024
CISA due date
—
Cloudanix analysis
A problem in the way some Linux systems start up could let someone with physical access load their own software before security checks run.
- Exploitation
- Local Privilege
- Attacker needs
- High Privilege
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Firmware
- Class
- Use After Free
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
GRUB2 fails to invoke module fini functions during exit, allowing the peimage module on Debian/Ubuntu systems to retain UEFI system table hooks and trigger a use-after-free condition that may enable secure boot bypass.
Why it matters to the business
Local or physical attackers could load unauthorized code during the boot process on affected Linux systems, undermining firmware-level protections and increasing risk of persistent compromise; the issue has been public for over two years with negligible observed exploitation.
How an attack unfolds
An attacker with local or physical access loads or triggers the vulnerable peimage module in GRUB2, forces an exit without fini cleanup, then reuses the dangling UEFI hooks via the resulting use-after-free to inject code that bypasses secure boot verification.
How to fix it
Upgrade GRUB2 packages to versions that correctly invoke module fini functions on exit; rebuild and re-sign bootloaders if custom GRUB2 builds are in use.
How to confirm the fix worked
Inspect GRUB2 source for proper fini registration and test boot sequences on patched UEFI systems to confirm hooks are released; verify module unload behavior in logs or via debugging tools.
Typical attack path
- Obtain local or physical access to the target system
- Trigger or supply the peimage GRUB2 module
- Force GRUB2 exit without module cleanup
- Reuse freed UEFI system table hooks to inject malicious boot code
- Bypass secure boot and load unauthorized kernel or bootloader
How to detect it
Review system boot logs and GRUB2 module load/unload events for anomalies around exit sequences; examine UEFI variable or hook persistence after GRUB2 termination.
What your security team should do
- Apply GRUB2 updates from distribution vendors immediately on all Debian and Ubuntu UEFI systems
- Audit boot configurations for use of the peimage module
- Enable measured boot or additional firmware protections where possible
- Monitor EPSS and KEV updates for any future increase in exploit activity
The record
GRUB2 does not call the module fini functions on exit, leading to Debian/Ubuntu's peimage GRUB2 module leaving UEFI system table hooks after exit. This lead to a use-after-free condition, and could possibly lead to secure boot bypass.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:13 | grub2 | 0 | 2.12-2 |
| Debian:14 | grub2 | 0 | 2.12-2 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Micro 5.2 | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Micro 5.3 | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Micro 5.4 | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Micro 5.5 | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP7 | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Server 15 SP5-LTSS | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | shim | 0 | 16.1-150300.4.31.3 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | shim | 0 | 16.1-150300.4.31.3 |
| Ubuntu:24.04:LTS | grub2-signed | 0 | 1.202 |
| Ubuntu:24.04:LTS | grub2-unsigned | 0 | 2.12-1ubuntu7 |
| Ubuntu:24.10 | grub2-signed | 0 | 1.202 |
| Ubuntu:24.10 | grub2-unsigned | 0 | 2.12-1ubuntu7 |
| Ubuntu:Pro:14.04:LTS | grub2 | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | grub2-signed | 0 | No fix |
| openSUSE:Leap 15.6 | shim | 0 | 16.1-150300.4.31.3 |
| openSUSE:Leap 16.0 | shim | 0 | 16.1-160000.1.1 |
Related vulnerabilities
- CVE-2024-56738 GNU GRUB (aka GRUB2) through 2.12 does not use a constant-time algorithm for… Also affects grub2
- CVE-2024-56737 GNU GRUB (aka GRUB2) through 2.12 has a heap-based buffer overflow in fs/hfs.c via… Also affects grub2
- CVE-2024-49504 grub2 allowed attackers with access to the grub shell to access files on the encrypted… Also affects grub2
- CVE-2023-4692 An out-of-bounds write flaw was found in grub2's NTFS filesystem driver. Also affects grub2
- CVE-2023-4693 An out-of-bounds read flaw was found on grub2's NTFS filesystem driver. Also affects grub2
- CVE-2022-28736 There's a use-after-free vulnerability in grub_cmd_chainloader() function; The… Also affects grub2
- CVE-2022-28735 The GRUB2's shim_lock verifier allows non-kernel files to be loaded on shim-powered… Also affects grub2
- CVE-2022-28733 Integer underflow in grub_net_recv_ip4_packets; A malicious crafted IP packet can lead to… Also affects grub2