Was the iPhone location logging put in by quiet law-enforcement / intelligence agency request?
You all have heard about the iPhone / iPad 3G forever location logging by now. The phone writes locations obtained from cell towers and WiFi hotspots to an eternal database, including a timestamp of the last visit on each location.* The “feature” has been known to forensics experts for quite some time and is even published in the relevant book on iPhone forensics and incorporated into a number of forensic data extraction tools in common use by law enforcement and intelligence agencies. Since the first mentions of the problem that was already present in the previous OS version iOS 3 Apple has issued quite a few security and feature updates, none of them fixed the problem. Even more, in iOS 4, it was just moved to a different file name and structure.
This does not sound like an innocent “bug” to me, but a intentional omission. Which often happens because someone in law enforcement or intelligence quietly asks the company (or even sometimes an individual programmer) to help them out. I will explain the logic why I think Apple followed such a quiet request below. (Remark: I have spent a number of years working on and designing location based services myself, so I know the tech, biz and logic behind these services.) For normal location based services you don´t need a “forever log” under any circumstances. There are exceptions, like fitness trackers, that intentionally log locations for periods of times, but this is done at the users discretion in an application, which is an entirely different case.
So why would you as a phone manufacturer normally store locations on a phone? You always want to store the last known good location (either obtained from GPS or from cell tower or WLAN SSID) in the phones flash to speed up the time to fix when the GPS is switched on. If the GPS has a rough idea about the location, the “time to fix” is much faster then if it has no idea where on the world it may be.
Also Assisted GPS uses the rough location obtained from cell towers to get from a network service an almanach with the correct satellite data for its position, saving the time to wait till the almanch updates have been received from the satellites. You can observe that if you have switched GPS off on your phone for a while, move to a different place and then switch it on in an area with no cell or data coverage. GPS will take much longer to get a fix than in an area with cell or data coverage, as it needs to wait to receive the necessary satellite orbit positions through the very slow GPS data channel. If it has network connectivity, this data is there in seconds and you get a fix. (There are more precision and speedup tricks in Assisted GPS, but you get the relevant point).
You also want to have a place where the last rough location is made available to all the apps on the phone that have a right to access it, for instance for local search, automatically selecting the right city in a public transport schedule lookup etc. This is what this consolidated.db was meant to be, apparently. But there is no valid reason to store a year or more of historic cell tower location data in it. The popular theory with Apple believers is now that this was an innocent programming error, someone just forgot to delete the last stored positions and his holy Steveness will humbly announce that there has been a honest mistake and it will be fixed soon. I find that implausible, especially as Apple has kept silent even under an serious onslaught of press requests.
Apple had ample of time to change the logging behaviour. The company has security people who follow the discussions and also know the relevant forensics literature. They must have known for a long time. Not changing the logging behaviour but even continuing it in a different file and format even through the transition to iOS 4 is in my view clearly indicative of intent. And since there is no apparent business reason, lets see if there might be a law enforcement reason.
To police or intelligence, reading the data from a captured phone of a suspect has become routine. It violates all kind of basic constitutional rights, as phones contain meanwhile large chunks of our digital lives and should be protected from government snooping. But it is done anyway, in some US states even more then in Europe. So what interest would police or intelligence have in seeing where a suspect roughly has been?
In many criminal cases, digital evidence is used to either support or contradict claims of a suspect about his behaviour. So the simple case is a suspect says he has been with his girlfriend quietly at home but his phone says he was somewhere else. In the more interesting cases, especially intelligence ones, getting a fast overview on where a suspect usually moves around provides a very strong view into his live. (See Malte Spitz visualization of his call data retention files over at Zeit Online for perspective what you can see from location data over time) .
Of course police can obtain location data from the operators as well. But, and this is big but, for that they often need a judge approval or (depending on country) warrant, it takes time and effort and is costly. And the operator may not even have the data anymore. Or the suspect has been in a foreign country, where the data is difficult to obtain anyway. Reading the data from the phone with a forensics tool is quite simple (there are phones readers on the market that are designed for use in normal poilce cruisers on the street), not effectively protected against in most jurisdictions and has a high evidence-value in court. So there is ample of motivation for law enforcement and intelligence to quietly encourage phone manufacturers (yes, I am looking on your direction too, Google) to leave logging activated, as it provides them with easy obtainable evidence.
So why then not ask the manufacturer to log precise GPS coordinates? Two reasons. One is that GPS eats lots of battery which would degrade the device performance if activated permanently, something that no phone manufacturer would do. The second reason is that all Apple had to do to do the agencies a favor was to just not delete the cell tower location data it was storing anyway. No special feature needed to be designed, not many people had to be involved, just two lines of code not written. And now it all looks conveniently like a programming error. This is btw. also the way that backdoors are built into all kind of products, so called “bug-doors”. In case the whole scheme blows up, the manufacturer always has the plausible deniability of claiming that this is just a bug.
Update: Several sources now confirm that the location logging is continued even when you have disabled location services in the iPhone. A reason to keep the last rough position present would be to make restarting the location service faster, when switched on again. But in essence, it is just another level of user betrayal, as people righfully expect that no location is calculated or logged when they disable location services. It confirms my suspicion that the “forever log” has been put in / left in by quiet law enforcement / intelligence request. And still Apple has not said a word.
Update2: Apple now has released a statement in the form of a Q&A, that tries to convince us that the data was indeed (as I described above) needed for faster location fixes. It claims that the forever-logging and the logging despite location services switched off were bugs (also as predicted above). The statement is not entirely plausible. It does not explain why a complete timestamp of last visit is attached to each celltower and WiFi station logged, instead of a sorting index for the last seen stations. Apple also states that the data should now be limited to a week, without explaining any technical reason for this. The way the location fixing works, the last handfull of location anchors (cell towers, WiFi stations) should be entirely sufficient to provide a quick re-fix. If you moved large distances with the phone switched off, the system needs to fetch the lookups anyway fresh from the network, so a week of logging will not help much. Third, Apple plans to encrypt the location log at some point. While it is a very good idea to encrypt as much sensitive stuff on phones as possible (I happen to work in the field), it will also make it more difficult to independently verify what Apple is actually storing then for a week. All in all not exactly a stellar response. While it is by its very nature very difficult to disprove my theory from above, Apples response has not really provided even a bit of relief.
* sentence updated with description of precise database contents


