Your iPhone can be uniquely fingerprinted by apps and websites in a way that you can never clear. Not by deleting cookies, not by clearing your cache, not even by reinstalling iOS.

Cambridge University researchers will present a paper to the IEEE Symposium on Security and Privacy 2019 today explaining how their fingerprinting technique uses a fiendishly clever method of inferring device-unique accelerometer calibration data.

"iOS has historically provided access to the accelerometer, gyroscope and the magnetometer," Dr Alastair Beresford told The Register this morning. "These types of devices don't seem like they're troublesome from a privacy perspective, right? Which way up the phone is doesn't seem that bad.

"In reality," added the researcher, "it turns out that you can work out a globally unique identifier for the device by looking at these streams."

Your orientation reveals an awful lot about you

"MEMS" – microelectromechanical systems – is the catchall term for things like your phone's accelerometer, gyroscope and magnetometer. These sensors tell your handset which way up it is, whether it's turning and, if so, how fast, and how strong a nearby magnetic field is. They are vital for mobile games that rely on the user tilting or turning the handset.

These, said Beresford, are mass produced. Like all mass-produced items, especially sensors, they have the normal distribution of inherent but minuscule errors and flaws, so high-quality manufacturers (like Apple) ensure each one is calibrated.

"That calibration step allows the device to produce a more accurate parameter," explained Beresford. "But it turns out the values being put into the device are very likely to be globally unique."

Beresford and co-researchers Jiexin Zhang, also from Cambridge's Department of Computer Science and Technology, and Ian Sheret of Polymath Insight Ltd, devised a way of not only accessing data from MEMS sensors – that wasn't the hard part – but of inferring the calibration data based on what the sensors were broadcasting in real time, during actual use by a real-world user. Even better (or worse, depending on your point of view), the data can be captured and reverse-engineered through any old website or app.

"It doesn't require any specific confirmation from a user," said Beresford. "This fingerprint never changes, even if you factory reset the handset or reinstall the OS. This is buried deep inside the firmware of the device so the fingerprint data doesn't change. This provides a way to track users around the web."

How they did it

"You need to record some samples," said Beresford. "There's an API in JavaScript or inside Swift that allows you to get samples from the hardware. Because you get many samples per second, we need around 100 samples to get the attack. Around half a second on many of the devices. So it's quite quick to collect the data."

Each device generates a stream of analogue data. By converting that into digital values and applying algorithms they developed in the lab using stationary or slow-moving devices, Beresford said, the researchers could then infer what a real-world user device was doing at a given time (say, being bounced around in a bag) and apply a known offset.

"We can guess what the input is going to be given the output that we observe," he said. "If we guess correctly, we can then use that guess to estimate what the value of the scale factor and the orthogonality are."

From there it is a small step to bake those algorithms into a website or an app. Although the actual technique does not necessarily have to be malicious in practice (for example, a bank might use it to uniquely fingerprint your phone as an anti-fraud measure), it does raise a number of questions.

Good news, fandroids: you're not affected

Oddly enough, the attack doesn't work on most Android devices because they're cheaper than Apple's, in all senses of the word, and generally aren't calibrated, though the researchers did find that some Google Pixel handsets did feature calibrated MEMS.

Beresford joked: "There's a certain sense of irony that because Apple has put more effort in to provide more accuracy, it has this unfortunate side effect!"

Apple has patched the flaws in iOS 12.2 by blocking "access to these sensors in Mobile Safari just by default" as well as adding "some noise to make the attack much more difficult".

The researchers have set up a website which includes both the full research paper and their layman's explanation, along with a proof-of-concept video. Get patching, Apple fanbois. ®