# CVE-2024-38796: Integer overflow in PeCoffLoaderRelocateImage

> An integer overflow in EDK2 allows attackers to cause memory corruption via network, leading to potential code execution or denial of service.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Sep 2024
- **Updated:** 3 Nov 2025
- **Also known as:** ALSA-2024:11185, ALSA-2024:11219, AZL-49710, AZL-49713, AZL-49716, DEBIAN-CVE-2024-38796, GHSA-xpcr-7hjq-m6qm, OESA-2024-2265, RHSA-2024:10268, RHSA-2024:10272, RHSA-2024:11185, RHSA-2024:11194, RHSA-2024:11219, RHSA-2024:9921, RHSA-2024:9930, RHSA-2024:9946, RHSA-2024:9956, RLSA-2024:11185, RLSA-2024:11219, UBUNTU-CVE-2024-38796

## What is CVE-2024-38796?

CVE-2024-38796 is a medium-severity vulnerability in TianoCore EDK2, published on 27 Sep 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

EDK2 contains a vulnerability in the PeCoffLoaderRelocateImage(). An Attacker may cause memory corruption due to an overflow via an adjacent network. A successful exploit of this vulnerability may lead to a loss of Confidentiality, Integrity, and/or Availability.

Weakness: CWE-122 (Heap-based Buffer Overflow)

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `edk2-aarch64` | AlmaLinux:8 | All versions | 20220126gitbb1bba3d77-13.el8_10.4 |
| `edk2-ovmf` | AlmaLinux:8 | All versions | 20220126gitbb1bba3d77-13.el8_10.4 |
| `edk2-aarch64` | AlmaLinux:9 | All versions | 20240524-6.el9_5.3 |
| `edk2-ovmf` | AlmaLinux:9 | All versions | 20240524-6.el9_5.3 |
| `edk2-tools` | AlmaLinux:9 | All versions | 20240524-6.el9_5.3 |
| `edk2-tools-doc` | AlmaLinux:9 | All versions | 20240524-6.el9_5.3 |
| `edk2` | Red Hat:enterprise_linux:8::appstream | All versions | 0:20220126gitbb1bba3d77-13.el8_10.4 |
| `edk2-aarch64` | Red Hat:enterprise_linux:8::appstream | All versions | 0:20220126gitbb1bba3d77-13.el8_10.4 |
| `edk2-ovmf` | Red Hat:enterprise_linux:8::appstream | All versions | 0:20220126gitbb1bba3d77-13.el8_10.4 |
| `edk2` | Red Hat:enterprise_linux:9::appstream | All versions | 0:20240524-6.el9_5.3 |
| `edk2-aarch64` | Red Hat:enterprise_linux:9::appstream | All versions | 0:20240524-6.el9_5.3 |
| `edk2-ovmf` | Red Hat:enterprise_linux:9::appstream | All versions | 0:20240524-6.el9_5.3 |
| `edk2-aarch64` | Red Hat:enterprise_linux:9::crb | All versions | 0:20240524-6.el9_5.3 |
| `edk2-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 0:20240524-6.el9_5.3 |
| `edk2-ovmf` | Red Hat:enterprise_linux:9::crb | All versions | 0:20240524-6.el9_5.3 |
| `edk2-tools` | Red Hat:enterprise_linux:9::crb | All versions | 0:20240524-6.el9_5.3 |
| `edk2-tools-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:20240524-6.el9_5.3 |
| `edk2-tools-doc` | Red Hat:enterprise_linux:9::crb | All versions | 0:20240524-6.el9_5.3 |
| `edk2` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:20190829git37eef91017ad-9.el8_2.6 |
| `edk2-ovmf` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:20190829git37eef91017ad-9.el8_2.6 |
| `edk2` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:20200602gitca407c7246bf-4.el8_4.7 |
| `edk2-ovmf` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:20200602gitca407c7246bf-4.el8_4.7 |
| `edk2` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:20220126gitbb1bba3d77-2.el8_6.7 |
| `edk2-ovmf` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:20220126gitbb1bba3d77-2.el8_6.7 |
| `edk2` | Red Hat:rhel_e4s:8.4::appstream | All versions | 0:20200602gitca407c7246bf-4.el8_4.7 |
| `edk2-ovmf` | Red Hat:rhel_e4s:8.4::appstream | All versions | 0:20200602gitca407c7246bf-4.el8_4.7 |
| `edk2` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:20220126gitbb1bba3d77-2.el8_6.7 |
| `edk2-aarch64` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:20220126gitbb1bba3d77-2.el8_6.7 |
| `edk2-ovmf` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:20220126gitbb1bba3d77-2.el8_6.7 |
| `edk2` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:20220126gitbb1bba3d77-3.el9_0.6 |
| `edk2-aarch64` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:20220126gitbb1bba3d77-3.el9_0.6 |
| `edk2-ovmf` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:20220126gitbb1bba3d77-3.el9_0.6 |
| `edk2` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:20220126gitbb1bba3d77-4.el8_8.7 |
| `edk2-aarch64` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:20220126gitbb1bba3d77-4.el8_8.7 |
| `edk2-ovmf` | Red Hat:rhel_eus:8.8::appstream | All versions | 0:20220126gitbb1bba3d77-4.el8_8.7 |
| `edk2` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:20221207gitfff6d81270b5-9.el9_2.5 |
| `edk2-aarch64` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:20221207gitfff6d81270b5-9.el9_2.5 |
| `edk2-ovmf` | Red Hat:rhel_eus:9.2::appstream | All versions | 0:20221207gitfff6d81270b5-9.el9_2.5 |
| `edk2-aarch64` | Red Hat:rhel_eus:9.2::crb | All versions | 0:20221207gitfff6d81270b5-9.el9_2.5 |
| `edk2-debugsource` | Red Hat:rhel_eus:9.2::crb | All versions | 0:20221207gitfff6d81270b5-9.el9_2.5 |

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

Apply the vendor's patch.

## Is CVE-2024-38796 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-38796 is a medium-severity vulnerability in TianoCore EDK2, published on 27 Sep 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-38796 in the wild and no public exploit code.

Affected product: TianoCore EDK2. 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-38796/ (Markdown: https://insights.sbomify.com/CVE-2024-38796/index.md)
```

## Sources

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

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