CVE-2026-16667 in mcubootinfo

Summary

by MITRE • 11/25/2026

The Cypress/PSoC6 flash-map backend in boot/cypress/cy_flash_pal/cy_flash_map.c guards every flash access with assert() against the wrong struct field. flash_area_read(), flash_area_write(), and flash_area_erase() check assert(off < fa->fa_off) and assert(off + len < fa->fa_off), comparing the area-relative off against the partition's absolute base address fa->fa_off instead of its length fa->fa_size. Because fa_off is a large absolute address, realistic out-of-partition offsets pass the check even in a debug build, and under NDEBUG the asserts are removed entirely. The access then proceeds as memcpy() (or a flash row op) at fa->fa_off + off with no enforcement.

The MCUboot core does not bound image-region offsets itself; it relies on flash_area_read() returning an error. During pre-authentication image validation, bootutil_img_hash() in boot/bootutil/src/bootutil_img_hash.c loops over ih_hdr_size + ih_img_size + ih_protect_tlv_size — all attacker-controlled header fields of the still-unverified update image — calling flash_area_read(), and the TLV iterator in boot/bootutil/src/tlv.c reads attacker-derived offsets the same way. An attacker who can stage a crafted image in the secondary/update slot (via OTA, DFU, or serial recovery, depending on the product) declares an oversized ih_img_size, causing reads far past the partition. A correct backend would reject these and fail validation cleanly; the Cypress backend does not.

The out-of-bounds access is in the source address of the copy — the destination buffer is correctly sized — so there is no memory corruption, no information disclosure to the attacker (the data is only folded into a hash that still fails the signature check), and no authentication bypass. The realistic impact is a bus fault or hang when the computed absolute address lands on an unmapped or peripheral region of the PSoC6 address map: the bootloader crashes instead of rejecting the bad image, an availability (denial-of-service) impact. The defect is specific to the Cypress/PSoC6 port; mainline Zephyr/sim/mynewt backends are unaffected. The identical broken guard in the write/erase primitives is a latent out-of-bounds-write gap, but no attacker-controlled out-of-bounds offset was found to reach those (serial-recovery uploads are bounded by the core), so the reachable memory-safety bug is the out-of-bounds read.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/25/2026

The Cypress PSoC6 flash-map backend in Zephyr contains a critical logic error within its boundary checking mechanisms for flash operations, specifically affecting boot/cypress/cy_flash_pal/cy_flash_map.c. The vulnerability stems from an incorrect comparison used to validate access offsets against partition boundaries. Functions such as flash_area_read(), flash_area_write(), and flash_area_erase() are intended to ensure that memory accesses remain within the allocated flash area by checking if the offset is less than the area size. However, the implementation erroneously compares the relative offset against fa->fa_off, which represents the absolute base address of the partition rather than its length fa->fa_size. This fundamental flaw means that because the base address is a large positive value, realistic out-of-partition offsets will pass this check even in debug builds where assertions are active. In production environments where NDEBUG is defined and assert statements are stripped, there is no enforcement whatsoever, allowing any offset to proceed unchecked.

This defect creates a significant security gap during the pre-authentication image validation phase of MCUboot. The core bootloader relies on flash_area_read() returning an error code when invalid accesses occur, but due to this bug, it does not receive such signals for out-of-bounds reads. During the verification process in bootutil_img_hash(), the system loops through header fields including ih_hdr_size, ih_img_size, and ih_protect_tlv_size, all of which are derived from the unverified update image staged by an attacker. Similarly, the TLV iterator processes offsets that can be manipulated via crafted images uploaded through OTA updates, DFU procedures, or serial recovery interfaces. An adversary who gains the ability to stage a malicious image in the secondary slot can declare an excessively large ih_img_size value, triggering read operations far beyond the intended partition boundaries.

The operational impact of this vulnerability is primarily related to system availability rather than confidentiality or integrity in terms of data exfiltration or authentication bypass. Since the out-of-bounds access targets the source address of a memory copy operation while the destination buffer remains correctly sized, there is no risk of traditional memory corruption such as stack smashing or heap overflow. Furthermore, because the read data is immediately folded into a hash calculation that will ultimately fail signature verification due to other integrity checks, the attacker cannot extract sensitive information from the device nor bypass authentication mechanisms. The realistic consequence is a bus fault or system hang when the computed absolute address maps to an unmapped region or peripheral space within the PSoC6 memory map. This results in a denial-of-service condition where the bootloader crashes instead of gracefully rejecting the malformed image, effectively bricking the update process and potentially requiring manual intervention to recover the device.

This vulnerability is classified under CWE-125: Out-of-bounds Read, as it involves accessing memory beyond the intended buffer boundary without proper validation. From a tactical perspective, this aligns with ATT&CK techniques involving resource hijacking or denial of service via software exploitation. It is important to note that this defect is specific to the Cypress PSoC6 port; mainline Zephyr backends and other ports like sim or mynewt are unaffected by this particular logic error. While there exists an identical broken guard in write and erase primitives, creating a latent out-of-bounds write vulnerability, no attacker-controlled path was identified that allows reaching those specific code paths due to core-level bounds checking on serial recovery uploads. Therefore, the immediate actionable risk is limited to the reachable memory-safety bug involving out-of-bounds reads during image validation.

Mitigation strategies should focus on correcting the boundary check logic in cy_flash_map.c by replacing the comparison against fa->fa_off with a proper check against fa->fa_size or ensuring that offset calculations account for both base address and size correctly to prevent overflow beyond partition limits. Developers must also ensure that assert statements are not relied upon as primary security controls in production builds, implementing explicit error handling paths that return appropriate failure codes when bounds checks fail. Updating the bootloader firmware on affected devices is critical to restore proper validation behavior and prevent denial-of-service attacks via crafted update images.

Responsible

Zephyr

Reservation

07/22/2026

Disclosure

11/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00286

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!