blob: 0a924164d0c628cb9d8f314a193f407a9e1b31dd [file] [log] [blame]
Oliver Smith5c95bc92020-04-03 14:03:24 +02001= Specification for IMSI Pseudonymization on the Radio Interface for 2G and Above
2
3== Introduction
4
Oliver Smithbf33c752020-04-06 15:46:29 +02005=== Protecting the IMSI on the Radio Interface is Desirable
6
Oliver Smith5c95bc92020-04-03 14:03:24 +02007A long-standing issue in the 3GPP specifications is, that mobile phones and
8other mobile equipment (ME) have to send the International Mobile Subscriber
9Identity (IMSI) unencrypted over the air. Each IMSI is uniquely identifying the
10person who bought the associated Subscriber Identity Module (SIM) used in the
11ME. Therefore most people can be uniquely identified by recording the IMSI that
12their ME is sending. Efforts are made in the 2G and above specifications to
Oliver Smith7afd7012020-04-06 11:59:59 +020013send the IMSI less often, by using the Temporary Mobile Subscriber Identity
14(TMSI) where possible.
Oliver Smith5c95bc92020-04-03 14:03:24 +020015
16But this is not enough. So-called IMSI catchers were invented and are used to
17not only record IMSIs when they have to be sent. But also to force ME to send
18their IMSI by immitating a Base Transceiver Station (BTS). IMSI catchers have
19become small and affordable, even criminals actors without much budget can use
20them to track anybody with a mobile phone.
21
Oliver Smithbf33c752020-04-06 15:46:29 +020022=== Summary of Proposed Solution
23
Oliver Smith5c95bc92020-04-03 14:03:24 +020024The solution presented in this document is to periodically change the IMSI of
25the ME to a new pseudonymous IMSI allocated by the Home Location Register (HLR)
Oliver Smithbf33c752020-04-06 15:46:29 +020026or Home Subscriber Service (HSS). The next pseudonymous IMSI is sent to the SIM
27via Short Message Service (SMS), then a SIM applet overwrites the IMSI of the
28SIM with the new value. The only component that needs to be changed in the
29network besides the SIM is the HLR/HSS, therefore it should be possible even
30for a Mobile Virtual Network Operator (MVNO) to deploy this privacy
Oliver Smith5c95bc92020-04-03 14:03:24 +020031enhancement.
32
Oliver Smithbf33c752020-04-06 15:46:29 +020033=== Summary of Existing Location Updating Procedures in RAN and CN
Oliver Smith5c95bc92020-04-03 14:03:24 +020034
Oliver Smith6f9f2182020-04-06 14:29:34 +020035The subscriber's SIM is provisioned with the IMSI and cryptographic keys of a
36subscriber, after the subscriber was added with the same data to the HLR/HSS.
37In the Remote Access Network (RAN), the IMSI is sent over the air interface and
38then transmitted to the Core Network (CN), where it is validated by the
39HLR/HSS. The involved components vary by the generation of the network and
40whether the SIM is attempting a Circuit Switched (CS) or Packet Switched (PS)
41connection, but the principle is the same. This document uses 2G CS Location
42Updating for reference, as in <<figure-imsi-regular>>.
Oliver Smith7afd7012020-04-06 11:59:59 +020043
44The IMSI is transmitted in the Location Updating Request from ME. The VLR
45needs an authentication challenge specific to the secret keys on the SIM to
46authenticate the SIM, and looks the authentication challenges up by the IMSI.
47If the VLR does not have any more authentication challenges for the IMSI (as it
48happens when the VLR sees the IMSI for the first time), the VLR requests new
49authentication challenges from the HLR. Then the HLR verifies that the IMSI is
50known and, if it is unknown, sends back an error that will terminate the
51Location Updating procedure.
52
53After the VLR found the authentication challenge, it authenticates the SIM, and
54performs a Classmark Enquiry and Physical Channel Reconfiguration. Then the VLR
55has the required information to finish the Location Updating, and continues
Oliver Smith206a0fa2020-04-07 14:30:07 +020056with Process Update_Location_HLR (3GPP TS 29.002). Afterwards, the VLR assigns
57a new TMSI with the Location Updating Accept, which is acknowledged by the TMSI
58Reallocation Complete. In following Location Updates with the same MSC, the ME
59sends the TMSI instead of the IMSI in the Location Updating Request.
Oliver Smith7afd7012020-04-06 11:59:59 +020060
61[[figure-imsi-regular]]
62.Location Updating in 2G CS with IMSI
63["mscgen"]
64----
65msc {
66 hscale="1.75";
67 ME [label="ME"], BTS [label="BTS"], BSC [label="BSC"], MSC [label="MSC/VLR"],
68 HLR [label="HLR"];
69
70 // BTS <=> BSC: RSL
71 // BSC <=> MSC: BSSAP, RNSAP
72 // MSC <=> HLR: MAP (process Update_Location_HLR, 3GPP TS 29.002)
73
74 ME => BTS [label="Location Updating Request"];
75 BTS => BSC [label="Location Updating Request"];
76 BSC => MSC [label="Location Updating Request"];
77
Oliver Smith7e33ef52020-04-07 15:05:11 +020078 --- [label="If necessary: VLR requests new authentication challenges for this IMSI"];
Oliver Smith7afd7012020-04-06 11:59:59 +020079 MSC => HLR [label="Send Auth Info Request"];
80 MSC <= HLR [label="Send Auth Info Result"];
81 ---;
82
83 BSC <= MSC [label="Authentication Request"];
84 BTS <= BSC [label="Authentication Request"];
85 ME <= BTS [label="Authentication Request"];
86 ME => BTS [label="Authentication Response"];
87 BTS => BSC [label="Authentication Response"];
88 BSC => MSC [label="Authentication Response"];
89 BSC <= MSC [label="Classmark Enquiry"];
90 BTS <= BSC [label="Classmark Enquiry"];
91 ME <= BTS [label="Classmark Enquiry"];
92 ME => BTS [label="Classmark Change"];
93 BTS => BSC [label="Classmark Change"];
94 BSC => MSC [label="Classmark Update"];
95 BSC <= MSC [label="Physical Channel Reconfiguration"];
96 BTS <= BSC [label="Ciphering Mode Command"];
97 ME <= BTS [label="Ciphering Mode Command"];
Oliver Smith8c81b552020-04-07 08:44:56 +020098 ME => BTS [label="Ciphering Mode Complete"];
Oliver Smith7afd7012020-04-06 11:59:59 +020099 BTS => BSC [label="Ciphering Mode Complete"];
100 BSC => MSC [label="Ciphering Mode Complete"];
101
Oliver Smith206a0fa2020-04-07 14:30:07 +0200102 --- [label="Process Update_Location_HLR (3GPP TS 29.002)"];
Oliver Smith7afd7012020-04-06 11:59:59 +0200103 MSC => HLR [label="Update Location Request"];
104 MSC <= HLR [label="Insert Subscriber Data Request"];
105 MSC => HLR [label="Insert Subscriber Data Result"];
106 MSC <= HLR [label="Update Location Result"];
Oliver Smith206a0fa2020-04-07 14:30:07 +0200107 ---;
Oliver Smith7afd7012020-04-06 11:59:59 +0200108
109 BSC <= MSC [label="Location Updating Accept"];
110 BTS <= BSC [label="Location Updating Accept"];
111 ME <= BTS [label="Location Updating Accept"];
112 ME => BTS [label="TMSI Reallocation Complete"];
113 BTS => BSC [label="TMSI Reallocation Complete"];
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200114 BSC => MSC [label="TMSI Reallocation Complete"];
Oliver Smith7afd7012020-04-06 11:59:59 +0200115}
116----
117
Oliver Smithbf33c752020-04-06 15:46:29 +0200118<<<
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200119== Required Changes
Oliver Smith6f9f2182020-04-06 14:29:34 +0200120
Oliver Smithbf33c752020-04-06 15:46:29 +0200121=== Pseudonymous IMSI Storage in the HLR
122
123The HLR must store up to two pseudonymous IMSIs (imsi_pseudo) and their related
124counters (imsi_pseudo_i) per subscriber. Each subscriber initially has one
125pseudonymous IMSI allocated. A subscriber has two valid pseudonymous IMSIs
126only during the transition phase from the old pseudonymous IMSI to the new one.
127The amount of available IMSIs must be higher than the amount of subscribers
128registered with the HLR. If the amount of available IMSIs is too short, the HLR
129can delay assigning new pseudonymous IMSIs until new IMSIs are available again.
130
131.Examples for additional subscriber data in HLR
132|===
133| Subscriber ID | imsi_pseudo | imsi_pseudo_i
134// example IMSIs taken from Wikipedia
135| 123
136| 310150123456789
137| 1
138
139| 234
140| 502130123456789
141| 1
142
143| 234
144| 460001357924680
145| 2
146|===
147
148==== imsi_pseudo
149
150The value for imsi_pseudo is a random choice from the pool of available IMSIs
151that the HLR controls. The pseudonymous IMSI must not be used by any subscriber
152as pseudonymous IMSI yet, but may be the real IMSI of a subscriber.
153
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200154[[hlr-imsi-pseudo-i]]
Oliver Smithbf33c752020-04-06 15:46:29 +0200155==== imsi_pseudo_i
156
157The counter imsi_pseudo_i indicates how often a subscriber's pseudonymous IMSI
Oliver Smith8c81b552020-04-07 08:44:56 +0200158was changed. The value is 1 for the first allocated pseudonymous IMSI of a
159subscriber. When allocating a new pseudonymous IMSI for the same subscriber,
160the new imsi_pseudo_i value is increased by 1. The counter is used by the SIM
Oliver Smithbf33c752020-04-06 15:46:29 +0200161applet to detect and ignore outdated requests related to changing the
162pseudonymous IMSI.
163
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200164=== SIM Provisioning
Oliver Smith6f9f2182020-04-06 14:29:34 +0200165
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200166The HLR is allocating a pseudonymous IMSI for the subscriber. This pseudonymous
167IMSI is stored as IMSI on the subscriber's SIM instead of the real IMSI.
168
169==== SIM applet
170
171The SIM is provisioned with a SIM applet, which is able to change the IMSI once
172the next pseudonymous IMSI arrives from the HLR. A reference implementation is
173provided in <<reference-src>>.
174
175The SIM applet registers to a suitable SMS trigger (3GPP TS 03.19, Section
1766.2). When an SMS from the HLR in the format of <<sms-format>> arrives, the
177applet must verify that the SMS is not outdated by comparing imsi_pseudo_i from
178the SMS with the last imsi_pseudo_i that was used when changing the IMSI
179(initially 1 as in <<hlr-imsi-pseudo-i>>). The new value must be higher,
180otherwise the SMS should not be processed further.
181
182The SIM applet registers a timer with min_sleep_time from the SMS. When the
183timer triggers, the IMSI of the SIM is overwritten with the new pseudonymous
184IMSI, the TMSI and GSM Ciphering key Kc (3GPP TS 31.102, Section 4.4.3.1) are
185invalidated. The current imsi_pseudo_i value is stored to compare it with the
186next SMS. Afterwards, the EF~IMSI~ changing procedure in 3GPP TS 11.14, Section
1876.4.7.1 is executed to apply the new IMSI.
188
189// FIXME: do we need to enforce the LU now, with an arbitrary CM Service
190// Request, or would this only be necessary for Osmocom? (OS#4404)
Oliver Smith206a0fa2020-04-07 14:30:07 +0200191=== Process Update_Location_HLR
Oliver Smithbf33c752020-04-06 15:46:29 +0200192
Oliver Smith206a0fa2020-04-07 14:30:07 +0200193All IMSI Pseudonymization related changes to Process Update_Location_HLR
Oliver Smith92a22882020-04-07 14:50:56 +0200194(3GPP TS 29.002) are optional. All deviations from the existing specification
195that are outlined in this section are expected to be enabled or disabled
196entirely where IMSI pseudonymization is implemented.
Oliver Smith206a0fa2020-04-07 14:30:07 +0200197
Oliver Smithef43ac32020-04-07 16:02:19 +0200198[[figure-imsi-pseudo]]
Oliver Smith206a0fa2020-04-07 14:30:07 +0200199.Process Update_Location_HLR with IMSI pseudonymization changes
200["mscgen"]
201----
202msc {
203 hscale="1.75";
204 MSC [label="MSC/VLR"], SMSC [label="SMS-SC"], HLR [label="HLR"];
205
206 MSC => HLR [label="Update Location Request"];
Oliver Smith7e33ef52020-04-07 15:05:11 +0200207
208 --- [label="If new pseudonymous IMSI was used: deallocate and cancel old pseudonymous IMSI"];
209 HLR box HLR [label="Deallocate old pseudonymous IMSI"];
210 MSC <= HLR [label="Cancel Location Request"];
211 MSC => HLR [label="Cancel Location Result"];
212 ---;
213
Oliver Smith206a0fa2020-04-07 14:30:07 +0200214 MSC <= HLR [label="Insert Subscriber Data Request"];
215 MSC => HLR [label="Insert Subscriber Data Result"];
Oliver Smith7e33ef52020-04-07 15:05:11 +0200216 HLR box HLR [label="Start Next_Pseudo_IMSI_Timer"];
Oliver Smith206a0fa2020-04-07 14:30:07 +0200217 MSC <= HLR [label="Update Location Result"];
Oliver Smith7e33ef52020-04-07 15:05:11 +0200218 MSC box MSC [label="Finish Location Updating with ME"],
Oliver Smith206a0fa2020-04-07 14:30:07 +0200219
Oliver Smith7e33ef52020-04-07 15:05:11 +0200220 HLR box HLR [label="Wait for Next_Pseudo_IMSI_Timer expiry"];
Oliver Smith206a0fa2020-04-07 14:30:07 +0200221 |||;
222 ...;
223 |||;
Oliver Smith7e33ef52020-04-07 15:05:11 +0200224 HLR box HLR [label="Next_Pseudo_IMSI_Timer expired"];
225
226 HLR box HLR [label="\nAllocate new pseudonymous IMSI\nif subscriber only has one allocated\n"];
Oliver Smith206a0fa2020-04-07 14:30:07 +0200227 SMSC <= HLR [label="Next Pseudonymous IMSI SMS"];
228 SMSC box SMSC [label="Deliver SMS to ME"];
229}
230----
Oliver Smith7afd7012020-04-06 11:59:59 +0200231
Oliver Smithef43ac32020-04-07 16:02:19 +0200232==== Update Location Request
233When Update Location Request arrives, the HLR does not look up the subscriber
234by the IMSI, but by the pseudonymous IMSI instead. Unless the subscriber has
235two pseudonymous IMSI allocated and used the old pseudonymous IMSI in the
236Update Location Request, this is followed by the existing logic to continue with
237Insert Subscriber Data Request.
238
239===== Update Location Request With New Pseudonymous IMSI
240
241If the subscriber has two pseudonymous IMSIs allocated, and the newer entry was
242used (higher imsi_pseudo_i, see <<hlr-imsi-pseudo-i>>), this section applies.
243The older pseudonymous IMSI is deallocated in the HLR. This is done as early
244as possible, so the timeframe where two pseudonymous IMSI are allocated for one
245subscriber is short.
246
247A Cancel Location Request with the old pseudonymous IMSI is sent to the VLR, so
248the conflicting subscriber entry with the old pseudonymous IMSI is deleted from
249the VLR. Receiving a Cancel Location Result is followed by the existing logic
250to continue with Insert Subscriber Data Request.
251
252===== Update Location Request With Old Pseudonymous IMSI
253
254If the subscriber has two pseudonymous IMSIs allocated, and the older entry was
255used (lower imsi_pseudo_i, see <<hlr-imsi-pseudo-i>>), the newer entry is _not_
256deallocated. This could lock out the subscriber from the network if the SMS
257with the new pseudonymous IMSI arrives with a delay.
258
259==== Insert Subscriber Data Result
260
261ISD works like before, then set Next_Pseudo_IMSI_Timer
262
263==== Next_Pseudo_IMSI_Timer Expires
264
265* if subscriber has only one pseudo IMSI:
266 * abort if not enough IMSIs available
267 * generate new pseudo IMSI as described earlier
268 * set imsi_pseudo_i like last one + 1
269* send SMS to subscriber's SIM with newer pseudo IMSI
270
271[[sms-format]]
272==== SMS Format
273
274* min_sleep_time
275* imsi_pseudo
276* imsi_pseudo_i
277
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200278== Error Scenarios
279=== Next Pseudonymous IMSI SMS is Lost
280=== SMS Arrives Late
Oliver Smith7afd7012020-04-06 11:59:59 +0200281
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200282// === SMS Arrives Before Timer Expires
283// FIXME: OS#4486
284
285[[reference-src]]
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200286== Reference Implementation with Source Code
Oliver Smith7afd7012020-04-06 11:59:59 +0200287
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200288== Recommendations for Real-World Implementations
289=== ATT = 0
Oliver Smith5c95bc92020-04-03 14:03:24 +0200290=== End to End Encryption of SMS
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200291=== Warning the User if the IMSI Does Not Change
Oliver Smith5c95bc92020-04-03 14:03:24 +0200292=== User-configurable Minimum Duration Between IMSI Changes
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200293
294<<<
295include::./common/chapters/gfdl.adoc[]