Skip to main content
Menu
CVEs

MCUboot out-of-bounds write in encrypted serial recovery decryption

CVE-2026-16663EUVD-2026-134631Published November 24, 2026, updated

8.4HighCNA
Exploited
No known exploitation
Fix
Fixed in 2.5.1
Who is exposed
Specific setups only

Summary

An out-of-bounds stack write in MCUboot's encrypted serial recovery image decryption lets an attacker write attacker-controlled data into adjacent stack frames. It can be reached locally, without logging in or any user action, by uploading an encrypted image.

Written by a model

Original description

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-controlled plaintext into adjacent stack frames. The path is reached pre-authentication: bs_upload() calls boot_handle_enc_fw() (boot/boot_serial/src/boot_serial.c:1208) after upload, and the pre-decryption signature gate in decrypt_image_inplace() is compiled out (#if 0 at boot/boot_serial/src/boot_serial_encryption.c:226-233), so the header is never validated before decryption.

A second error in the same window computation affects the first sector. When a sector holds both the end of the header and the start of the TLV area, the decrypt length is clamped to tlv_off - (off + bytes_copied), measured from the start of the sector rather than from idx (boot/boot_serial/src/boot_serial_encryption.c:166). An encrypted image whose header and payload end within the first sector is therefore decrypted for ih_hdr_size bytes more than it should be: into the TLV area and, when the image ends near the end of the sector, past buf. This form needs no oversized header, so even an ordinary small encrypted image can trigger it, and it reaches devices with sectors of up to about 128 KiB rather than only those whose sector is smaller than the 16-bit ih_hdr_size.

Reaching the sink requires a build with MCUBOOT_ENC_IMAGES and serial recovery enabled, and access to the device's serial/USB recovery interface (unauthenticated by design). With the public-key encryption schemes the AES content key is wrapped to the device's public encryption key, so an attacker can author a fully crafted encrypted image — including a malicious ih_hdr_size — without the image-signing private key. The result is a controllable stack memory-corruption inside the bootloader before any signature check, providing a path to code execution in the secure-boot root of trust that bypasses image authentication, as well as a denial-of-service. A 2048-byte out-of-bounds write was reproduced under AddressSanitizer (sz=4096, off=4096, ih_hdr_size=6144).

On releases before v2.0.0 (v1.9.0 and v1.10.0) the destination is a file-scope static uint8_t buf[SOC_FLASH_ERASE_BLK_SZ] in .bss rather than the stack VLA described above — the code then lived in boot/zephyr/single_loader.c, before commit c9fa6088 relocated it to boot/boot_serial/src/boot_serial_encryption.c and changed the buffer's storage class. The out-of-bounds write is equally real and equally pre-authentication on those releases, but it corrupts adjacent static data rather than the stack, so a stack-smashing proof of concept written against a current release will not reproduce as-is there.

Who should check

Teams shipping MCUboot 1.9.0 through 2.5.0 with MCUBOOT_ENC_IMAGES and serial recovery enabled, including devices that accept encrypted serial recovery uploads.

“>= 1.9.0, <= 2.5.0”

github.com

What to do

  1. Check whether your setup matches what the bug needs.

    Build must have MCUBOOT_ENC_IMAGES and serial recovery enabled Affected MCUboot versions 1.9.0 through 2.5.0 Attacker has access to the device's serial/USB recovery interface
  2. Upgrade to a fixed version: 2.5.1.

Check your systems with an agent

Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.

Check whether my systems are affected by CVE-2026-16663 (Pre-authentication out-of-bounds write in MCUboot encrypted serial recovery image decryption), using the cve.now data below.

Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.

What cve.now has for CVE-2026-16663 (entry last updated 2026-11-24):
Affected:
- mcu-tools mcuboot: from 1.9.0, fixed in 2.5.1
Fixed versions: 2.5.1.
Conditions (all must be true for the bug to be hit):
- Build must have MCUBOOT_ENC_IMAGES and serial recovery enabled (source: https://github.com/mcu-tools/mcuboot/security/advisories/GHSA-7c8v-m3pm-wh74)
- Affected MCUboot versions 1.9.0 through 2.5.0 (source: https://github.com/mcu-tools/mcuboot/security/advisories/GHSA-7c8v-m3pm-wh74)
- Attacker has access to the device's serial/USB recovery interface (source: https://github.com/mcu-tools/mcuboot/security/advisories/GHSA-7c8v-m3pm-wh74)
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
Attacker needs: local access, no login, no user action.
CISA KEV: CVE-2026-16663 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-16663 only. If you also check another CVE, look up its own KEV status; never assume it from this one.

How to check:
- Installed software: check what is actually running, not what a repo declares. Read the version from each host, container image and Kubernetes node (the binary's version output, the OS package database, image layers), and check whether the conditions above hold there. Distribution packages may carry a backported fix under an older version number; confirm against the distribution's own advisory.

Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/mcu-tools/mcuboot/commit/6e1465c38e3dba4849caed650ad83d0ba5c277b6
- https://github.com/mcu-tools/mcuboot/security/advisories/GHSA-7c8v-m3pm-wh74
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.

Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.

Entry: https://cve.now/CVE-2026-16663
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-16663"}.

Affected versions

cve.now Index

13Pof 100 · provisional · methodology v3
  • Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
  • Exposure5/25Specific setups only
  • Reach?/20Unknown. No tracked technology or package matched
  • Severity8.4/10CVSS 8.4
  • No patch0/5No signal

What would change the score

  • Would score about 63 if added to CISA KEV
  • Would score about 58 if CISA's SSVC rates exploitation active
  • Would score about 23 if CISA's SSVC rates it automatable

Timeline

  1. CVE published
  2. First seen by cve.now
  3. Record last updated

Evidence 5

KindSource
Vendor advisory 1Establishes: Affected and fixed versions.
AdvisoryGitHub · mcu-tools/mcuboot · Advisory GHSA-7c8v-m3pm-wh74
CVE record 2Establishes: The identifier and description.
RecordCVE List · CVE-2026-16663
RecordNVD · CVE-2026-16663
Public exploit code 1Establishes: Public exploit code exists (Exploit-DB, Metasploit, Nuclei and GitHub).
ExploitGitHub · googlesky/CVE-2026-16663 · Repository
Other links 1
PatchGitHub · mcu-tools/mcuboot · Commit 6e1465c3

Questions about CVE-2026-16663

Is CVE-2026-16663 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: cve.now feed data

What does this mean?

A flaw in MCUboot's encrypted serial recovery image decryption lets data written past the end of a stack buffer before the bootloader checks any image signature. The memory corruption can be controlled, and the sources say it could lead to code execution in the secure-boot root of trust or to denial of service.

Source: github.com

Which versions are affected by CVE-2026-16663?

mcuboot: from 1.9.0 before 2.5.1.

Source: cve.now feed data

Am I affected, and how do I check?

MCUboot versions 1.9.0 through 2.5.0 are affected, but only in builds with MCUBOOT_ENC_IMAGES and serial recovery enabled. The attack requires access to the device's serial or USB recovery interface. To check a build, look at the MCUboot version it was built from and whether those two settings are enabled in its configuration.

Source: github.com

How do I fix CVE-2026-16663?

The fix is expected in MCUboot 2.5.1, but that version is a projected release, so confirm it against the actual release before relying on it. Upgrade to 2.5.1 once it is published.

Source: github.com

No corrections so far. Something wrong on this page? Report an error.