Skip to content

Out-of-bound write vulnerability in the Bluetooth mesh core stack can be triggered during provisioning

High
ceolin published GHSA-j7v7-w73r-mm5x Jul 26, 2022

Package

zephyr (west)

Affected versions

<= 3.0

Patched versions

None

Description

Impact

What kind of vulnerability is it? Who is impacted?

In Zephyr bluetooth mesh core stack, an out-of-bound write vulnerability can be triggered during provisioning. If Transaction Continue PDU is received before the Transaction Start PDU (i.e., start segment lost), the SegN will be initialized as 0xff, which allows subsequent SegO up to 63 and leads to out-of-bound write.

Consider a situation that a Transaction Continue PDU is received first, with SegO greater than 2.
SegN (link.rx.last_seg) will be temporarily set as 0xff (SEG_NVAL).

jFONCJ

Since SegN is 0xff now, we can pass the check SegO <= SegN.
JaIy3n
Then comes to the memcpy. Since SegO is greater than 2, XACT_SEG_DATA(seg) is greater than 20 + (2-1)×23 = 43, data will be copied beyond 43 + 23 = 66, which exceeds the size of rx_buf, causing out-of-bound write.
UXj9oI
vf8QcS

Credits

Han Yan(闫晗),Lewei Qu(曲乐炜),Dongxiang Ke(柯懂湘) of Baidu AIoT Security Team

For more information

If you have any questions or comments about this advisory:

embargo: 2022-06-19

Patches

This has been fixed in:

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Adjacent
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L

CVE ID

CVE-2022-1042

Weaknesses