# CVE-2024-2312: Use after free in Debian based GNU GRUB

> A use-after-free in GRUB2's peimage module allows attackers to bypass Secure Boot by leaving UEFI system table hooks active after exit.

- **Severity:** Medium 6.7 (`CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Apr 2024
- **Updated:** 13 Feb 2025
- **Also known as:** DEBIAN-CVE-2024-2312, GHSA-975v-wj6r-fgj8, SUSE-RU-2026:20004-1, SUSE-RU-2026:20056-1, SUSE-RU-2026:20683-1, SUSE-SU-2026:0741-1, SUSE-SU-2026:0741-2, SUSE-SU-2026:1414-1, UBUNTU-CVE-2024-2312, openSUSE-RU-2026:20325-1

## What is CVE-2024-2312?

CVE-2024-2312 is a medium-severity use after free vulnerability in Netapp Bootstrap Os, published on 5 Apr 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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.

Weakness: CWE-416 (Use After Free)

## Which versions are affected by CVE-2024-2312?

It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Micro 5.2 | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Micro 5.3 | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Micro 5.4 | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Micro 5.5 | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Server 12 SP5-LTSS | All versions | 16.1-25.34.1 |
| `shim` | SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Server 15 SP5-LTSS | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Server 15 SP6-LTSS | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | All versions | 16.1-25.34.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 15 SP6 | All versions | 16.1-150300.4.31.3 |
| `shim` | SUSE:Linux Micro 6.0 | All versions | 16.1-1.1 |
| `shim` | SUSE:Linux Micro 6.1 | All versions | 16.1-slfo.1.1_1.1 |
| `shim` | SUSE:Linux Micro 6.2 | All versions | 16.1-160000.1.1 |
| `shim` | openSUSE:Leap 15.6 | All versions | 16.1-150300.4.31.3 |
| `shim` | openSUSE:Leap 16.0 | All versions | 16.1-160000.1.1 |

Products: Gnu Grub2, Netapp Bootstrap Os.

## How do I fix CVE-2024-2312?

Apply the vendor's patch.

## Is CVE-2024-2312 being exploited?

There is no known exploitation of CVE-2024-2312 in the wild and no public exploit code.

## Other vulnerabilities in Netapp Bootstrap Os

- [CVE-2024-56737](https://insights.sbomify.com/CVE-2024-56737/): Memory corruption in GRUB2 (high 8.8)
- [CVE-2022-28733](https://insights.sbomify.com/CVE-2022-28733/): Integer underflow in grub_net_recv_ip4_packets (high 8.1)
- [CVE-2022-28734](https://insights.sbomify.com/CVE-2022-28734/): Out-of-bounds write when handling split HTTP headers (high 8.1)
- [CVE-2025-61662](https://insights.sbomify.com/CVE-2025-61662/): Grub2: missing unregister call for gettext command may lead to use-after-free (high 7.8)
- [CVE-2024-45782](https://insights.sbomify.com/CVE-2024-45782/): Grub2: fs/hfs: strcpy() using the volume name (fs/hfs.c:382) (high 7.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-2312 and fix it if it is affected.

What it is: CVE-2024-2312 is a medium-severity use after free vulnerability in Netapp Bootstrap Os, published on 5 Apr 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-2312 in the wild and no public exploit code.

Affected product: Netapp Bootstrap Os. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-2312/ (Markdown: https://insights.sbomify.com/CVE-2024-2312/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-2312
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-2312
- OSV: https://osv.dev/vulnerability/CVE-2024-2312

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-2312/
Summaries are generated and may contain mistakes; the official description above is the record.
