🇰🇷 한글 설명
Zephyr의 Bluetooth Mesh 서브넷 키 관리에서 서브넷 키를 삭제할 때마다 PSA Crypto 키 슬롯 하나가 해제되지 않고 누수됩니다. Private Beacon Key 임포트는 CONFIG_BT_MESH_PRIV_BEACONS로 가드되지만 대응하는 psa_destroy_key()는 이미 제거된 CONFIG_BT_MESH_V1d1로 가드되어 해당 코드가 영구적으로 도달 불가능해졌습니다. 반복된 서브넷 삭제나 키 갱신 후 키 슬롯 풀이 고갈되어 재부팅 전까지 서브넷 생성과 키 갱신이 실패할 수 있습니다.
💡 쉬운 설명
블루투스 메시 기기에서 네트워크 키를 지울 때 내부 암호 키 저장 공간 하나가 반환되지 않고 남습니다. 이런 작업을 반복하면 저장 공간이 모두 차서 기기를 재부팅하기 전까지 새 네트워크 설정이나 키 갱신이 불가능해집니다.
🇺🇸 원문 (English)
Zephyr's Bluetooth Mesh subnet key management leaks one PSA Crypto key slot on every subnet-key teardown. In subsys/bluetooth/mesh/subnet.c, net_keys_create() imports the Private Beacon Key into a PSA key slot under CONFIG_BT_MESH_PRIV_BEACONS (enabled by default), but subnet_keys_destroy() guarded the matching psa_destroy_key() with CONFIG_BT_MESH_V1d1. That Kconfig symbol was removed when explicit Mesh 1.0.1 support was dropped, so the destroy branch became permanently dead code and the import is never balanced by a destroy.
The imbalanced teardown is reached every time subnet keys are destroyed: deleting a subnet (Config Server NetKey Delete), completing a Key Refresh Procedure (which retires the old key set), and resetting/re-provisioning the node. The over-the-air triggers are processed only under the node's device key, so they are exercisable by the provisioner or network administrator that owns the node, reachable over the Bluetooth Mesh network.
With the default CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT of 16, repeated add/delete or key-refresh cycles exhaust the shared PSA key-slot pool after roughly a dozen rounds. Once exhausted, bt_mesh_private_beacon_key() and thus subnet creation fail: the node can no longer add subnets or complete key refresh, and other PSA crypto consumers on the device may be starved, until the device is rebooted. The fix aligns the destroy guard with the import guard (CONFIG_BT_MESH_PRIV_BEACONS) so each slot is freed.
📍 영향받는 시스템
Zephyr RTOS 기반 Bluetooth Mesh 기능이 활성화된 기기 (CONFIG_BT_MESH_PRIV_BEACONS 기본 활성, Mesh 1.0.1 명시적 지원 제거 이후 버전)
⚔️ 공격 벡터
네트워크 관리자 또는 프로비저너가 Config Server NetKey Delete, 키 갱신 절차, 리셋 등을 반복 수행하여 PSA 키 슬롯 풀을 고갈시킴 (기기 디바이스 키 권한 필요)
🛡️ 대응 방법
Zephyr의 해당 패치를 적용하여 subnet_keys_destroy()의 psa_destroy_key() 가드를 CONFIG_BT_MESH_PRIV_BEACONS로 변경하고, 이미 고갈된 기기는 재부팅하거나 업데이트된 펌웨어를 설치
🔧 검증 코드
결과가 출력되면 subnet.c에 제거된 CONFIG_BT_MESH_V1d1 가드가 남아 있어 취약하며, 아무 결과도 없거나 CONFIG_BT_MESH_PRIV_BEACONS 가드로 대체되었다면 패치된 것입니다.
grep -rn 'CONFIG_BT_MESH_V1d1' $(find / -path '*zephyr*' -name subnet.c 2>/dev/null) 2>/dev/null | head -5
📊 CVSS Vector String
CVSS:3.1/AV:A/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:L
💻 영향받는 소프트웨어
Multi-Domain Security Management Server