-
Notifications
You must be signed in to change notification settings - Fork 8k
Bluetooth: Host: Fix checking for sufficient encryption key size #18659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
subsys/bluetooth/host/hci_core.c
Outdated
There was a problem hiding this comment.
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.
c7356c2
to
8d1512d
Compare
Tested to work on Broadcom & CSR dual-mode adapters, so I've now removed the DNM label. |
bcf4113
to
5dd99bf
Compare
Updated the PR by moving the check to the |
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]>
There was a problem hiding this 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!
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]