· via dev.to (home feed)
MCUboot PSoC6 bounds-check bug can crash bootloaders via malformed update images
A flash-backend bug in MCUboot's Cypress PSoC6 port, CVE-2026-16667, compares an offset against the partition base instead of its size, letting crafted images fault the bootloader before signature checks complete.

What happened
A bounds-checking error in MCUboot's flash driver for Cypress PSoC6 microcontrollers can bring down a bootloader while it processes a malformed update image. The flaw is tracked as CVE-2026-16667 and described in GitHub advisory GHSA-6cg5-5j34-3hmq; a dev.to analysis characterises it as a moderate-severity availability problem.
The defect lives in the PSoC6 backend, one of several hardware-specific flash backends MCUboot ships alongside its platform-independent core. Only products built on this port are exposed — the advisory states that the mainline Zephyr, simulator, and Mynewt backends are unaffected.
A one-field mix-up
According to the dev.to write-up, the check compares an area-relative offset against fa_off, the partition's absolute base address in flash, rather than fa_size, its length. Because the offset is measured from the start of the area, validating it against a base address can accept accesses that fall entirely outside the partition.
Enforcement then depends on the build configuration. In debug builds the assert may still pass for out-of-range offsets, since the underlying comparison itself is wrong; in release builds compiled with NDEBUG the assert is stripped out altogether, leaving nothing behind.
Timing makes the mistake consequential. During pre-authentication validation, bootutil_img_hash() trusts size values taken from the image header before that header's signature has been checked. A crafted image placed in the secondary slot can declare an oversized length, pushing reads well beyond the intended flash area. The dev.to analysis notes that the Cypress backend is supposed to reject such access and fail validation cleanly, but with the broken check it may instead dereference an address outside mapped flash — potentially landing in a peripheral region — and trigger a fault.
Narrower than the bug class suggests
The GitHub advisory, as summarised on dev.to, draws a tighter boundary around the issue than the underlying bug class implies. The out-of-bounds access affects the source address; the destination buffer is sized appropriately. Whatever is read from beyond the partition gets mixed into a hash computation that subsequently fails signature verification, so the flaw neither leaks image data to an attacker nor bypasses authentication. In practice, an affected device is likely to hang or hit a bus fault in the bootloader.
There is, however, a dormant hazard: the identical faulty check also sits in the backend's write and erase routines, which would amount to an out-of-bounds write if a path to them existed. The advisory reports that no attacker-controlled route into those routines was found, because uploads over serial recovery are already constrained by MCUboot's core code. The dev.to author stresses that this distinction should stay visible during triage — the latent bug still needs repair, but it is not an observed integrity compromise.
What embedded teams should do
The write-up recommends testing the backend directly instead of relying on generic parser tests, since an update that passes on a generic board image may never exercise the Cypress-specific code path. Suggested cases include an authenticated good image, a valid signature paired with a malformed header, an oversized image length, invalid TLV offsets, and a deliberately truncated write — run in both debug and release builds. A release build should return a clean validation error rather than lean on a fault handler.
On the patch side, the guidance is to apply the corrected backend, rebuild the bootloader, sign with the existing release keys, and confirm legitimate updates are still accepted. Teams should also inventory every channel capable of staging data into the secondary slot — over-the-air services, serial or USB recovery, factory programming tools, and maintenance consoles — because exploitation requires getting attacker-controlled bytes into that slot, and some of those channels may be reachable through support workflows or a compromised update server.
In the field, symptoms to watch for include boot loops, repeated watchdog resets, and failures occurring immediately after an update attempt. A device that never establishes connectivity after an update may be failing in the bootloader before application logging starts. For recovery, the article advises loading a known-good signed image through the supported recovery mode, keeping signature verification enabled, and auditing update servers and provisioning records afterwards.
Why it matters
The flaw is a textbook embedded failure mode: a compile-time assertion stripped from release builds does not constitute a security control. On flash-constrained devices, rejection paths need test coverage on par with happy paths, and hardware-specific backends need their own validation even when the shared core is mature. A single confused field was enough to transform a routine rejection — an image that would have failed signature checks anyway — into a device that cannot finish booting. And the presence of the same broken guard in the write and erase routines is a reminder that latent memory-safety bugs deserve fixes even when no exploit path is currently known.
- #mcuboot
- #embedded
- #security
- #firmware
- #psoc6