# CVE-2022-28737: There's a possible overflow in handle_image() when shim tries to load and execute crafted EFI executables

> An attacker can execute arbitrary code by exploiting a memory overflow in the shim bootloader when loading crafted EFI executables.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:L/AC:L/PR:H/UI:R/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:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 20 Jul 2023
- **Updated:** 22 Oct 2024
- **Also known as:** AZL-27559, AZL-35252, AZL-40910, AZL-41063, DEBIAN-CVE-2022-28737, GHSA-hmxr-46w2-jjwh, OESA-2022-1799, SUSE-SU-2023:1702-1, SUSE-SU-2023:1863-1, SUSE-SU-2023:2084-1, SUSE-SU-2023:2086-1, SUSE-SU-2023:2091-1, SUSE-SU-2023:2150-1, UBUNTU-CVE-2022-28737

## What is CVE-2022-28737?

CVE-2022-28737 is a medium-severity memory corruption vulnerability in Red Hat Bootloader Team shim, published on 20 Jul 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

There's a possible overflow in handle_image() when shim tries to load and execute crafted EFI executables; The handle_image() function takes into account the SizeOfRawData field from each section to be loaded. An attacker can leverage this to perform out-of-bound writes into memory. Arbitrary code execution is not discarded in such scenario.

Weakness: CWE-787 (Out-of-bounds Write)

## Which versions are affected by CVE-2022-28737?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `shim` | SUSE:Enterprise Storage 7 | All versions | 15.7-150100.3.35.1 |
| `shim` | SUSE:Enterprise Storage 7.1 | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Enterprise Storage 7.1 | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 15.7-150100.3.35.1 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 15.7-150100.3.35.1 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise Micro 5.1 | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise Micro 5.1 | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise Micro 5.2 | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise Micro 5.2 | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise Micro 5.3 | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise Micro 5.3 | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise Micro 5.4 | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise Micro 5.4 | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise Real Time 15 SP3 | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise Real Time 15 SP3 | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 15.7-22.15.1 |
| `shim` | SUSE:Linux Enterprise Server 12 SP4-ESPOS | All versions | 15.7-25.24.1 |
| `shim` | SUSE:Linux Enterprise Server 12 SP4-ESPOS | All versions | 15.7-25.27.1 |
| `shim` | SUSE:Linux Enterprise Server 12 SP4-LTSS | All versions | 15.7-25.24.1 |
| `shim` | SUSE:Linux Enterprise Server 12 SP4-LTSS | All versions | 15.7-25.27.1 |
| `shim` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 15.7-25.24.1 |
| `shim` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 15.7-25.27.1 |
| `shim` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 15.7-150100.3.35.1 |
| `shim` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 15.7-150100.3.35.1 |
| `shim` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 15.7-150300.4.16.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | All versions | 15.7-25.24.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | All versions | 15.7-25.27.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 15.7-25.24.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 15.7-25.27.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 15.7-150100.3.35.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 15.7-150100.3.35.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 15.7-150300.4.11.1 |
| `shim` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 15.7-150300.4.16.1 |

Products: Redhat Shim.

## How do I fix CVE-2022-28737?

Apply the vendor's patch.

## Is CVE-2022-28737 being exploited?

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

## Other vulnerabilities in Red Hat Bootloader Team shim

- [CVE-2014-3676](https://insights.sbomify.com/CVE-2014-3676/): Memory corruption in n/a (high 7.5)
- [CVE-2014-3677](https://insights.sbomify.com/CVE-2014-3677/): Memory corruption in n/a (high 7.5)
- [CVE-2014-3675](https://insights.sbomify.com/CVE-2014-3675/): Denial of service in n/a (medium 5.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-28737 and fix it if it is affected.

What it is: CVE-2022-28737 is a medium-severity memory corruption vulnerability in Red Hat Bootloader Team shim, published on 20 Jul 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-28737 in the wild and no public exploit code.

Affected product: Red Hat Bootloader Team shim. 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-2022-28737/ (Markdown: https://insights.sbomify.com/CVE-2022-28737/index.md)
```

## Sources

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

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