Project

General

Profile

Download (17.9 KB) Statistics
| Branch: | Revision:
1
= Specification for IMSI Pseudonymization on the Radio Interface for 2G/3G/4G
2

    
3
== Introduction
4

    
5
=== Protecting the IMSI on the Radio Interface is Desirable
6

    
7
A long-standing issue in the 3GPP specifications is, that mobile phones and
8
other mobile equipment (ME) have to send the International Mobile Subscriber
9
Identity (IMSI) unencrypted over the air. Each IMSI is a unique identifier for
10
the subscriber. Therefore most people can be uniquely identified by recording
11
the IMSI that their ME is sending.  The 3GPP specifications provide means for
12
implementations to send the IMSI less often by using the Temporary Mobile
13
Subscriber Identity (TMSI) where possible.
14

    
15
But this is not enough. So-called IMSI catchers were invented and are used to
16
not only record IMSIs when they have to be sent. But also to force ME to send
17
their IMSI by imitating a Base Transceiver Station (BTS). IMSI catchers have
18
become small and affordable, even criminals actors without much budget can use
19
them to track anybody with a mobile phone.
20

    
21
5G addresses this problem with the Subscriber Concealed Identifier (SUCI),
22
which uses public-key cryptography to ensure that the permanent subscriber
23
identity can only be read by the home network (3GPP TS 33.501, Section 6.12.2).
24
A comparable, but different approach to conceal the IMSI for 2G, 3G and 4G is
25
provided in this specification.
26

    
27
=== Summary of Proposed Solution
28

    
29
The solution presented in this document is to periodically change the IMSI of
30
the ME to a new pseudonymous IMSI allocated by the Home Location Register (HLR)
31
or Home Subscriber Service (HSS). The next pseudonymous IMSI is sent to the SIM
32
via Short Message Service (SMS), then a SIM applet overwrites the IMSI of the
33
SIM with the new value. The only component that needs to be changed in the
34
network besides the SIM/USIM is the HLR/HSS, therefore it should be possible
35
even for a Mobile Virtual Network Operator (MVNO) to deploy this privacy
36
enhancement.
37

    
38
=== Summary of Existing Location Updating Procedures in RAN and CN
39

    
40
The subscriber's SIM is provisioned with the IMSI and cryptographic keys of a
41
subscriber, after the subscriber was added with the same data to the HLR/HSS.
42
In the Remote Access Network (RAN), the IMSI is sent over the air interface and
43
then transmitted to the Core Network (CN), where it is validated by the
44
HLR/HSS. The involved components vary by the generation of the network and
45
whether the SIM is attempting a Circuit Switched (CS) or Packet Switched (PS)
46
connection, but the principle is the same. This document uses 2G CS Location
47
Updating for reference, as in <<figure-imsi-regular>>.
48

    
49
The IMSI is transmitted in the Location Updating Request from ME. The VLR
50
needs an authentication challenge specific to the secret keys on the SIM to
51
authenticate the SIM, and looks the authentication challenges up by the IMSI.
52
If the VLR does not have any more authentication challenges for the IMSI (as it
53
happens when the VLR sees the IMSI for the first time), the VLR requests new
54
authentication challenges from the HLR. Then the HLR verifies that the IMSI is
55
known and, if it is unknown, sends back an error that will terminate the
56
Location Updating procedure.
57

    
58
After the VLR found the authentication challenge, it authenticates the SIM, and
59
performs a Classmark Enquiry and Physical Channel Reconfiguration. Then the VLR
60
has the required information to finish the Location Updating, and continues
61
with Process Update_Location_HLR (3GPP TS 29.002). Afterwards, the VLR assigns
62
a new TMSI with the Location Updating Accept, which is acknowledged by the TMSI
63
Reallocation Complete. In following Location Updates with the same MSC, the ME
64
sends the TMSI instead of the IMSI in the Location Updating Request.
65

    
66
[[figure-imsi-regular]]
67
.Location Updating in 2G CS with IMSI
68
["mscgen"]
69
----
70
msc {
71
  hscale="1.75";
72
  ME [label="ME"], BTS [label="BTS"], BSC [label="BSC"], MSC [label="MSC/VLR"],
73
  HLR [label="HLR"];
74

    
75
  // BTS <=> BSC: RSL
76
  // BSC <=> MSC: BSSAP, RNSAP
77
  // MSC <=> HLR: MAP (process Update_Location_HLR, 3GPP TS 29.002)
78

    
79
  ME   => BTS [label="Location Updating Request"];
80
  BTS  => BSC [label="Location Updating Request"];
81
  BSC  => MSC [label="Location Updating Request"];
82

    
83
  --- [label="If necessary: VLR requests new authentication challenges for this IMSI"];
84
  MSC  => HLR [label="Send Auth Info Request"];
85
  MSC <=  HLR [label="Send Auth Info Result"];
86
  ---;
87

    
88
  BSC <=  MSC [label="Authentication Request"];
89
  BTS <=  BSC [label="Authentication Request"];
90
  ME  <=  BTS [label="Authentication Request"];
91
  ME   => BTS [label="Authentication Response"];
92
  BTS  => BSC [label="Authentication Response"];
93
  BSC  => MSC [label="Authentication Response"];
94
  BSC <=  MSC [label="Classmark Enquiry"];
95
  BTS <=  BSC [label="Classmark Enquiry"];
96
  ME  <=  BTS [label="Classmark Enquiry"];
97
  ME   => BTS [label="Classmark Change"];
98
  BTS  => BSC [label="Classmark Change"];
99
  BSC  => MSC [label="Classmark Update"];
100
  BSC <=  MSC [label="Physical Channel Reconfiguration"];
101
  BTS <=  BSC [label="Ciphering Mode Command"];
102
  ME  <=  BTS [label="Ciphering Mode Command"];
103
  ME   => BTS [label="Ciphering Mode Complete"];
104
  BTS  => BSC [label="Ciphering Mode Complete"];
105
  BSC  => MSC [label="Ciphering Mode Complete"];
106

    
107
  --- [label="Process Update_Location_HLR (3GPP TS 29.002)"];
108
  MSC  => HLR [label="Update Location Request"];
109
  MSC <=  HLR [label="Insert Subscriber Data Request"];
110
  MSC  => HLR [label="Insert Subscriber Data Result"];
111
  MSC <=  HLR [label="Update Location Result"];
112
  ---;
113

    
114
  BSC <=  MSC [label="Location Updating Accept"];
115
  BTS <=  BSC [label="Location Updating Accept"];
116
  ME  <=  BTS [label="Location Updating Accept"];
117
  ME   => BTS [label="TMSI Reallocation Complete"];
118
  BTS  => BSC [label="TMSI Reallocation Complete"];
119
  BSC  => MSC [label="TMSI Reallocation Complete"];
120
}
121
----
122

    
123
<<<
124
== Required Changes
125

    
126
[[hlr-imsi-pseudo-storage]]
127
=== Pseudonymous IMSI Storage in the HLR
128

    
129
The HLR must store up to two pseudonymous IMSIs (imsi_pseudo) and their related
130
counters (imsi_pseudo_i) per subscriber. Each subscriber initially has one
131
pseudonymous IMSI allocated. A subscriber has two valid pseudonymous IMSIs
132
only during the transition phase from the old pseudonymous IMSI to the new one.
133
The amount of available IMSIs must be higher than the amount of subscribers
134
registered with the HLR. If the amount of available IMSIs is too short, the HLR
135
can delay assigning new pseudonymous IMSIs until new IMSIs are available again.
136

    
137
.Examples for additional subscriber data in HLR
138
[options="header"]
139
|===
140
| Subscriber ID | imsi_pseudo | imsi_pseudo_i
141
// example IMSIs taken from Wikipedia
142
| 123
143
| 310150123456789
144
| 1
145

    
146
| 234
147
| 502130123456789
148
| 1
149

    
150
| 234
151
| 460001357924680
152
| 2
153
|===
154

    
155
==== imsi_pseudo
156

    
157
The value for imsi_pseudo is a random choice from the pool of available IMSIs
158
that the HLR controls. The pseudonymous IMSI must not be used by any subscriber
159
as pseudonymous IMSI yet, but may be the real IMSI of a subscriber.
160

    
161
[[hlr-imsi-pseudo-i]]
162
==== imsi_pseudo_i
163

    
164
The counter imsi_pseudo_i indicates how often a subscribers pseudonymous IMSI
165
was changed. The value is 1 for the first allocated pseudonymous IMSI of a
166
subscriber. When allocating a new pseudonymous IMSI for the same subscriber,
167
the new imsi_pseudo_i value is increased by 1. The counter is used by the SIM
168
applet to detect and ignore outdated requests related to changing the
169
pseudonymous IMSI.
170

    
171
=== SIM Provisioning
172

    
173
IMSI pseudonymization as specified by this document works with SIM and USIM.
174
The HLR is allocating a pseudonymous IMSI for the subscriber. This pseudonymous
175
IMSI is stored as IMSI on the subscriber's SIM instead of the real IMSI.
176

    
177
[[sim-app]]
178
==== SIM applet
179

    
180
The SIM is provisioned with a SIM applet, which is able to change the IMSI once
181
the next pseudonymous IMSI arrives from the HLR. A reference implementation is
182
provided in <<reference-src>>.
183

    
184
===== Counter Storage
185

    
186
The following counter variables are stored in the SIM applet.
187

    
188
[options="header",cols="20%,12%,68%"]
189
|===
190
| Name | Initial value | Description
191

    
192
| imsi_pseudo_i
193
| 1
194
| See <<hlr-imsi-pseudo-i>>.
195

    
196
| imsi_pseudo_lu
197
| 0
198
| Amount of Location Updating procedures done with the same pseudonymous IMSI.
199

    
200
| imsi_pseudo_lu_max
201
| (decided by operator)
202
| Maximum amount of Location Updating procedures done with the same
203
  pseudonymous IMSI, before the SIM applet shows a warning to the subscriber.
