# CVE-2026-16662: Uninitialised bootloader stack disclosed into the measured-boot attestation record via a short EXPECTED\_HASH TLV in MCUboot

- **Severity:** LOW 2.4
- **CVSS:** 2.4 (v3.1, CNA) `CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`
- **CVSS metrics:** Attack vector: Physical; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.20% (percentile 5, 2026-11-28)
- **CWE:** CWE-457
- **Published:** 2026-11-13T00:23:00.336Z
- **Modified:** 2026-11-24T23:13:19.552Z

## Who should check

- Anyone running mcu-tools mcuboot \>= 1.6.0, \< 2.5.0

## Description

boot\_save\_boot\_status() in boot/bootutil/src/boot\_record.c reads the image's EXPECTED\_HASH\_TLV into a stack buffer image\_hash\[IMAGE\_HASH\_SIZE\] that is never zero-initialised. The TLV handler validates only the upper bound (len \> sizeof(image\_hash)) and then reads exactly len bytes, so a TLV shorter than IMAGE\_HASH\_SIZE leaves the tail of image\_hash holding stale stack content. The subsequent copy into the boot record, memcpy(buf + offset, image\_hash, sizeof(image\_hash)), uses the fixed buffer size rather than len, so up to IMAGE\_HASH\_SIZE - 1 bytes of uninitialised bootloader stack are written into the measured-boot record.

The defect is reachable only under MCUBOOT\_MEASURED\_BOOT, and only when nothing has checked the length of the hash TLV before boot\_save\_boot\_status() reads it. bootutil\_img\_validate() rejects a hash TLV whose length is not exactly sizeof(hash) (boot/bootutil/src/image\_validate.c:345), and primary-slot validation is on by default (Zephyr's CONFIG\_BOOT\_VALIDATE\_SLOT0 defaults to y), so in a default build the malformed image never reaches this code. Two kinds of build let a short TLV through:

Builds that use pure signatures (MCUBOOT\_SIGN\_PURE, Zephyr CONFIG\_BOOT\_SIGNATURE\_TYPE\_PURE). The signature covers the image itself, so the hash-TLV check in bootutil\_img\_validate() is compiled out, and a pure-signed image normally carries no hash TLV. A hash TLV is still allowed in the unprotected TLV area, which the signature does not cover, so a short one can be added to a correctly signed image without invalidating it. This applies with every upgrade strategy, including direct-XIP and RAM-load, and the modified image can be delivered through any path that accepts a signed image.
Builds with primary-slot validation turned off: the swap and overwrite loader built without MCUBOOT\_VALIDATE\_PRIMARY\_SLOT, which checks only the image magic before calling boot\_add\_shared\_data(), and the Zephyr single-slot loader (boot/zephyr/single\_loader.c) built without it, including the MCUBOOT\_VALIDATE\_PRIMARY\_SLOT\_ONCE variant, which skips validation once the trailer records an earlier successful one. Placing the crafted image requires physical or flash-write access to the device; in a single-slot build with serial recovery enabled, the serial-recovery upload writes the primary slot directly and can place it as well. Outside pure-signature builds, the direct-XIP and RAM-load strategies in boot/bootutil/src/loader.c validate the selected slot unconditionally and are not affected.

It is also reachable through a time-of-check/time-of-use change to tamperable external flash between validation and the boot-record read.

In these configurations the boot record's measurement is already not trustworthy: the hash copied into the record is the image's own EXPECTED\_HASH\_TLV, which nothing has verified and which the attacker chooses. The defect therefore does not weaken attestation integrity any further. What it adds is a path for bootloader memory to leave the device: up to 63 bytes (IMAGE\_HASH\_SIZE - 1) of uninitialised bootloader stack are embedded in the measurement field that a downstream attestation service sends to a remote verifier. In the configurations analysed the residue is bootloader internal state (TLV offsets and lengths, flash addresses, loop state), not key material, but what occupies that stack region depends on configuration and on which code ran before boot\_save\_boot\_status(). It is reported as a low-severity, defense-in-depth disclosure with no integrity or availability impact.

This is distinct from the already-fixed record\_len integer underflow in the same routine (GHSA-8hrv-4cp5-4rg3). The fix rejects any EXPECTED\_HASH\_TLV whose length is not exactly IMAGE\_HASH\_SIZE.

## Affected and fixed versions

- mcu-tools mcuboot: \>= 1.6.0, \< 2.5.0 (cvelist)

## Mitigation

- Upgrade mcuboot to 2.5.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-16662. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-16662.md
Affected: mcu-tools mcuboot >= 1.6.0, < 2.5.0
Fixed in: mcu-tools mcuboot 2.5.0

Steps:
1. Search this machine and project for mcu-tools mcuboot: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-16662 being exploited?

There is no confirmed exploitation: CVE-2026-16662 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.20% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-16662?

Low: CVSS 2.4 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

mcu-tools mcuboot \>= 1.6.0, \< 2.5.0.

### Is there a fix for CVE-2026-16662?

Yes. Fixed in mcu-tools mcuboot 2.5.0. Upgrade mcuboot to 2.5.0 or later.

### How do I check if I'm affected by CVE-2026-16662?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/mcu-tools/mcuboot/security/advisories/GHSA-779w-4x76-5chf>
- patch: <https://github.com/mcu-tools/mcuboot/commit/5098d8eef1139abd3d821d8138a6321d656dcd3e>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-16662>
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

HTML: <https://flawdb.com/CVE-2026-16662> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-16662>
