Skip to content
IDOR Write-up Intermediate

Pwning the Nokelock API

The Nokelock API lacked authorisation checks, allowing any authenticated user to read and modify other users' lock data, including email addresses, password hashes, GPS coordinates, and lock encryption keys. An attacker could also unlock any lock via Bluetooth by obtaining its key from the API.

pentestpartners.com

Published on pentestpartners.com

I’ve been talking at some Infosec meet ups about a certain padlock, called the Nokelock. I need to differentiate this right now as there is a product called nokē, this is not about that.

PTP Admin, on pentestpartners.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the API only checked that a token was valid, not that the authenticated user was authorised to access the requested resource.

Impact

An attacker could unlock any lock within Bluetooth range, read users' email addresses, password hashes and lock GPS coordinates, and de-register locks to deny access to their owners.

What the attacker needed

A free account; lock's QR code or MAC address; Bluetooth range (10 m)

How it was found

  1. Create a user account with a throwaway email address to obtain an API token.
  2. Send a request to the getDeviceInfo endpoint with a lock's QR code, or to the queryDevice endpoint with the lock's MAC address.
  3. Receive the lock's encryption key and other details in the response.
  4. Use the key to encrypt a BLE unlock command and send it to the lock.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The lock's online service did not check whether a user was allowed to access a particular lock or account. Anyone who signed up could ask the service for another person's data or change their lock settings. The service also sent everything over an unencrypted connection, so anyone on the same network could read it.

What is IDOR?

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.