CVE-2026-16666 - MCUboot swap resume trusts a flash-resident swap_size, allowing pre-authentication out-of-bounds flash operations
Vulnerability · Reported by NVD · · CWE-129
- Severity
- Medium Risk score 57/100
- CVSS
- 5.7 v3.1 · from NVD
- Exploit chance (EPSS)
- 0.2% Higher than 6% of CVEs
- Known exploited
- No Not in CISA KEV
Summary
When MCUboot resumes an interrupted image swap it takes the number of bytes to move straight from the flash-resident status trailer. In boot_swap_image() (boot/bootutil/src/loader.c) the fresh-swap branch recomputes copy_size from the image headers and is bounded — swap_run() in boot/bootutil/src/swap_move.c carries an explicit "not enough free space" check (last_idx >= first_trailer_idx) — but that check runs only inside if (boot_status_is_reset(bs)). On the resume branch the code instead does boot_read_swap_size(fap, &bs->swap_size); copy_size = bs->swap_size; and passes the value to swap_run() with no re-derivation and no bound. swap_run() turns that byte count into a sector index by summing sector sizes until it reaches the count, with no ceiling on the real sector count: find_last_idx() in swap_move.c and swap_offset.c, and find_last_sector_idx() in swap_scratch.c, are all while (1) loops. The resulting index is fed to boot_img_sector_off() / boot_img_sector_size() (boot/bootutil/src/bootutil_priv.h), which index the fixed BOOT_MAX_IMG_SECTORS sectors[] arrays with no bounds chec
How this vulnerability can be exploited
An attacker can exploit this vulnerability with local access to the system, without any login, and without any action from a user. Attack complexity is high, meaning specific conditions must exist first. If successful, the attacker could crash or disrupt the service.
Is it being exploited?
The EPSS model estimates a 0.20% chance this CVE will be exploited in the next 30 days, which is low and higher than 6% of all published CVEs.
Patch priority and what to do
Patch during routine updates. Lower severity, but keep it on your list. 1) Check whether you run the affected product and version. 2) Apply the vendor update or patch listed in the advisory. 3) Review logs for signs of exploitation since the publication date.
CVSS vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H
Tags
CVE-2026-16666
Sources & references
- Original article / advisory (NVD) ↗
- NIST NVD: CVE-2026-16666 ↗
- CVE.org record ↗
- FIRST.org EPSS model ↗
How this data is collected: methodology & sources.