PT-2026-158555
CVE-2026-16666
·
Published
2026-11-24
·
Updated
2026-11-25
Description by
CVSS 3.1
5.7
MediumMetricsAV:L/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H
Name of the Vulnerable Software and Affected Versions
MCUboot (affected versions not specified)
Description
An issue exists when the bootloader resumes an interrupted image swap by trusting the
swap size value stored in the flash-resident status trailer without proper validation. In the boot swap image() function (located in boot/bootutil/src/loader.c), the resume branch assigns bs->swap size to copy size without bounds checking. This value is then passed to swap run(), which uses while (1) loops in functions such as find last idx(), find last sector idx(), and boot img sector off() to calculate sector indices. Because there is no ceiling on the sector count, an oversized swap size can lead to out-of-bounds reads of the BOOT MAX IMG SECTORS array. If a sector size of 0 is encountered, it can cause a non-terminating loop. Ultimately, this allows an attacker to trigger an out-of-bounds flash erase or copy via boot erase region() or boot copy region(), potentially resulting in bootloader memory corruption or bricking the device. This is exploitable via the unauthenticated serial recovery feature, which allows an attacker to write a forged status trailer to the primary slot. The issue affects builds using MCUBOOT SWAP USING MOVE, MCUBOOT SWAP USING SCRATCH, or MCUBOOT SWAP USING OFFSET combined with MCUBOOT SERIAL RECOVERY.Recommendations
Treat the
swap size in the trailer as untrusted and clamp or reject it in boot swap image() by bounding it to the primary slot's usable image area (sector count multiplied by sector size, excluding the trailer). Abort recovery with a non-zero error if an overflow occurs. Apply the same guard to boot read swap size() reads within boot read image header() for each backend. Found an issue in the description? Have something to add? Feel free to write us 👾