Uninitialised stack memory leaks into MCUboot measured-boot record
Key facts
- Attack vector
- Physical
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- Low · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-457 and the CVSS impact.
Summary
MCUboot from 1.6.0 before 2.5.0 can copy uninitialised bootloader stack memory into the measured-boot record. The EXPECTED_HASH TLV is read into a stack buffer that is never zero-initialised, and a short TLV leaves its tail holding stale stack content. An attacker who can add a crafted hash TLV to a signed image or place a crafted image in a build with primary-slot validation off can leak up to IMAGE_HASH_SIZE minus one bytes of bootloader stack (CWE-457). The attacker needs local access with low privileges and the flaw only applies to MCUBOOT_MEASURED_BOOT builds.
Written with Claude Haiku 5.5 from the sources below · 2026-11-13
Description from the CNA
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Upgrade mcu-tools MCUboot to version 2.5.0 or later. CISA has not listed this vulnerability in its Known Exploited Vulnerabilities catalog.
Written with Claude Haiku 5.5 from the sources below · 2026-11-13
- Fix · CNA mcuboot (mcu-tools) Fixed in 2.5.0
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
mcu-tools mcuboot 2.5.0
7 records Highest priority Priority LOW 7 LOW
Other records, highest priority first
- TI-2026-91071 NULL pointer dereference in MCUboot serial recovery image uploadPriority LOW 17
- TI-2026-91078 Out-of-bounds read in MCUboot image hash during validationPriority LOW 13
- TI-2026-91074 MCUboot split-image out-of-bounds stack write with SHA-384/SHA-512Priority LOW 13
Timeline
- 2026-11-13 Threatist record created from CVE-2026-16662
- 2026-11-13 Alias added: GHSA-wwg9-9xxp-r5fj
References
Patch 1
Other 1
More mcu-tools vulnerabilities
- TI-2024-21755 MCUboot Injection attack of unprotected TLV values CVSS 3.1HIGH 7.7
- TI-2026-91073 Out-of-bounds read in MCUboot serial recovery image index CVSS 3.1MEDIUM 5.1
- TI-2026-91071 NULL pointer dereference in MCUboot serial recovery image upload CVSS 3.1MEDIUM 4.0
- TI-2026-91078 Out-of-bounds read in MCUboot image hash during validation CVSS 3.1LOW 2.9
- TI-2026-91074 MCUboot split-image out-of-bounds stack write with SHA-384/SHA-512 CVSS 3.1LOW 2.9
- TI-2026-91077 MCUboot TLV iterator reads entries without bounds check against TLV area CVSS 3.1LOW 2.0
Sources
- CVE-2026-16662 · CVE Program
- CVE-2026-16662 · NVD
- FIRST EPSS
- GHSA-wwg9-9xxp-r5fj · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences