mcubootでリリースビルド時に安全確認が無効になり脆弱性
Summary
mcubootは、リリースビルド(NDEBUG定義あり)ではassert()が無効化され、ブート時の安全確認が行われないおそれがある脆弱性です。不整合なスワップ状態でも処理が続行され、不正な状態でスワップが完了する可能性があります。1.1.0以降が影響を受けるとされ、修正版は公表されていないため、最新の情報を確認してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
mcubootは、リリースビルド(NDEBUG定義あり)ではassert()が無効化され、ブート時の安全確認が行われないおそれがある脆弱性です。不整合なスワップ状態でも処理が続行され、不正な状態でスワップが完了する可能性があります。1.1.0以降が影響を受けるとされ、修正版は公表されていないため、最新の情報を確認してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| mcu-toolsmcuboot |
≥ 1.1.0 (no fix yet)→ Not listed |
Not listed |
This record does not list fixed versions. Check the article or the vendor advisory in the references for whether and where it is fixed.
Original description The description as published by the source.
Summary
MCUboot enforces several security-critical invariants on the boot, image-swap, and validation paths using assert(). In a standard release/production build (NDEBUG defined) assert() expands to a no-op, so an invariant the code intends to halt on instead falls through, and execution continues with the bad or inconsistent state. Where the guarded condition is attacker-influenceable through the flash-write boundary (serial-recovery / DFU), this is a security check that is simply absent in release builds.
This is one root cause (assert-as-security-guard, no-op under NDEBUG) with one fix approach (replace the security-critical asserts with real fail-closed checks), so it is filed as a single advisory covering the enumerated sites.
Worst reachable instance — inconsistent swap status completes the swap without validation
In the swap-resume status read, an inconsistent status (erased_sections > 1) is detected, logged, and — when MCUBOOT_VALIDATE_PRIMARY_SLOT is disabled — is meant to abort, because "there is no way to be sure the swapped primary slot is OK." The abort is assert(0):
boot/bootutil/src/swap_move.c:181-194 — if (erased_sections > 1) { ... #if !defined(MCUBOOT_VALIDATE_PRIMARY_SLOT) / ... abort! / assert(0); #endif }, then execution falls through to compute bs->op/idx/state from the inconsistent status (lines 197-208) and return 0 (success).
boot/bootutil/src/swap_offset.c:266-280 — identical pattern; falls through to bs->op/idx/state and return 0.
boot/bootut…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- patch github.com
- web github.com