# CVE-2026-12632: Out-of-bounds read in Zephyr PTP message parsing from unvalidated message type

> Remote attackers can cause denial of service or potential memory corruption in Zephyr RTOS by sending malformed PTP messages to nodes with PTP enabled.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 18 Aug 2026
- **Updated:** 19 Aug 2026
- **Also known as:** GHSA-frjr-h396-7wh4

## What is CVE-2026-12632?

CVE-2026-12632 is a medium-severity memory corruption vulnerability in zephyrproject zephyr, published on 18 Aug 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Zephyr's Precision Time Protocol receive handler ptp_msg_post_recv() in subsys/net/lib/ptp/msg.c takes the 4-bit message type straight off the wire via ptp_msg_type() (msg->header.type_major_sdo_id & 0xF, range 0-15) and uses it to index the msg_size[] table. That table only defines entries up to PTP_MSG_MANAGEMENT (0xD), giving it ARRAY_SIZE == 14. Before the fix there was no upper-bound check, so the undefined types 0xE and 0xF indexed one or two int slots past the end of the array — an out-of-bounds read of adjacent read-only data.

The out-of-bounds value is then reused as a length: it gates msg_size[type] > cnt, and when it is small or negative it makes cnt - msg_size[type] a large positive budget passed to msg_tlv_post_recv(), whose TLV loop then walks the message suffix past the received bytes, performing further out-of-bounds reads and in-place byte-swap writes on memory beyond the message slab.

The defect is reached directly from the network: ptp_port_event_gen() in subsys/net/lib/ptp/port.c reads a PTP frame with ptp_transport_recv() and calls ptp_msg_post_recv() with the attacker-chosen type. PTP uses UDP multicast or raw Ethernet (0x88F7) and is unauthenticated, so any host on the same link can trigger the indexing on a CONFIG_PTP-enabled node with no preconditions.

The reliably reproducible impact is a denial of service (fault/crash); a limited memory-corruption path exists but depends on the build-specific value adjacent to msg_size[], which the attacker cannot tune. The fix rejects type >= ARRAY_SIZE(msg_size) with -EBADMSG before any indexing.

Weakness: CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2026-12632?


## How do I fix CVE-2026-12632?

No fix has been published for CVE-2026-12632 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-12632 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-12632 and fix it if it is affected.

What it is: CVE-2026-12632 is a medium-severity memory corruption vulnerability in zephyrproject zephyr, published on 18 Aug 2026. 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-2026-12632 in the wild and no public exploit code.

Affected product: zephyrproject zephyr. 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-2026-12632/ (Markdown: https://insights.sbomify.com/CVE-2026-12632/index.md)
```

## Sources

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

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