斯文牙(SweynTooth)是什么牙?


SweynTooth是新加坡科技设计大学(SUTD)的一个嵌入式设备安全研究机构在今年2月释放出的10个针对BLE的攻击方法,这些攻击方法很常见,就是通过传输不符合规范的数据包,看被测设备会不会出现死锁或死机,相关的攻击程序也有开放。第二波的攻击方法将在7月13号发布。

关于为什么叫SweynTooth,很好玩,请参考下面一段。

5 Why SweynTooth ?

The insight behind the name SweynTooth arrives from Sweyn Forkbeard, the son of King Harald Bluetooth (after whom the Bluetooth Technology was originally named). Sweyn revolted against Harald Bluetooth and this forced King Harald to his exile. The exile lead to the death of King Harald shortly. We envision that if SweynTooth style vulnerabilities are not appropriately handled by BLE vendors, then the technology can become a breeding ground for attackers. This may, in turn, lead the Bluetooth technology to be obsolete.

斯文牙是蓝牙的儿子,斯文牙一点不斯文,他反叛父亲,并将父亲流放。鉴于此,SUTD发布这些无聊攻击也算是师出有名:为了不让蓝牙技术落到蓝牙的境地。原本的目的也许就是导师为了让学生有课题做作,好写毕业论文,你懂得。正常情况下谁有闲空去搞这些损人不利己的事儿呢?

比如其中的第二个攻击方法,就是将链路层数据包的LLID给写成0,而0在spec中规定是个没有意义的数字,在收到这样的数据包时应该直接丢弃。

Nimble Controller在处理RX Data PDU的时候已经考虑到这个了,code如下。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void
ble_ll_conn_rx_data_pdu(struct os_mbuf *rxpdu, struct ble_mbuf_hdr *hdr)
{
/* Validate rx data pdu */
rxbuf = rxpdu->om_data;
hdr_byte = rxbuf[0];
acl_len = rxbuf[1];
llid = hdr_byte & BLE_LL_DATA_HDR_LLID_MASK;

/*
* Check that the LLID and payload length are reasonable.
* Empty payload is only allowed for LLID == 01b.
* */
if ((llid == 0) || ((acl_len == 0) && (llid != BLE_LL_LLID_DATA_FRAG))) {
STATS_INC(ble_ll_conn_stats, rx_bad_llid);
goto conn_rx_data_pdu_end;
}