204
|===
205

    
206
===== Switch to Next Pseudonymous IMSI
207

    
208
The SIM applet registers to a suitable SMS trigger (3GPP TS 43.019, Section
209
6.2). When an SMS from the HLR in the structure of <<sms-structure>> arrives,
210
the applet must verify that the SMS is not outdated by comparing imsi_pseudo_i
211
from the SMS with the last imsi_pseudo_i that was used when changing the IMSI
212
(initially 1 as in <<hlr-imsi-pseudo-i>>). The new value must be higher,
213
otherwise the SMS should not be processed further.
214

    
215
The SIM applet registers a timer with min_sleep_time from the SMS. When the
216
timer triggers, the IMSI of the SIM is overwritten with the new pseudonymous
217
IMSI, the TMSI and GSM Ciphering key Kc (3GPP TS 31.102, Section 4.4.3.1) are
218
invalidated. The current imsi_pseudo_i from the SMS is stored in the SIM applet
219
to compare it with the next SMS. imsi_pseudo_lu is reset to 0. Afterwards,
220
the EF~IMSI~ changing procedure in 3GPP TS 11.14, Section 6.4.7.1 is executed
221
to apply the new IMSI.
222

    
223
// FIXME: do we need to enforce the LU now, with an arbitrary CM Service
224
// Request, or would this only be necessary for Osmocom? (OS#4404)
225

    
226
===== Warning the Subscriber If the Pseudonymous IMSI Does Not Change
227

    
228
An attacker could potentially block the next pseudonymous IMSI SMS on purpose.
229
Because the SIM applet cannot decide the next pseudonymous IMSI, it would have
230
the same pseudonymous IMSI for a long time. Then it could become feasible for
231
an attacker to track the subscriber by their pseudonymous IMSI. Therefore the
232
SIM applet should warn the subscriber if the pseudonymous IMSI does not change.
233

    
234
The SIM applet registers to EVENT_EVENT_DOWNLOAD_LOCATION_STATUS (3GPP TS
235
03.19, Section 6.2) and increases imsi_pseudo_lu by 1 when the event is
236
triggered. If imsi_pseudo_lu reaches imsi_pseudo_lu_max, the SIM applet
237
displays a warning to the subscriber.
238

    
239
[[process-update-location-hlr]]
240
=== Process Update_Location_HLR
241

    
242
All IMSI Pseudonymization related changes to Process Update_Location_HLR
243
(3GPP TS 29.002) are optional. Deviations from the existing specification that
244
are outlined in this section are expected to be enabled or disabled entirely
245
where IMSI pseudonymization is implemented.
246

    
247
[[figure-imsi-pseudo]]
248
.Process Update_Location_HLR with IMSI pseudonymization changes
249
["mscgen"]
250
----
251
msc {
252
  hscale="1.75";
253
  MSC [label="MSC/VLR"], SMSC [label="SMS-SC"], HLR [label="HLR"];
254

    
255
  MSC   => HLR  [label="Update Location Request"];
256

    
257
  --- [label="If new pseudonymous IMSI was used: deallocate and cancel old pseudonymous IMSI"];
258
  HLR  box HLR  [label="Deallocate old pseudonymous IMSI"];
259
  MSC  <=  HLR  [label="Cancel Location Request"];
260
  MSC   => HLR  [label="Cancel Location Result"];
261
  ---;
262

    
263
  MSC  <=  HLR  [label="Insert Subscriber Data Request"];
264
  MSC   => HLR  [label="Insert Subscriber Data Result"];
265
  HLR  box HLR  [label="Start Next_Pseudo_IMSI_Timer"];
266
  MSC  <=  HLR  [label="Update Location Result"];
267
  MSC  box MSC  [label="Finish Location Updating with ME"],
268

    
269
  HLR  box HLR  [label="Wait for Next_Pseudo_IMSI_Timer expiry"];
270
  |||;
271
  ...;
272
  |||;
273
  HLR  box HLR  [label="Next_Pseudo_IMSI_Timer expired"];
274

    
275
  HLR  box HLR  [label="\nAllocate new pseudonymous IMSI\nif subscriber has only one allocated\n"];
276
  SMSC <=  HLR  [label="Next Pseudonymous IMSI SMS"];
277
  SMSC box SMSC [label="Deliver SMS to ME"];
278
}
279
----
280

    
281
==== Update Location Request
282

    
283
When Update Location Request arrives, the HLR does not look up the subscriber
284
by the IMSI, but by the pseudonymous IMSI instead. Unless the subscriber has
285
two pseudonymous IMSI allocated and used the new pseudonymous IMSI in the
286
Update Location Request, this is followed by the existing logic to continue
287
with Insert Subscriber Data Request.
288

    
289
===== Update Location Request With New Pseudonymous IMSI
290

    
291
If the subscriber has two pseudonymous IMSIs allocated, and the newer entry was
292
used (higher imsi_pseudo_i, see <<hlr-imsi-pseudo-i>>), this section applies.
293
The older pseudonymous IMSI is deallocated in the HLR. This is done as early
294
as possible, so the timeframe where two pseudonymous IMSI are allocated for one
295
subscriber is short.
296

    
297
A Cancel Location Request with the old pseudonymous IMSI is sent to the VLR, so
298
the conflicting subscriber entry with the old pseudonymous IMSI is deleted from
299
the VLR. Receiving a Cancel Location Result is followed by the existing logic
300
to continue with Insert Subscriber Data Request.
301

    
302
===== Update Location Request With Old Pseudonymous IMSI
303

    
304
If the subscriber has two pseudonymous IMSIs allocated, and the older entry was
305
used (lower imsi_pseudo_i, see <<hlr-imsi-pseudo-i>>), the newer entry is _not_
306
deallocated. This could lock out the subscriber from the network if the SMS
307
with the new pseudonymous IMSI arrives with a delay.
308

    
309
==== Insert Subscriber Data Result
310

    
311
When Insert Subscriber Data Result arrives, a subscriber specific
312
Next_Pseudo_IMSI_Timer starts.
313

    
314
==== Next_Pseudo_IMSI_Timer Expires
315

    
316
If the subscriber has only one pseudonymous IMSI allocated, and the amount of
317
available IMSIs in the HLR is high enough, a second pseudonymous IMSI and
318
related imsi_pseudo_i gets allocated for the subscriber (as described in
319
<<hlr-imsi-pseudo-storage>>).
320

    
321
If the subscriber still has only one pseudonymous IMSI, because not enough
322
IMSIs were available in the HLR, the process is aborted here and no SMS with
323
a next pseudonymous IMSI is sent to the subscriber. The subscriber will get a
324
new pseudonymous IMSI during the next Location Updating Procedure, if the HLR
325
has enough IMSIs available at that point.
326

    
327
An SMS is sent to the SMS - Service Centre (SMS-SC) with the newer pseudonymous
328
IMSI (higher imsi_pseudo_i, see <<hlr-imsi-pseudo-i>>) and related
329
imsi_pseudo_i value.
330

    
331
[[sms-structure]]
332
==== Next Pseudonymous IMSI SMS Structure
333

    
334
.Next pseudonymous IMSI SMS structure
335
[packetdiag]
336
----
337
{
338
	colwidth = 32
339

    
340
	0-31:	 IMSI_PSEUDO_I
341
	32-63:   MIN_SLEEP_TIME
342
	64-119:  IMSI_PSEUDO
343
	120-127: PAD
344
}
345
----
346

    
347
// FIXME
348
IMPORTANT: This is a draft. The structure is likely to change after the
349
reference implementation phase.
350

    
351
IMSI_PSEUDO_I: 32 bits::
352
See <<hlr-imsi-pseudo-i>>.
353

    
354
MIN_SLEEP_TIME: 32 bits::
355
Amount of seconds, which the SIM applet should wait before changing to the new
356
pseudonymous IMSI. Since it is unclear when the SMS will arrive (ME might be
357
turned off), this is a minimum amount.
358

    
359
IMSI_PSEUDO: 60 bits::
360
Telephony Binary Coded Decimal (TBCD, 3GPP TS 29.002) version of the next
361
pseudonymous IMSI.
362

    
363
PAD: 8 bits::
364
Padding at the end, should be filled with 1111 as in the TBCD specification.
365

    
366
== Error Scenarios
367

    
368
=== Next Pseudonymous IMSI SMS is Lost
369

    
370
If the SMS with the next pseudonymous IMSI does not arrive, the SIM will start
371
the next Location Updating Procedure with the old pseudonymous IMSI. Because
372
the HLR has both the old and the new pseudonymous IMSI allocated at this point,
373
the subscriber is not locked out of the network.
374

    
375
=== Next Pseudonymous IMSI SMS Arrives Out of Order
376

    
377
The next pseudonymous IMSI SMS may arrive out of order. Either, because the
378
network is not able to deliver them in order, or even because an attacker would
379
perform a replay attack.
380

    
381
If the SMS arrives out of order, the imsi_pseudo_i counter will not be higher
382
than the value the SIM applet (<<sim-app>>) has stored. Therefore, the applet
383
will discard the message and the subscriber is not locked out of the network.
384

    
385
// === SMS Arrives Before Timer Expires
386
// FIXME: OS#4486
387

    
388
== Recommendations for Real-World Implementations
389

    
390
=== BCCH SI3: ATT = 0
391

    
392
When changing from one pseudonymous IMSI to the next, it is important that the
393
ME does not detach from the network. Otherwise it would be trivial for an
394
attacker to correlate the detach with the attach of the same ME with the next
395
pseudonymous IMSI.
396

    
397
This is controlled with the ATT flag in the SYSTEM INFORMATION TYPE 3 (SI3)
398
message on the Broadcast Control Channel (BCCH), see 3GPP TS 44.018 Section
399
10.5.2.11. It must be set to 0.
400

    
401
// FIXME: verify how it set with operators in germany (OS#4404)
402

    
403
=== End to End Encryption of SMS
404

    
405
When deploying the IMSI pseudonymization, the operator should make sure that
406
the next pseudonymous IMSI SMS (<<sms-structure>>) cannot be read or modified
407
by third parties. Otherwise, the next pseudonymous IMSI is leaked, and if the
408
pseudonymous IMSI in the SMS was changed, the SIM would be locked out of the
409
network.
410

    
411
The safest way to protect the next pseudonymous IMSI SMS is a layer of end to
412
end encryption from the HLR to the SIM.  The existing means for OTA SMS
413
security (3GPP TS 23.048) provide mechanisms for integrity protection,
414
confidentiality as well as replay protection and must be implemented when using
415
IMSI pseudonymization.
416

    
417
=== User-configurable Minimum Duration Between IMSI Changes
418

    
419
It may be desirable to let subscribers configure their minimum duration between
420
IMSI changes. This allows subscribers with a high privacy requirement to switch
421
their pseudonymous IMSI more often, and it allows the pseudonymous IMSI change
422
to happen less frequently if it is distracting to the subscriber.
423

    
424
How distracting the pseudonymous IMSI change is, depends on the ME. The
425
following examples were observed:
426

    
427
// FIXME: might need an update after SYS#4481
428

    
429
* A Samsung GT-I9100 Galaxy SII smartphone with Android 4.0.3 displays a
430
  message at the bottom of the screen for about 5 seconds, but the user
431
  interface remains usable.
432
* A Samsung GT-E1200 feature phone displays a waiting screen for 16 to 17
433
  seconds and is unusable during that time.
434

    
435
[[reference-src]]
436
== Reference Implementation with Source Code
437

    
438
A reference implementation for the SIM applet (<<sim-app>>) is available in
439
source code under the Apache-2.0 license at:
440

    
441
https://osmocom.org/projects/imsi-pseudo
442

    
443
The HLR modifications described in <<hlr-imsi-pseudo-storage>> and
444
<<process-update-location-hlr>> were implemented for reference in OsmoHLR from
445
the Osmocom project, licensed under AGPL-3.0. Information about the source code
446
and related branches for IMSI pseudonymization can be found at the above URL as
447
well.
(3-3/4)
Add picture from clipboard (Maximum size: 48.8 MB)