# CVE-2023-43632: Freely Allocate Buffer on The Stack With Data From Socket

> An attacker can crash the system or execute arbitrary code with high privileges by sending a large size header to the VTPM server, causing a stack buffer overflow.

- **Severity:** Critical 9.0 (`CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`)
- **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:** 21 Sep 2023
- **Updated:** 24 Sep 2024
- **Also known as:** GHSA-6jp5-grgh-jw42, GO-2026-4422

## What is CVE-2023-43632?

CVE-2023-43632 is a critical memory corruption vulnerability in EVE OS, published on 21 Sep 2023. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

As noted in the “VTPM.md” file in the eve documentation, “VTPM is a server listening on port
8877 in EVE, exposing limited functionality of the TPM to the clients. 
VTPM allows clients to
execute tpm2-tools binaries from a list of hardcoded options”
The communication with this server is done using protobuf, and the data is comprised of 2
parts:

1. Header

2. Data

When a connection is made, the server is waiting for 4 bytes of data, which will be the header,
and these 4 bytes would be parsed as uint32 size of the actual data to come.

Then, in the function “handleRequest” this size is then used in order to allocate a payload on
the stack for the incoming data.

As this payload is allocated on the stack, this will allow overflowing the stack size allocated for
the relevant process with freely controlled data.

* An attacker can crash the system. 
* An attacker can gain control over the system, specifically on the “vtpm_server” process
which has very high privileges.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling), CWE-789 (Memory Allocation with Excessive Size Value)

## Which versions are affected by CVE-2023-43632?

3 open source packages ship an affected version, including github.com/lf-edge/eve. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/lf-edge/eve` | Go | All versions | 0.0.0-20230519072751-977f42b07fa9 |
| `github.com/lf-edge/eve` | Go | All versions | 0.0.0-20230519072751-977f42b07fa9 |
| `github.com/lf-edge/eve` | Go | All versions | 0.0.0-20230519072751-977f42b07fa9 |

Products: Linuxfoundation Edge Virtualization Engine.

## How do I fix CVE-2023-43632?

Upgrade github.com/lf-edge/eve to 0.0.0-20230519072751-977f42b07fa9 or later.

## Is CVE-2023-43632 being exploited?

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

## Other vulnerabilities in EVE OS

- [CVE-2023-43631](https://insights.sbomify.com/CVE-2023-43631/): SSH as Root Unlockable Without Triggering Measured Boot (high 8.8)
- [CVE-2023-43630](https://insights.sbomify.com/CVE-2023-43630/): Config Partition Not Measured From 2 Fronts (high 8.8)
- [CVE-2023-43635](https://insights.sbomify.com/CVE-2023-43635/): Vault Key Sealed With SHA1 PCRs (high 8.8)
- [CVE-2023-43636](https://insights.sbomify.com/CVE-2023-43636/): Rootfs Not Protected (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-43632 and fix it if it is affected.

What it is: CVE-2023-43632 is a critical memory corruption vulnerability in EVE OS, published on 21 Sep 2023. 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-2023-43632 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/lf-edge/eve (Go): affected all versions; fixed in 0.0.0-20230519072751-977f42b07fa9
- github.com/lf-edge/eve (Go): affected all versions; fixed in 0.0.0-20230519072751-977f42b07fa9
- github.com/lf-edge/eve (Go): affected all versions; fixed in 0.0.0-20230519072751-977f42b07fa9

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-2023-43632/ (Markdown: https://insights.sbomify.com/CVE-2023-43632/index.md)
```

## Sources

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

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