Gps location is also stored during using navigation apps. There are three tables for each cell, gps and wifi.
Great article. Thanks!
Gps location is also stored during using navigation apps. There are three tables for each cell, gps and wifi.
Great article. Thanks!
The only one who have the Xact locationData thou the GPS is the military. I mean to corodnate the missils takes an Xact TargetZone and the Coronates need to be Xact. About the police and the Rescuresevice i have no clue.
In-depth coverage of GPS and related technology was covered in a German podcast recorded in 12.2010 and published by ESA and DLR on
http://www.raumzeit-podcast.de/
http://www.raumzeit-podcast.de/2011/02/04/rz008-satellitennavigation/
“Felix Antreich vom Institut für Kommunikation und Navigation des DLR erläutert im Gespräch mit Tim Pritlove die technischen Grundlagen und die Funktionsweise von GPS und Galileo und geht auf die zahlreichen zukünftigen Anwendungsfälle ein, die sich aus der steigenden Genauigkeit ergeben.”
And yes, the whole lengthy podcast gives no evidence that storing the history of the receiver will be an advantage to the user.
Good article.
In the article http://www.wired.com/gadgetlab/2011/04/apple-iphone-tracking/
“Apple’s general counsel Bruce Sewell in July 2010 sent a 13-page letter (.pdf) explaining its location-data-collection techniques in response to a request from Congressmen Joe Barton and Edward Markey asking for Apple to disclose such practices (.pdf). ” There is a link in this article which explains not everything, but shows that Apple has already reacted a year ago.
Anyway with Android I have partly the chance to say No.
[...] und die daraus zu ziehenden Schlussfolgerungen sind nicht schön, at least für Apple. Hervorragend zusammengefasst von Frank Rieger. Aber ich hätte mich nicht erst seit den aktuellen Erkenntnis geweigert, mein Telefon am Empfang [...]
FUD. raw, uncut FUD. keep this up and a site like cnet might quote you as an expert. good work.
[...] Entscheidung handelt, mit der Apple eventuellen Forderungen von Ermittlungsbehörden nachkommt.» Was the iPhone location logging put in by quiet law-enforcement / intelligence agency request?-foursquare Der durchschnittliche foursquare-Nutzer hat laut Gründer Dennis Crowley fünf bis acht [...]
[...] request from government or intelligence agencies. Perhaps the most eloquent case for this was on Frank Reiger’s [...]
[...] Gate»-Problemen an der Reihe …Ach ja, Frank Rieger vom «Knowledge Brings Fear»-Weblog hat die Kommunikation von «Location Gate» als Fehler korrekt vorhergesagt (Hervorhebung durch mich):[…] The second reason is that all Apple had to do to do the agencies a [...]
Zunächst weil wichtig hier meine Position:
Apple hat großen Mist gebaut und ich erwarte(te) eine Erklärung. Diese bestätigt meine Vermutungen und ist insofern okay. Was jedoch fehlt ist eine Entschuldigung. Diese Daten sind kritisch und ich erwarte daß solch wichtige Daten sorgsamer behandelt werden. Menschliches versagen (Programmierer) ist okay. Aber dafür hat man Qualitätssicherung. Diese muss meiner Meinung nach für Datenschutzrelevante Dinge deutlich über Unit Tests (*sigh*) hinaus gehen. Da müssen z.B. auch die Konzepte an sich (ggfs. von externen) geprüft werden.
Die Q&A beantwortet mir nicht wie man solche Bugs in Zukunft vermeiden möchte. Das fehlt. Wie ich persönlich damit umgehe kann ich noch nicht sagen. Muss ich jetzt erst mal verarbeiten.
Zu deinem Hauptartikel:
Deine These macht für mich insofern keinen Sinn weil das Motiv fehlt.
Es gibt Locationdaten der User doch eh in viel besserer Form bei den Mobilfunkprovidern. Lückenlos. Und nicht nur von Apple Nutzern sondern von allen.
Schlimmer noch. Die Lawful Interception Schnittstellen sind meines Wissens nach so gestaltet daß die Mobilfunkprovider nicht mal etwas davon mitbekommen.
Aber nehmen wir mal nur kurz an es wäre so. Die CIA hat Apple gebeten eine solche Datei zu pflegen. Und diese schrottige löchrige DB ist alles was Apple liefern kann? Und die liegt einfach so aufm Gerät rum? Achso.. Apple musste es machen und hat es halt dann extra so schlecht gemacht um seine User zu schützen. Ich verstehe. Also was denn nun. Böse oder gut? Entscheiden sie sich jetzt…. beides geht nicht. Und was ist dann mit all den anderen Herstellern? Die wurden nicht gefragt? Gebeten? Sie haben sich gewehrt?
Deine These kann man nicht widerlegen. Wie jede Verschwörungstheorie. Im Zweifel gehöre ich halt zu den Verschwörern ;)
Zum Update:
Die noch offen(en) Frage(n) die ich dort lese ist:
- Warum speichert man für 7 Tage?
Du möchtest damit implizieren daß es auch ohne Cache gehen würde?
Klar. Würde. Aber darunter leidet der User weil der Fix dann ggfs. länger dauert oder NICHT klappt (wenn keine Netzverbindung besteht). Zudem bedeutet KEINEN Cache zu verwenden auch das JEDE Locationanfrage an die Apple Server geht. Damit ist dann tatsächlich der Fall gegeben daß Apple lückenlose Locationprofile der User erstellen kann.
Über die Größe des Caches kann man diskutieren. Persönlich kann ich mit 7 Tagen gut leben. Da wird die Hitrate ausreichend groß sein. Die Alternative wird ja dann auch vorhanden sein: Keine Locationbased services nutzen.
- Warum hat man einen Timestamp?
Weil es ein Cache ist. Die Aktualität der Daten ist wichtig wenn man etwas cached. Es ist fast albern diese Antwort zu geben. Ich weigere mich einem CCC Sprecher abzukaufen daß er sich diese Antwort nicht selbst geben kann.
Okay.. okay.. der Timestamp könnte unpräsziser sein. Aber das ist ja nicht dein Vorwurf. Du sagst es ist nicht plausibel! Und an der Stelle hast du entweder keine Ahnung oder stellst dich halt einfach doof. Ich weiß nicht was mir lieber wäre…. beides traurig.
@Torsten:
Leider passieren solche leisen Anfragen von Polizei und Diensten häufiger als auch mir lieb wäre. Das fängt an bei Backdoors in Crypto-Systemen, Routern, Switches und Firewalls und endet eben bei Telefonen. Das kommt in der Regel nicht als “ihr macht das oder…” sondern als ein sich entwickelnder Austausch von kleinen Gefälligkeiten und Rücksichtnahmen.
Zu den Fragen:
Ich sage nicht “ohne Cache” sondern “mit sehr kleinem Cache”. 7 Tage zu speichern bringt bei den normalen Bewegungsmustern der weitaus meisten User keinen Mehrwert. Einfach die letzten n, n<50 Lokationanker cachen reicht für das “schnell einen Fix haben” aus.
Timestamps: Ein Index darüber in welche Reihenfolge die Lokationsanker zuletzt gesehen wurden reicht für den skizzierten Anwendungszweck vollständig aus. Was umso einfacher wird, je kleiner die Anzahl der gespeicherten Datensätze ist. Um die Aktualität einzuschätzen reicht ein globaler “last DB update”-Timestamp.
@frank: Die “Geheimdienst-Theorie” passt für mich aber nicht so recht zur Art und dem Zustandekommen der Daten, die durch die heutige Apple-Erklärung und die Heise-Untersuchung nochmal deutlich wurden:
Das ist kein direkter Mitschnitt der eigenen Positionen sondern vielmehr ein Cache der von Apple zum aktuellen Umfeld bereitgestellten Daten (evtl. kombiniert mit selbst lokal ermittelten?). Ein wirklich kontinuierliches Log der Aufenthaltsorte lässt sich daraus nicht bauen, auch sind grobe “Ausreißer” dabei.
Wollte man wirklich heimlich Locations tracken, würde man doch imho möglichst nur die eigenen Daten mitschreiben, keine Daten überschreiben und das Ganze wie Thorsten schon sagt besser verstecken.
Das alles ist bei der consolidated.db nicht erfüllt…
@Frank:
Zur These: Wo ist das Motiv? Welchen Vorteil haben “sie”?
Du sagst die Antwort von Apple sei nicht plausibel. Nun sagst du DU würdest es an Apples Stelle mit anderen Werten machen (kleiner, größer, genauer, ungenauer). Warum genau ist die Antwort von Apple unplausibel nur weil du andere Werte verwenden würdest?
Ob jetzt 1 Tag oder 7 Tage.. Das ist kein dramatischer Unterschied. Wir reden immer noch von Äpfeln und Äpfeln. Nicht von Birnen.
Ein paar interessante(aber nicht wirklich neue) Infos über GPS-Geräte: http://www.forensicswiki.org/wiki/GPS
[...] Whoops, répond Jobs, on est désolé, on avait pas fait exprès. En tout cas, c’est pas parce qu’on nous l’a demandé. D’ailleurs, c’est faux, on a jamais enregistré votre position. Enfin si, mais [...]
Ich denke, dass Apple sich diese Daten für eigene Zwecke beschaffen wollte. Hier werden Informationen von GPS-ausgerüsteten iPhones genutzt um eine genaue WLAN-Router Koordinaten zu ermitteln und in zukünftigen WiFi-only Geräten zur Positionsanzeige zu nutzen.
Jeder iPhone Nutzer wird zum War-Driving für Apple verpflichtet.
It was a pleasure to read your blog, you’re now in my favourites ;) Regards, Aur�lie
[...] mirren kings of leon bst cheese battlefield bad company 2 ea ryan [...]
Hello,
which relevant forensics literature do you mean?
Thanks,
Jonas
Who did you pay to do your blog? Its really nicely designed I bet that is why you get so much traffic!