CVE-2026-16659: Pre-authentication NULL pointer dereference in MCUboot serial-recovery image upload (encrypted-image builds)

Published Nov 13, 2026
·
Updated

MCUboot's serial-recovery image-upload handler bsupload() in boot/bootserial/src/bootserial.c declares const struct flasharea fap = NULL and assigns it only via flashareaopen() part-way through the function. Two early validation failures (goto outinvaliddata) — a CBOR map that fails to decode, or an upload packet missing the off/data members — branch past the open while fap is still NULL, then fall into the shared epilogue. In MCUBOOTENCIMAGES builds that epilogue unconditionally calls boothandleencfw(fap), which reaches bootimageloadheader() and flasharearead() and dereferences the NULL flasharea.

The defect is reachable pre-authentication: the trigger is the very first serial-recovery upload command carrying a malformed payload. The guarding conditions are default-true on a fresh recovery session — imgnum, curroff and imgsize are zero-initialized statics, so curroff == imgsize and the primary-slot test both hold. It requires a non-default build: encrypted images (MCUBOOTENCIMAGES / Zephyr CONFIGBOOTENCRYPTIMAGE) together with an active serial-recovery transport, on the Zephyr or Mynewt port (the two that build both boot/bootserial/src/bootserial.c and bootserialencryption.c with MCUBOOTENCIMAGES).

The impact is a transient denial of service of the bootloader during recovery. fap is a hard NULL rather than an attacker-controlled value, so there is no memory-corruption or information-leak primitive and image authentication is unaffected. Whether the dereference faults is platform-dependent — on targets where address 0x0 is mapped readable flash the read merely returns an error and execution continues, while targets that trap NULL (MPU / null-pointer-exception detection) take a hard fault. Because serial recovery is unauthenticated by design and already permits the console attacker to write the secondary slot, the added capability is only a low-value transient crash.

The related unconditional flashareaclose(fap) call in the same epilogue is a safe no-op on the ports that reach it, so it does not contribute to the dereference.

The affected ports are the Zephyr port — boot/zephyr/CMakeLists.txt compiles bootserial.c under CONFIGMCUBOOTSERIAL and bootserialencryption.c under CONFIGBOOTENCRYPTIMAGE — and the Mynewt port, whose mcubootconfig.h defines MCUBOOTSERIAL unconditionally and MCUBOOTENCIMAGES under any BOOTUTILENCRYPT syscfg, with boot/bootserial/pkg.yml declaring no explicit source list so the whole directory is built. The Espressif port is not affected: it compiles bootserial.c but not bootserialencryption.c, and defines no MCUBOOTENCIMAGES, so the #ifdef MCUBOOTENCIMAGES block containing the call is preprocessed away. The NuttX, Cypress and Mbed ports do not build bootserial.c at all.

Event History

Nov 13, 2026
CVE Published
via MITRE·12:23 AM
Data Sourced
via MITRE·12:23 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:18 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Exposure requires an MCUboot build with encrypted images enabled and an active serial-recovery transport. The affected serial-recovery code is built by the Zephyr and Mynewt ports.

2

What must an attacker do to trigger the failure?

An attacker can trigger it before authentication by sending the first serial-recovery image-upload command with either an invalid CBOR map or a payload missing the off or data members. A fresh recovery session satisfies the relevant image-number and offset conditions by default.

3

Is a standard configuration affected?

The vulnerable path requires a non-default configuration: MCUBOOT_ENC_IMAGES, or Zephyr CONFIG_BOOT_ENCRYPT_IMAGE, must be enabled along with serial recovery. In deployments using that configuration, the trigger conditions are present at the start of a new recovery session.

4

What can be changed if patching is not immediately possible?

Removing either required condition prevents this path from being reachable: disable the active serial-recovery transport or use a build without encrypted-image support. The data does not identify a runtime authentication setting that protects the affected first upload command.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203