Skip to content

Disconnecting L2CAP channel right after invalid ATT request leads freeze

Moderate
d3zd3z published GHSA-7g38-3x9v-v7vp Jun 21, 2021

Package

zephyr (west)

Affected versions

2.4.0, 2.5.0

Patched versions

2.6.0

Description

Impact

When Central device connects to peripheral and creates L2CAP connection for Enhanced ATT, sending some invalid ATT request and disconnecting immediately causes freeze.

Analysis

Sending malformed ATT request on EATT channel and disconnecting L2CAP immediately crashes the Zephyr. It seems that L2CAP channel is already in disconnected state when Zephyr stack calls sent callback l2cap_chan_sdu_sent() and further bt_att_sent(). In bt_att_sent()

crash happens because already freed memory block is being accessed.

From the logs we can see that bt_att_disconnected() and bt_att_released() were called which means that memory regions both att channel and att contexts were freed. For some reason Zephyr master does not dump the bus fault message but just silently freezes. Following screenshot is from v2.5-branch.

image2021-3-18_9-50-38

Patches

This has been fixed in:

For more information

If you have any questions or comments about this advisory:

created: 2021-03-19
embargo: 2021-06-19

Severity

Moderate

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
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
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:N/UI:N/S:U/C:N/I:N/A:L

CVE ID

CVE-2021-3455

Weaknesses

Credits