Когда MCUboot был построен с криптографическим сервером TinyCrypt (MCUBOOT_USE_TINYCRYPT), bootutil_aes_ctr_drop () в boot/bootutil/include/bootutil/crypto/aes_ctr_tinycrypt.h был пустой заглушкой. Контекстом AES-CTR для этого бэкэнда является полностью расширенное расписание ключей AES-128 (struct tc_aes_key_sched_struct). Общий код полагается на этот крюк для высвобождения и очистки ключевого состояния, поэтому с TinyCrypt ничего не было очищено.
Серверы mbedTLS и PSA освобождают или уничтожают свое ключевое состояние здесь. В результате boot_state_clear(), который boot_go() вызывает перед передачей в приложение, оставил график ключа шифрования содержимого изображения AES в статическом состоянии boot_data. Это происходит после зашифрованного обновления в сборках с одним изображением, где boot_enc_zeroize() не вызывается. boot_decrypt_key() также оставил в стеке расписание ключей шифрования ключей, полученных из ECIES.
Пострадавшая сборка использует MCUBOOT_ENC_IMAGES с TinyCrypt, который является бэкэндом по умолчанию ECDSA и Ed25519 в порту Zephyr. Первый круглый ключ AES-128 равен ключу шифра, поэтому любой, кто может прочитать оставшийся загрузчик RAM после загрузки, может восстановить ключ содержимого изображения и расшифровать это зашифрованное изображение. Это включает в себя физический злоумышленник с отладкой или доступом RAM или кодом, позже запущенным на устройстве.
Это ослабляет конфиденциальность ключа шифрования изображения (и, следовательно, конфиденциальность открытого текста зашифрованного изображения). Долгосрочный закрытый ключ дешифрования устройства не отображается, и подлинность изображения не затрагивается. Исправление стирает контекст с помощью bootutil_wipe_memory().
Показать оригинальное описание (EN)
When MCUboot is built with the TinyCrypt crypto backend (MCUBOOT_USE_TINYCRYPT), bootutil_aes_ctr_drop() in boot/bootutil/include/bootutil/crypto/aes_ctr_tinycrypt.h was an empty stub. The AES-CTR context for this backend is the fully expanded AES-128 key schedule (struct tc_aes_key_sched_struct). Generic code relies on this hook to release and clear key state, so with TinyCrypt nothing was cleared. The mbedTLS and PSA backends do free or destroy their key state here. As a result, boot_state_clear(), which boot_go() calls before handing off to the application, left the image's AES content-encryption key schedule in the static boot_data state. This is the case after an encrypted upgrade in single-image builds, where boot_enc_zeroize() is not called. boot_decrypt_key() likewise left the ECIES-derived key-encryption key schedule on the stack. The affected build uses MCUBOOT_ENC_IMAGES with TinyCrypt, which is the default ECDSA and Ed25519 backend in the Zephyr port. The first AES-128 round key equals the cipher key, so anyone who can read the leftover bootloader RAM after boot can recover the image content key and decrypt that encrypted image. That includes a physical attacker with debug or RAM access, or code later running on the device. This weakens image-encryption key confidentiality (and so the confidentiality of the encrypted image's plaintext). The device's long-term private decryption key is not exposed, and image authenticity is not affected. The fix wipes the context with bootutil_wipe_memory().
Характеристики атаки
Последствия
Строка CVSS v3.1