Skip to content

Conversation

jhedberg
Copy link
Member

@jhedberg jhedberg commented Aug 26, 2019

A security vulnerability in the Bluetooth BR/EDR Bluetooth Core
specification versions 1.0 through 5.1 has been identified as
CVE-2019-9506. The Bluetooth BR/EDR encryption key negotiation
protocol is vulnerable to packet injection that could allow an
unauthenticated user to decrease the size of the entropy of the
encryption key, potentially causing information disclosure and/or
escalation of privileges via adjacent access. There is not currently
any knowledge of this being exploited.

From Core spec erratum 11838:

A device shall enforce an encryption key with at least 128-bit
equivalent strength for all services that require Security Mode 4,
Level 4. For all other services that require encryption, a device
should enforce an encryption key with at least 56-bit equivalent
strength, irrespective of whether the remote device supports Secure
Simple Pairing.

After encryption has been enabled, the Host should check the
encryption key size using either the HCI_Read_Encryption_Key_Size
command (see [Vol 2] Part E, Section 7.5.7) or a vendor-specific
method.

Fixes #18658

Signed-off-by: Johan Hedberg [email protected]

@jhedberg jhedberg added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth DNM This PR should not be merged (Do Not Merge) labels Aug 26, 2019
@jhedberg jhedberg requested a review from carlescufi August 26, 2019 18:52
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can argue about the usage of 4 here rather than the enum name. I went with the integer to make something that applies easily both to master and LTS, since we've recently renamed/deprecated the security level enum values.

@zephyrbot zephyrbot added the area: API Changes to public APIs label Aug 26, 2019
@jhedberg jhedberg force-pushed the enc_key_size branch 2 times, most recently from c7356c2 to 8d1512d Compare August 27, 2019 05:19
@jhedberg jhedberg removed the DNM This PR should not be merged (Do Not Merge) label Aug 27, 2019
@jhedberg
Copy link
Member Author

Tested to work on Broadcom & CSR dual-mode adapters, so I've now removed the DNM label.

@jhedberg jhedberg force-pushed the enc_key_size branch 3 times, most recently from bcf4113 to 5dd99bf Compare August 27, 2019 07:13
@jhedberg
Copy link
Member Author

Updated the PR by moving the check to the update_sec_level_br() function, since this covers immediate encryption with security mode 3 as well as encryption key refresh. There was no proper error propagation upward from update_sec_level_br() which necessitated a second patch for this PR.

Johan Hedberg added 2 commits August 27, 2019 13:30
In case sufficient security level wasn't reached the error propagation
was missing, which could lead to incorrect state transitions when
update_sec_level_br() returns. Return true/false and make sure to
abort any further operations in case the update fails.

Signed-off-by: Johan Hedberg <[email protected]>
A security vulnerability in the Bluetooth BR/EDR Bluetooth Core
specification versions 1.0 through 5.1 has been identified as
CVE-2019-9506. The Bluetooth BR/EDR encryption key negotiation
protocol is vulnerable to packet injection that could allow an
unauthenticated user to decrease the size of the entropy of the
encryption key, potentially causing information disclosure and/or
escalation of privileges via adjacent access. There is not currently
any knowledge of this being exploited.

From Core spec erratum 11838:

A device shall enforce an encryption key with at least 128-bit
equivalent strength for all services that require Security Mode 4,
Level 4. For all other services that require encryption, a device
should enforce an encryption key with at least 56-bit equivalent
strength, irrespective of whether the remote device supports Secure
Simple Pairing.

After encryption has been enabled, the Host should check the
encryption key size using either the HCI_Read_Encryption_Key_Size
command (see [Vol 2] Part E, Section 7.5.7) or a vendor-specific
method.

Fixes zephyrproject-rtos#18658

Signed-off-by: Johan Hedberg <[email protected]>
Copy link
Member

@carlescufi carlescufi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick inspection, looks good to me!

@jhedberg jhedberg merged commit b763a9b into zephyrproject-rtos:master Aug 27, 2019
@jhedberg jhedberg deleted the enc_key_size branch August 27, 2019 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Bluetooth bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bluetooth BR/EDR encryption key negotiation vulnerability
4 participants