CVE-2026-127928: AES image key left on the stack after serial-recovery encrypted-image handling in MCUboot

Published Nov 13, 2026
·
Updated

In MCUboot's serial-recovery encrypted-image support (boot/bootserial/src/bootserialencryption.c), decryptimageinplace() and bootimagevalidateencrypted() each keep a stack-local struct bootstatus. bootencload() writes the plaintext per-image AES key into its enckey[] field. Neither function cleared this structure before returning. In addition, a decrypt failure inside the per-sector loop of decryptimageinplace() returned early and skipped the totalout: cleanup, which left the expanded AES key context (encdata) on the stack as well. The error paths of bootimagevalidateencrypted() similarly skipped bootenczeroize().

The affected code is built when encrypted images (MCUBOOTENCIMAGES, Zephyr CONFIGBOOTENCRYPTIMAGE) are combined with serial recovery. It runs when an encrypted image is uploaded to the primary slot over the recovery protocol, and when the image list or state is queried while an encrypted image is in the secondary slot. After these functions return, the image's AES content key remains in dead stack memory. An attacker who can later read device RAM, for example through a debug port or retained RAM, can recover it.

This weakens the confidentiality of image-encryption keys within the bootloader trust boundary. A recovered key exposes the plaintext of the encrypted firmware image it protects. The device's long-term private decryption key is not exposed. No remote or recovery-protocol channel that returns this memory is known, so exploitation requires a separate memory-read capability.

Event History

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

Frequently Asked Questions

1

Which deployments are exposed to this issue?

The affected code is built only when encrypted images are enabled together with serial recovery, including MCUboot encrypted-image support and Zephyr CONFIG_BOOT_ENCRYPT_IMAGE. The vulnerable paths run during encrypted-image upload to the primary slot over recovery, and during image-list or state queries when an encrypted image is in the secondary slot.

2

What additional access would an attacker need to recover a key?

The attacker must be able to read device RAM after the affected function returns. Examples given include access through a debug port or retained RAM; the issue does not itself provide RAM-read access.

3

How can I determine whether a device may already have exposed a key?

Check whether the device uses both encrypted images and serial recovery, then determine whether it has processed an encrypted upload to the primary slot or queried image list or state while an encrypted image was in the secondary slot. In those cases, the relevant image AES content key may remain in dead stack memory after the operation.

4

What configuration change avoids the affected code paths if an update cannot be applied immediately?

Avoid combining encrypted-image support with serial recovery, because that combination is required for the affected code to be built. Limiting later access to device RAM, such as through debug interfaces or retained RAM, also limits the ability to recover the residual key.

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