exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

oBike Electronic Lock Bypass

oBike Electronic Lock Bypass
Posted Sep 13, 2018
Authored by Antoine Neuenschwander

oBike Electronic Lock suffers from an access control bypass vulnerability via a replay attack on a predictable nonce.

tags | exploit, bypass
advisories | CVE-2018-16242
SHA-256 | 13df632e5c53843e23194156fe2d63616d6e5979d4123095f308d37fcc056c1b

oBike Electronic Lock Bypass

Change Mirror Download
################################################################################
# #
# CVE-2018-16242 - oBike Electronic Lock Bypass #
# #
################################################################################
# #
# Product: oBike bicycle-sharing service #
# Vendor: oBike Inc. #
# CVE ID: CVE-2018-16242 #
# Subject: Access control bypass by replay attack on predictable nonce #
# Effect: Unauthorized unlocking of bikes, cirumventing the ride-fees #
# Author: Antoine Neuenschwander (@ant0inet) #
# Date: 2018-09-13 #
# #
################################################################################


Vendor/product description:
-----------------------------
oBike is (was) a Singaporean stationless bicycle-sharing system with operations
in several countries [1].

Introduction:
-------------
The bikes have a built-in Bluetooth lock [2]. Clients use their smartphone to
locate a bicycle. Once nearby, they unlock the bicycle directly from the app or
by scanning a QR code. Unlike traditional rental services, which require bikes
to be returned to a fixed docking station, users are free to leave the bikes
at any suitable bike parking spot.

Affected:
---------
As of August 2018, this issue seems to affect the whole oBike fleet (or what is
left of it).

Technical Description:
----------------------
The oBike lock consists of a TI CC2541 microcontroller, a power-optimized
System on a Chip (SoC) used for Bluetooth Low Energy (BLE) applications. The
lock itself has no IP connectivity; it piggybacks the mobile device's 3G/4G
connection to communicate with the oBike backend. The lock communicates via
BLE with the oBike app on the mobile device. Protocol messages are then relayed
to the oBike backend via a REST API.


oBike Lock (BLE) Mobile Device (HTTPS) oBike Backend
------------+------------------------+---------------------------+--------------
| | |
| (1) hello(lat, lng) | |
| <--------------------- | |
Generate | | |
32bit | (2) keySource | |
Challenge | ---------------------> | (3) unlockPass(keySource) |
| | ========================> | Compute
| | | Response
| (5) | (4) encKey, keys |
| sendKeys(encKey, keys) | <======================== |
!Unlock | <--------------------- | |
Bike! | | |
| | |
Generate | | |
Acknowledge | (6) macKey, index | (7) |
Message | ---------------------> | lockMessage(macKey,index) |
| | ========================> | Register
| | | Ride (start
| | | billing)

Steps:
(1) BLE send `hello` message, push GPS coordinates to lock.
(2) BLE receive `keySource`, a 32bit value used as a challenge.
(3) HTTPS send `keySource` to oBike backend via the `unlockPass` REST call.
(4) HTTPS receive `encKey` (key index) and a 128bit ciphertext in `keys`.
(5) BLE send `keys` (truncated to 96bits) and the `encKey`. At that point, the
bike will unlock.
(6) BLE receive `macKey` and `index`, an acknowledgement that the unlocking was
successful.
(7) HTTPS send `lockMessage`, with the corresponding values (`macKey` and
`index`). At that point, the oBike backend will register the ride and start
billing.

A first vulnerability [3] was found prior to this advisory, which consists in
leaving out the acknowledgement in step (7). By omitting this message, the
lock is opened but the ride is not registered at the oBike backend, therefore
not being billed.

Analysis of the `keySource` field (32 bit challenge) in step (2) showed that
the values generated by the lock are not random as expected. Rather, the
values represent the number of milliseconds since the chip was powered on. This
corresponds to a time window of roughly 50 days (2^32 milliseconds).

The 128bit ciphertext in `keys` from step (5) is used to unlock the bike. Its
value as returned by the oBike backend is the result of an unknown cryptographic
operation based on the `keySource` field (generated by the lock), and the
`encKey` value (given by the backend). Taken from the CC2541 specifications
and the length of `keys`, the value corresponds most probably to an AES-128
ciphertext. The `encKey` in turn selects the encryption key from a set of
64 distinct indices, which is chosen randomly by the backend.

Given fixed `keySource` and `encKey` values it was observed that the resulting
`keys` value is always equal, allowing for replay attacks. To this end, all
possible `keySource` values are enumerated and the corresponding `keys` and
`encKey` values captured. It is possible to replay these values offline at a
later point in time.

To limit the number of values to be enumerated, A BLE command was discovered
that provokes a chip reset. Given this condition, the generated `keySource`
lies within a predictable time window, which greatly simplifies the attack.
Now, only several seconds worth of `keySource` values are needed to implement
the replay attack.

A description of the BLE and REST protocols can be found in [4].

Workaround / Fix:
-----------------
No known fix/workaround available. The attack works offline, there is no known
possiblity to detect or to prevent it on the backend.

Timeline:
---------
2018-08-21: Found vulnerability
2018-08-22: Contact request sent to oBike Inc. support
2018-08-24: Contact request sent to SingCERT
2018-08-28: Another attempt contacting oBike Inc. support
2018-08-28: CVE-ID requested
2018-08-29: Another attempt contacting SingCERT
2018-08-29: Contact request sent to oBike Italy
2018-08-30: Response from SingCERT
2018-08-30: CVE ID assigned CVE-2018-16242
2018-09-13: No response from oBike, vulnerability disclosure

References:
-----------
[1] oBike Inc. https://www.o.bike/

[2] Smart Locker HBT203 by Hangzhou Luoping Electronics Co.,Ltd
https://fccid.io/2ALWC-HBT203

[3] "Exploration of Weakness in Bike Sharing System"
National University of Singapore, School of Computing
CS3235 Student Projects 2017/2018

[4] Reverse engineering of the oBike protocol communication (BLE and HTTP)
https://github.com/antoinet/obike
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close