CVE-2026-16663: MCUboot's encrypted serial-recovery path contains an attacker-controlled out-of-bounds stack write in decrypt_region_inp... (CVSS 8.4)

MCUboot's encrypted serial-recovery path contains an attacker-controlled out-of-bounds stack write in decrypt_region_inplace() in boot/boot_serial/src/boot_serial_encryption.c. The routine decrypts an uploaded encrypted image one flash sector at a time into a sector-sized stack VLA buf[sz], but when the current sector is still inside the image header it sets the destination index to the absolute header size (idx = hdr->ih_hdr_size; at boot/boot_serial/src/boot_serial_encryption.c:156) and then decrypts into &buf[idx]. The correct sibling routine boot/bootutil/src/loader.c:876 uses the sector-relative idx = hdr->ih_hdr_size - abs_off; the serial path is missing the - abs_off term, so for any sector after the first the index runs past the end of the stack buffer. The ih_hdr_size field is a uint16_t taken verbatim from the uploaded image header. On the second sector onward, when ih_hdr_size exceeds the sector size, &buf[idx] points beyond buf and boot_enc_decrypt() writes attacker-con...

Vulners2 min read1 views
Read full article
CVE-2026-16663: MCUboot's encrypted serial-recovery path contains an attacker-controlled out-of-bounds stack write in decrypt_region_inp... (CVSS 8.4)

Read the full story at Vulners →