diff --git a/index.html b/index.html index b5c7858..53302b5 100644 --- a/index.html +++ b/index.html @@ -325,6 +325,17 @@

Device access is powerful

Attacks on devices

+

+ Communication from websites can break the security model of some devices, + which assume they only receive messages from + the trusted operating system of a remote device. + Human Interface Devices are a prominent example, + where allowing a website to communicate would allow that site to log keystrokes. + This specification includes a blacklist of + such vulnerable services, characteristics, and descriptors + to prevent websites from taking advantage of them. +

+

We expect that many devices are vulnerable to unexpected data delivered to their radio. In the past, these devices had to be exploited one-by-one, @@ -587,6 +598,11 @@

Device Discovery

If any of the BluetoothUUID.getService calls threw an exception, reject promise with that exception and abort these steps. +
  • + If any service in services is blacklisted, + reject promise with a SecurityError + and abort these steps. +
  • Append {services: services} to uuidFilters.
  • Add the elements of services to requiredServiceUUIDs.
  • @@ -600,6 +616,9 @@

    Device Discovery

    If any of the BluetoothUUID.getService calls threw an exception, reject promise with that exception and abort these steps. +
  • + Remove from optionalServiceUUIDs any UUIDs that are blacklisted. +
  • @@ -1606,6 +1625,11 @@

    BluetoothGATTRemoteServer

    If BluetoothUUID.getService threw an exception, return a promise rejected with that exception and abort these steps.
  • +
  • + If service is blacklisted, + return a promise rejected with a SecurityError + and abort these steps. +
  • Query the Bluetooth cache for the first primary GATT service @@ -1633,6 +1657,11 @@

    BluetoothGATTRemoteServer

    If BluetoothUUID.getService threw an exception, return a promise rejected with that exception and abort these steps.
  • +
  • + If service is present and is blacklisted, + return a promise rejected with a SecurityError + and abort these steps. +
  • Query the Bluetooth cache for the primary GATT services on this@[[\representedDevice]] @@ -1738,6 +1767,11 @@

    BluetoothGATTService

    If BluetoothUUID.getCharacteristic threw an exception, return a promise rejected with that exception and abort these steps.
  • +
  • + If characteristic is blacklisted, + return a promise rejected with a SecurityError + and abort these steps. +
  • Query the Bluetooth cache for the first GATT characteristic within this Service @@ -1764,6 +1798,11 @@

    BluetoothGATTService

    If BluetoothUUID.getCharacteristic threw an exception, return a promise rejected with that exception and abort these steps.
  • +
  • + If characteristic is present and is blacklisted, + return a promise rejected with a SecurityError + and abort these steps. +
  • Query the Bluetooth cache for the GATT characteristics that are within this Service and, @@ -1791,6 +1830,11 @@

    BluetoothGATTService

    If BluetoothUUID.getService threw an exception, return a promise rejected with that exception and abort these steps.
  • +
  • + If service is blacklisted, + return a promise rejected with a SecurityError + and abort these steps. +
  • Query the Bluetooth cache for the first GATT included service within this Service whose UUID is service, @@ -1816,6 +1860,11 @@

    BluetoothGATTService

    If BluetoothUUID.getService threw an exception, return a promise rejected with that exception and abort these steps.
  • +
  • + If service is present and is blacklisted, + return a promise rejected with a SecurityError + and abort these steps. +
  • Query the Bluetooth cache for the GATT Included Services that are within this Service and, @@ -1928,6 +1977,11 @@

    BluetoothGATTCharacteristic

    If BluetoothUUID.getDescriptor threw an exception, return a promise rejected with that exception and abort these steps.
  • +
  • + If descriptor is blacklisted, + return a promise rejected with a SecurityError + and abort these steps. +
  • Query the Bluetooth cache for the first GATT descriptor within this Characteristic @@ -1954,6 +2008,11 @@

    BluetoothGATTCharacteristic

    If BluetoothUUID.getDescriptor threw an exception, return a promise rejected with that exception and abort these steps.
  • +
  • + If descriptor is present and is blacklisted, + return a promise rejected with a SecurityError + and abort these steps. +
  • Query the Bluetooth cache for the GATT descriptors that are within this Characteristic and, @@ -1975,6 +2034,11 @@

    BluetoothGATTCharacteristic

    and run the following steps in parallel:

      +
    1. + If this.uuid is blacklisted for reads, + return a promise rejected with a SecurityError + and abort these steps. +
    2. Let characteristic be the Characteristic that this represents. @@ -2018,6 +2082,11 @@

      BluetoothGATTCharacteristic

      MUST run the following steps:

        +
      1. + If this.uuid is blacklisted for writes, + return a promise rejected with a SecurityError + and abort these steps. +
      2. Let characteristic be the Characteristic that this represents. @@ -2076,6 +2145,10 @@

        BluetoothGATTCharacteristic

        See for details of receiving notifications.

          +
        1. + If this.uuid is blacklisted for reads, + reject promise with a SecurityError and abort these steps. +
        2. Let characteristic be the GATT Characteristic that this represents. @@ -2311,6 +2384,11 @@

          BluetoothGATTDescriptor

          and run the following steps in parallel:

            +
          1. + If this.uuid is blacklisted for reads, + return a promise rejected with a SecurityError + and abort these steps. +
          2. Let descriptor be the Descriptor that this represents. @@ -2344,6 +2422,11 @@

            BluetoothGATTDescriptor

            MUST run the following steps:

              +
            1. + If this.uuid is blacklisted for writes, + return a promise rejected with a SecurityError + and abort these steps. +
            2. Let descriptor be the Descriptor that this represents. @@ -2935,6 +3018,86 @@

              Standardized UUIDs

  • +
    +

    The GATT Blacklist

    + +

    + This specification relies on a blacklist file in the + https://github.com/WebBluetoothCG/registries repository + to restrict the set of GATT attributes a website can access. +

    + +

    + The result of parsing the blacklist at a URL url + is a map from valid UUIDs to tokens, or an error, + produced by the following algorithm: +

    +
      +
    1. Fetch url, and let contents be its body, decoded as UTF-8.
    2. +
    3. Let lines be contents split on '\n'.
    4. +
    5. + Let result be an empty map. +
    6. +
    7. + For each line in lines, do the following sub-steps: +
        +
      1. + If line is empty or its first character is '#', + continue to the next line. +
      2. +
      3. + If line consists of just a valid UUID, + let uuid be that UUID and + let token be "exclude". +
      4. +
      5. + If line consists of a valid UUID, a space (U+0020), + and one of the tokens "exclude-reads" or "exclude-writes", + let uuid be that UUID and + let token be that token. +
      6. +
      7. + Otherwise, return an error and abort these steps. +
      8. +
      9. + If uuid is already in result, + return an error and abort these steps. +
      10. +
      11. + Add a mapping in result from uuid to token. +
      12. +
      +
    8. +
    9. Return result.
    10. +
    + +

    + The GATT blacklist is the result of parsing the blacklist at + https://github.com/WebBluetoothCG/registries/blob/master/gatt_blacklist.txt. + The UA should re-fetch the blacklist periodically, but it's unspecified how often. +

    + +

    + A UUID is blacklisted if either + the GATT blacklist's value is an error, + or the UUID maps to "exclude" in the GATT blacklist. +

    +

    + A UUID is blacklisted for reads if either + the GATT blacklist's value is an error, + or the UUID maps to either "exclude" or "exclude-reads" + in the GATT blacklist. +

    +

    + A UUID is blacklisted for writes if either + the GATT blacklist's value is an error, + or the UUID maps to either "exclude" or "exclude-writes" + in the GATT blacklist. +

    +
    +

    Extensions to the Navigator Interface