blob: 0e32d475bdcefc2f2fc7c0faf54b20b548f61127 [file] [log] [blame]
Harald Welte9d63d6f2020-04-11 10:18:34 +02001= Specification for IMSI Pseudonymization on the Radio Interface for 2G/3G/4G
Oliver Smith5c95bc92020-04-03 14:03:24 +02002
3== Introduction
4
Oliver Smithbf33c752020-04-06 15:46:29 +02005=== Protecting the IMSI on the Radio Interface is Desirable
6
Harald Welte9db94bb2020-04-16 10:36:19 +02007A long-standing issue in the 3GPP specifications for cellular mobile
8communications starting from 2G (GSM) is, that mobile phones and
Oliver Smith5c95bc92020-04-03 14:03:24 +02009other mobile equipment (ME) have to send the International Mobile Subscriber
Harald Welte9db94bb2020-04-16 10:36:19 +020010Identity (IMSI) unencrypted over the air. Each IMSI is a unique identifier for
11the subscriber. Therefore, most people can be uniquely identified by recording
12the IMSI that their ME is sending.
Oliver Smith5c95bc92020-04-03 14:03:24 +020013
Harald Welte9db94bb2020-04-16 10:36:19 +020014The 3GPP specifications provide means for implementations to send the
15IMSI less often by using the Temporary Mobile Subscriber Identity (TMSI)
16where possible. However, the decision on when to use IMSI or TMSI is
17entirely on the networks side, without any control by the ME or even the
18subscriber.
19
20This leads to a variety of attacks on subscriber location privacy, including
21the use of passive air-interface sniffing as well as false base station
22attacks, where an attacker impersonates a base station which
23subsequently inquires every ME about its IMSI.
24
25Some related devices have been termed _IMSI catchers_ or _Stingray_ in
26both scientific literature as well as mainstream media. IMSI catchers have
27become small and affordable during the last decade; criminals actors
28and in some cases even tabloid journalists without much budget have
29reportedly used them to track anybody with a mobile phone.
Oliver Smith5c95bc92020-04-03 14:03:24 +020030
Oliver Smithefe5c982020-04-15 10:29:21 +0200315G addresses this problem with the Subscriber Concealed Identifier (SUCI),
32which uses public-key cryptography to ensure that the permanent subscriber
Harald Welte9db94bb2020-04-16 10:36:19 +020033identity (IMSI) is not transmitted over the air interface anymore.
34Rather, a concealed version of it is transmitted (3GPP TS 33.501,
Harald Welte29a79af2020-04-16 12:23:34 +020035Section 6.12.2). The 5G SUCI mechanism can not be adapted easily for previous
36generations of cellular networks as it relies on introducing an entirely
37new mobile identity type of larger size (SUCI) than any of the existing
38ones (e.g. IMSI), causing significant implications on protocol stacks
39and implementations all across the protocol stack of all network elements,
40including the ME.
Harald Welte9db94bb2020-04-16 10:36:19 +020041
42No mechanism for increasing subscriber identity and location privacy on
43the radio interface has been specified for the previous cellular
44technologies 2G (GSM), 3G (UMTS) and 4G (LTE). Meanwhile, pure 5G
45networks are and will remain rare for many years to come, as operators
46have to support billions of deployed legacy pre-5G ME. Operating
47combined 5G + previous technology networks enables the so-called
48"downgrade attacks" where the attacker blocks access to 5G e.g. by means
49of jamming/interference, and hence triggers the ME to use a previous
50generation which is still susceptible to the attacks.
51
52This specification proposes a different approach to conceal the
53IMSI for legacy 2G, 3G and 4G networks.
Oliver Smithefe5c982020-04-15 10:29:21 +020054
Oliver Smithbf33c752020-04-06 15:46:29 +020055=== Summary of Proposed Solution
56
Oliver Smith5c95bc92020-04-03 14:03:24 +020057The solution presented in this document is to periodically change the IMSI of
58the ME to a new pseudonymous IMSI allocated by the Home Location Register (HLR)
Harald Welte9db94bb2020-04-16 10:36:19 +020059or Home Subscriber Service (HSS). The next pseudonymous IMSI is sent to the SIM/USIM
Oliver Smithbf33c752020-04-06 15:46:29 +020060via Short Message Service (SMS), then a SIM applet overwrites the IMSI of the
Harald Welte9db94bb2020-04-16 10:36:19 +020061SIM/USIM with the new value. The only components in the network that need to be
62changed in order to support this mechanism are the SIM/USIM and the
63HLR/HSS. All other elements (like BTS, NodeB, eNodeB, BSC, RNC, MME,
64MSC/VLR, SGSN, GGSN, S-GW, P-GW, ...) remain as-is, without any changes
65to their specification or implementation.
66
67Constraining the required changes to only two elements in the network
68enables quick adoption potential for the proposed mechanism.
Harald Welte9db94bb2020-04-16 10:36:19 +020069Furthermore, as SIM/USIM and HLR/HSS are the only two elements under control
70of a Mobile Virtual Network Operator (MVNO), this mechanism can be
71deployed by a MVNO without any changes to the operators of the physical
72infrastructure (MNO).
Oliver Smith5c95bc92020-04-03 14:03:24 +020073
Oliver Smith968dd352020-04-16 11:34:01 +020074<<<
Oliver Smithbf33c752020-04-06 15:46:29 +020075=== Summary of Existing Location Updating Procedures in RAN and CN
Oliver Smith5c95bc92020-04-03 14:03:24 +020076
Harald Welte9db94bb2020-04-16 10:36:19 +020077Every subscriber's SIM/USIM is provisioned with the IMSI and secret
78cryptographic keys (Ki or K+OP[c]). The same IMSI and key data is also provisioned
79into the HLR/HSS, the central subscriber database of a cellular network.
80
81In a number of different situations, the IMSI is sent over the air
82interface and back-haul towards the Core Network (CN), where it is
83validated by the HLR/HSS. The involved components vary by the generation
84of the network and whether the SIM/USIM is attempting a Circuit Switched (CS)
85or Packet Switched (PS) connection, but the principle is the same. This
86document uses 2G CS Location Updating for reference, as in
87<<figure-imsi-regular>>.
Oliver Smith7afd7012020-04-06 11:59:59 +020088
89The IMSI is transmitted in the Location Updating Request from ME. The VLR
Harald Welte9db94bb2020-04-16 10:36:19 +020090needs an authentication challenge specific to the secret keys on the SIM/USIM to
91authenticate the SIM/USIM, and looks the authentication challenges up by the IMSI.
Oliver Smith7afd7012020-04-06 11:59:59 +020092If the VLR does not have any more authentication challenges for the IMSI (as it
93happens when the VLR sees the IMSI for the first time), the VLR requests new
Harald Welte9db94bb2020-04-16 10:36:19 +020094authentication challenges from the HLR/HSS. Then the HLR/HSS verifies that the IMSI is
Oliver Smith7afd7012020-04-06 11:59:59 +020095known and, if it is unknown, sends back an error that will terminate the
96Location Updating procedure.
97
Harald Welte9db94bb2020-04-16 10:36:19 +020098After the VLR found the authentication challenge, it authenticates the SIM/USIM, and
Oliver Smith7afd7012020-04-06 11:59:59 +020099performs a Classmark Enquiry and Physical Channel Reconfiguration. Then the VLR
100has the required information to finish the Location Updating, and continues
Oliver Smith206a0fa2020-04-07 14:30:07 +0200101with Process Update_Location_HLR (3GPP TS 29.002). Afterwards, the VLR assigns
102a new TMSI with the Location Updating Accept, which is acknowledged by the TMSI
103Reallocation Complete. In following Location Updates with the same MSC, the ME
104sends the TMSI instead of the IMSI in the Location Updating Request.
Oliver Smith7afd7012020-04-06 11:59:59 +0200105
Harald Welte9db94bb2020-04-16 10:36:19 +0200106However, the allocation of the TMSI is optional (the network may choose
107to not perform it), and particularly at mobility changes across the
108MSC/VLR boundary, or even across the PLMN boundary, the TMSI allocated
109by the previouis network element may not be known, and an IMSI based
Oliver Smithe87abdf2020-04-16 11:18:20 +0200110Location Updating procedure is used.
Harald Welte9db94bb2020-04-16 10:36:19 +0200111
112Furthermore, at any given point in time, a legitimate network or a rogue
113base station can inquire the IMSI from the ME using the "MM IDENTITY
114REQUEST (IMSI)" command.
115
Oliver Smith7afd7012020-04-06 11:59:59 +0200116[[figure-imsi-regular]]
117.Location Updating in 2G CS with IMSI
118["mscgen"]
119----
120msc {
121 hscale="1.75";
122 ME [label="ME"], BTS [label="BTS"], BSC [label="BSC"], MSC [label="MSC/VLR"],
123 HLR [label="HLR"];
124
125 // BTS <=> BSC: RSL
126 // BSC <=> MSC: BSSAP, RNSAP
127 // MSC <=> HLR: MAP (process Update_Location_HLR, 3GPP TS 29.002)
128
129 ME => BTS [label="Location Updating Request"];
130 BTS => BSC [label="Location Updating Request"];
131 BSC => MSC [label="Location Updating Request"];
132
Oliver Smith7e33ef52020-04-07 15:05:11 +0200133 --- [label="If necessary: VLR requests new authentication challenges for this IMSI"];
Oliver Smith7afd7012020-04-06 11:59:59 +0200134 MSC => HLR [label="Send Auth Info Request"];
135 MSC <= HLR [label="Send Auth Info Result"];
136 ---;
137
138 BSC <= MSC [label="Authentication Request"];
139 BTS <= BSC [label="Authentication Request"];
140 ME <= BTS [label="Authentication Request"];
141 ME => BTS [label="Authentication Response"];
142 BTS => BSC [label="Authentication Response"];
143 BSC => MSC [label="Authentication Response"];
Oliver Smith7afd7012020-04-06 11:59:59 +0200144
Oliver Smith206a0fa2020-04-07 14:30:07 +0200145 --- [label="Process Update_Location_HLR (3GPP TS 29.002)"];
Oliver Smith7afd7012020-04-06 11:59:59 +0200146 MSC => HLR [label="Update Location Request"];
147 MSC <= HLR [label="Insert Subscriber Data Request"];
148 MSC => HLR [label="Insert Subscriber Data Result"];
149 MSC <= HLR [label="Update Location Result"];
Oliver Smith206a0fa2020-04-07 14:30:07 +0200150 ---;
Oliver Smith7afd7012020-04-06 11:59:59 +0200151
152 BSC <= MSC [label="Location Updating Accept"];
153 BTS <= BSC [label="Location Updating Accept"];
154 ME <= BTS [label="Location Updating Accept"];
155 ME => BTS [label="TMSI Reallocation Complete"];
156 BTS => BSC [label="TMSI Reallocation Complete"];
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200157 BSC => MSC [label="TMSI Reallocation Complete"];
Oliver Smith7afd7012020-04-06 11:59:59 +0200158}
159----
160
Oliver Smithbf33c752020-04-06 15:46:29 +0200161<<<
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200162== Required Changes
Oliver Smith6f9f2182020-04-06 14:29:34 +0200163
Harald Welte9db94bb2020-04-16 10:36:19 +0200164This section covers the changes / enhancements required
165compared to the existing 3GPP specifications.
Oliver Smithbf33c752020-04-06 15:46:29 +0200166
Harald Welte9db94bb2020-04-16 10:36:19 +0200167[[hlr-imsi-pseudo-storage]]
168=== Pseudonymous IMSI Storage in the HLR/HSS
169
170The HLR/HSS must store up to two pseudonymous IMSIs (`imsi_pseudo`) and
171their related counters (`imsi_pseudo_i`) per subscriber. Each subscriber
172initially has one pseudonymous IMSI allocated. A subscriber has two
173valid pseudonymous IMSIs only during the transition phase from the old
174pseudonymous IMSI to the new one.
175
176Subsequently, the amount of available IMSIs must be higher than the
177amount of subscribers registered with the HLR/HSS. If the amount of
178available IMSIs is too small, the HLR/HSS could delay assigning new
179pseudonymous IMSIs until new IMSIs are available again.
Oliver Smithbf33c752020-04-06 15:46:29 +0200180
181.Examples for additional subscriber data in HLR
Oliver Smith69e3fa62020-04-09 14:54:49 +0200182[options="header"]
Oliver Smithbf33c752020-04-06 15:46:29 +0200183|===
184| Subscriber ID | imsi_pseudo | imsi_pseudo_i
185// example IMSIs taken from Wikipedia
186| 123
187| 310150123456789
188| 1
189
190| 234
191| 502130123456789
192| 1
193
194| 234
195| 460001357924680
196| 2
197|===
198
199==== imsi_pseudo
200
Harald Welte9db94bb2020-04-16 10:36:19 +0200201The value for `imsi_pseudo` is a random choice from the pool of available
202IMSIs that the HLR/HSS controls. The pseudonymous IMSI must not be used
203by any subscriber as pseudonymous IMSI yet, but may be the real IMSI of
204a subscriber.
Oliver Smithbf33c752020-04-06 15:46:29 +0200205
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200206[[hlr-imsi-pseudo-i]]
Oliver Smithbf33c752020-04-06 15:46:29 +0200207==== imsi_pseudo_i
208
Harald Welte9db94bb2020-04-16 10:36:19 +0200209The counter `imsi_pseudo_i` indicates how often a subscribers pseudonymous IMSI
Oliver Smith8c81b552020-04-07 08:44:56 +0200210was changed. The value is 1 for the first allocated pseudonymous IMSI of a
211subscriber. When allocating a new pseudonymous IMSI for the same subscriber,
Harald Welte9db94bb2020-04-16 10:36:19 +0200212the new `imsi_pseudo_i` value is increased by 1. The counter is used by the SIM/USIM
Oliver Smithbf33c752020-04-06 15:46:29 +0200213applet to detect and ignore outdated requests related to changing the
214pseudonymous IMSI.
215
Oliver Smith968dd352020-04-16 11:34:01 +0200216<<<
Harald Welte9db94bb2020-04-16 10:36:19 +0200217=== SIM/USIM Provisioning
Oliver Smith6f9f2182020-04-06 14:29:34 +0200218
Harald Welte9db94bb2020-04-16 10:36:19 +0200219IMSI pseudonymization as specified by this document works with
Oliver Smithe87abdf2020-04-16 11:18:20 +0200220traditional SIM (used in 2G), as well as with USIM (used from 3G
Harald Welte9db94bb2020-04-16 10:36:19 +0200221onwards).
222
223The initial IMSI provisioned in the SIM/USIM is provisioned as the initial
224pseudonymous IMSI in the HLR/HSS.
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200225
Oliver Smith5de45c02020-04-08 14:37:58 +0200226[[sim-app]]
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200227==== SIM applet
228
Harald Welte9db94bb2020-04-16 10:36:19 +0200229SIM/USIM have long supported the installation and operation of
230additional applets on the card itself. The programming language and
231runtime environment for such applets is an implementation detail.
232However, the industry has converged around JavaCards with related
233additional APIs specific to SIM, UICC and USIM. Depending on the card
234profile / provisioning, it is possible for such applets to access the
235card file system and modify files on the card, such as the file storing
236the IMSI.
237
238A SIM/USIM compatible with this specification is provisioned with a SIM
239applet, which is able to change the IMSI once the next pseudonymous IMSI
240arrives from the HLR/HSS. A reference implementation is provided in
241<<reference-src>>.
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200242
Oliver Smith69e3fa62020-04-09 14:54:49 +0200243===== Counter Storage
244
245The following counter variables are stored in the SIM applet.
246
247[options="header",cols="20%,12%,68%"]
248|===
249| Name | Initial value | Description
250
251| imsi_pseudo_i
252| 1
253| See <<hlr-imsi-pseudo-i>>.
254
255| imsi_pseudo_lu
256| 0
257| Amount of Location Updating procedures done with the same pseudonymous IMSI.
258
259| imsi_pseudo_lu_max
260| (decided by operator)
261| Maximum amount of Location Updating procedures done with the same
262 pseudonymous IMSI, before the SIM applet shows a warning to the subscriber.
263|===
264
265===== Switch to Next Pseudonymous IMSI
266
Harald Welte37981b62020-04-11 10:19:21 +0200267The SIM applet registers to a suitable SMS trigger (3GPP TS 43.019, Section
Harald Welte9db94bb2020-04-16 10:36:19 +02002686.2). When an SMS from the HLR/HSS in the structure of <<sms-structure>> arrives,
269the applet must verify that the SMS is not outdated by comparing `imsi_pseudo_i`
270from the SMS with the last `imsi_pseudo_i` that was used when changing the IMSI
Oliver Smith04ff01e2020-05-08 08:54:27 +0200271(initially 1 as in <<hlr-imsi-pseudo-i>>). The new value must be higher. The
272SIM applet must also verify, that the pseudonymous IMSI arriving in the SMS is
273different from the currently active IMSI. If any of the checks fail, the SMS
274must not be processed further.
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200275
Oliver Smithe87abdf2020-04-16 11:18:20 +0200276The SIM applet registers a timer with `min_sleep_time` from the SMS. When the
Harald Welte9db94bb2020-04-16 10:36:19 +0200277timer triggers, EF~IMSI~ of the SIM/USIM is overwritten with the new pseudonymous
Oliver Smithb80a9f82020-04-15 11:46:36 +0200278IMSI. The TMSI and related data (EF~LOCI~, EF~PSLOCI~) and ciphering keys
279(EF~Kc~, EF~KcGPRS~, EF~Keys~, EF~KeysPS~) are invalidated (see 3GPP TS
Harald Welte9db94bb2020-04-16 10:36:19 +020028031.102). The current `imsi_pseudo_i` from the SMS is stored in the
281SIM applet to compare it with the next SMS. `imsi_pseudo_lu` is reset to 0. Afterwards,
Oliver Smith69e3fa62020-04-09 14:54:49 +0200282the EF~IMSI~ changing procedure in 3GPP TS 11.14, Section 6.4.7.1 is executed
283to apply the new IMSI.
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200284
285// FIXME: do we need to enforce the LU now, with an arbitrary CM Service
286// Request, or would this only be necessary for Osmocom? (OS#4404)
Oliver Smith69e3fa62020-04-09 14:54:49 +0200287
Oliver Smith5e998f12020-05-11 08:39:27 +0200288The SIM must start a Location Updating Request after changing the pseudonymous
289IMSI, so the CN does not try to contact the ME with the previous pseudonymous
290IMSI. The SIM applet must wait before switching the pseudonymous IMSI, because
291otherwise it would be possible for an attacker to correlate the arrival time of
292the SMS with the time of the following Location Updating Request.
293
Oliver Smith69e3fa62020-04-09 14:54:49 +0200294===== Warning the Subscriber If the Pseudonymous IMSI Does Not Change
295
296An attacker could potentially block the next pseudonymous IMSI SMS on purpose.
297Because the SIM applet cannot decide the next pseudonymous IMSI, it would have
298the same pseudonymous IMSI for a long time. Then it could become feasible for
299an attacker to track the subscriber by their pseudonymous IMSI. Therefore the
Oliver Smith4d3277f2020-05-08 09:42:11 +0200300SIM applet must warn the subscriber if the pseudonymous IMSI does not change.
Oliver Smith69e3fa62020-04-09 14:54:49 +0200301
302The SIM applet registers to EVENT_EVENT_DOWNLOAD_LOCATION_STATUS (3GPP TS
Harald Welte9db94bb2020-04-16 10:36:19 +020030303.19, Section 6.2) and increases `imsi_pseudo_lu` by 1 when the event is
304triggered. If `imsi_pseudo_lu` reaches `imsi_pseudo_lu_max`, the SIM applet
Oliver Smith69e3fa62020-04-09 14:54:49 +0200305displays a warning to the subscriber.
306
Oliver Smith968dd352020-04-16 11:34:01 +0200307<<<
Oliver Smithbb8d9122020-04-08 14:58:50 +0200308[[process-update-location-hlr]]
Oliver Smith206a0fa2020-04-07 14:30:07 +0200309=== Process Update_Location_HLR
Oliver Smithbf33c752020-04-06 15:46:29 +0200310
Oliver Smith206a0fa2020-04-07 14:30:07 +0200311All IMSI Pseudonymization related changes to Process Update_Location_HLR
Oliver Smith64d154c2020-04-08 08:36:18 +0200312(3GPP TS 29.002) are optional. Deviations from the existing specification that
313are outlined in this section are expected to be enabled or disabled entirely
314where IMSI pseudonymization is implemented.
Oliver Smith206a0fa2020-04-07 14:30:07 +0200315
Oliver Smithef43ac32020-04-07 16:02:19 +0200316[[figure-imsi-pseudo]]
Oliver Smith206a0fa2020-04-07 14:30:07 +0200317.Process Update_Location_HLR with IMSI pseudonymization changes
318["mscgen"]
319----
320msc {
321 hscale="1.75";
322 MSC [label="MSC/VLR"], SMSC [label="SMS-SC"], HLR [label="HLR"];
323
324 MSC => HLR [label="Update Location Request"];
Oliver Smith7e33ef52020-04-07 15:05:11 +0200325
326 --- [label="If new pseudonymous IMSI was used: deallocate and cancel old pseudonymous IMSI"];
Oliver Smith64d154c2020-04-08 08:36:18 +0200327 HLR box HLR [label="Deallocate old pseudonymous IMSI"];
Oliver Smith7e33ef52020-04-07 15:05:11 +0200328 MSC <= HLR [label="Cancel Location Request"];
329 MSC => HLR [label="Cancel Location Result"];
330 ---;
331
Oliver Smith206a0fa2020-04-07 14:30:07 +0200332 MSC <= HLR [label="Insert Subscriber Data Request"];
333 MSC => HLR [label="Insert Subscriber Data Result"];
Oliver Smith64d154c2020-04-08 08:36:18 +0200334 HLR box HLR [label="Start Next_Pseudo_IMSI_Timer"];
Oliver Smith206a0fa2020-04-07 14:30:07 +0200335 MSC <= HLR [label="Update Location Result"];
Oliver Smith64d154c2020-04-08 08:36:18 +0200336 MSC box MSC [label="Finish Location Updating with ME"],
Oliver Smith206a0fa2020-04-07 14:30:07 +0200337
Oliver Smith64d154c2020-04-08 08:36:18 +0200338 HLR box HLR [label="Wait for Next_Pseudo_IMSI_Timer expiry"];
Oliver Smith206a0fa2020-04-07 14:30:07 +0200339 |||;
340 ...;
341 |||;
Oliver Smith64d154c2020-04-08 08:36:18 +0200342 HLR box HLR [label="Next_Pseudo_IMSI_Timer expired"];
Oliver Smith7e33ef52020-04-07 15:05:11 +0200343
Oliver Smith64d154c2020-04-08 08:36:18 +0200344 HLR box HLR [label="\nAllocate new pseudonymous IMSI\nif subscriber has only one allocated\n"];
Oliver Smith206a0fa2020-04-07 14:30:07 +0200345 SMSC <= HLR [label="Next Pseudonymous IMSI SMS"];
346 SMSC box SMSC [label="Deliver SMS to ME"];
347}
348----
Oliver Smith7afd7012020-04-06 11:59:59 +0200349
Oliver Smithef43ac32020-04-07 16:02:19 +0200350==== Update Location Request
Oliver Smith64d154c2020-04-08 08:36:18 +0200351
Harald Welte9db94bb2020-04-16 10:36:19 +0200352When Update Location Request arrives, the HLR/HSS does not look up the subscriber
Oliver Smithe9b57f52020-05-11 08:20:24 +0200353by the IMSI, but by the pseudonymous IMSI instead. If the subscriber has two
354pseudonymous IMSI allocated and used the new pseudonymous IMSI in the Update
355Location Request, <<ul-new-pseudo-imsi>> applies. Otherwise, the HLR continues
356with the existing Insert Subscriber Data Request logic.
Oliver Smithef43ac32020-04-07 16:02:19 +0200357
Oliver Smithe9b57f52020-05-11 08:20:24 +0200358[[ul-new-pseudo-imsi]]
Oliver Smithef43ac32020-04-07 16:02:19 +0200359===== Update Location Request With New Pseudonymous IMSI
360
361If the subscriber has two pseudonymous IMSIs allocated, and the newer entry was
Harald Welte9db94bb2020-04-16 10:36:19 +0200362used (higher `imsi_pseudo_i`, see <<hlr-imsi-pseudo-i>>), this section applies.
363The older pseudonymous IMSI is deallocated in the HLR/HSS. This is done as early
Oliver Smithef43ac32020-04-07 16:02:19 +0200364as possible, so the timeframe where two pseudonymous IMSI are allocated for one
365subscriber is short.
366
367A Cancel Location Request with the old pseudonymous IMSI is sent to the VLR, so
368the conflicting subscriber entry with the old pseudonymous IMSI is deleted from
369the VLR. Receiving a Cancel Location Result is followed by the existing logic
370to continue with Insert Subscriber Data Request.
371
372===== Update Location Request With Old Pseudonymous IMSI
373
374If the subscriber has two pseudonymous IMSIs allocated, and the older entry was
Harald Welte9db94bb2020-04-16 10:36:19 +0200375used (lower `imsi_pseudo_i`, see <<hlr-imsi-pseudo-i>>), the newer entry is _not_
Oliver Smithef43ac32020-04-07 16:02:19 +0200376deallocated. This could lock out the subscriber from the network if the SMS
377with the new pseudonymous IMSI arrives with a delay.
378
379==== Insert Subscriber Data Result
380
Oliver Smith64d154c2020-04-08 08:36:18 +0200381When Insert Subscriber Data Result arrives, a subscriber specific
382Next_Pseudo_IMSI_Timer starts.
Oliver Smithef43ac32020-04-07 16:02:19 +0200383
Oliver Smithfcf78112020-05-08 09:35:34 +0200384[[next-pseudo-imsi-timer-expires]]
Oliver Smithef43ac32020-04-07 16:02:19 +0200385==== Next_Pseudo_IMSI_Timer Expires
386
Oliver Smith64d154c2020-04-08 08:36:18 +0200387If the subscriber has only one pseudonymous IMSI allocated, and the amount of
Harald Welte9db94bb2020-04-16 10:36:19 +0200388available IMSIs in the HLR/HSS is high enough, a second pseudonymous IMSI and
389related `imsi_pseudo_i` gets allocated for the subscriber (as described in
Oliver Smith64d154c2020-04-08 08:36:18 +0200390<<hlr-imsi-pseudo-storage>>).
391
392If the subscriber still has only one pseudonymous IMSI, because not enough
Harald Welte9db94bb2020-04-16 10:36:19 +0200393IMSIs were available in the HLR/HSS, the process is aborted here and no SMS with
Oliver Smith64d154c2020-04-08 08:36:18 +0200394a next pseudonymous IMSI is sent to the subscriber. The subscriber will get a
Harald Welte9db94bb2020-04-16 10:36:19 +0200395new pseudonymous IMSI during the next Location Updating Procedure, if
396the HLR/HSS has enough IMSIs available at that point.
Oliver Smith64d154c2020-04-08 08:36:18 +0200397
398An SMS is sent to the SMS - Service Centre (SMS-SC) with the newer pseudonymous
Harald Welte9db94bb2020-04-16 10:36:19 +0200399IMSI (higher `imsi_pseudo_i`, see <<hlr-imsi-pseudo-i>>) and related
400`imsi_pseudo_i` value.
Oliver Smithef43ac32020-04-07 16:02:19 +0200401
Oliver Smith7b0dbb92020-04-08 10:33:52 +0200402[[sms-structure]]
403==== Next Pseudonymous IMSI SMS Structure
Oliver Smithef43ac32020-04-07 16:02:19 +0200404
Oliver Smith7b0dbb92020-04-08 10:33:52 +0200405.Next pseudonymous IMSI SMS structure
406[packetdiag]
407----
408{
409 colwidth = 32
410
411 0-31: IMSI_PSEUDO_I
412 32-63: MIN_SLEEP_TIME
413 64-119: IMSI_PSEUDO
414 120-127: PAD
415}
416----
417
Oliver Smitha0354de2020-04-09 15:13:38 +0200418// FIXME
419IMPORTANT: This is a draft. The structure is likely to change after the
420reference implementation phase.
421
Oliver Smith7b0dbb92020-04-08 10:33:52 +0200422IMSI_PSEUDO_I: 32 bits::
423See <<hlr-imsi-pseudo-i>>.
424
425MIN_SLEEP_TIME: 32 bits::
Oliver Smith4d3277f2020-05-08 09:42:11 +0200426Amount of seconds, which the SIM applet must wait before changing to the new
Oliver Smith7b0dbb92020-04-08 10:33:52 +0200427pseudonymous IMSI. Since it is unclear when the SMS will arrive (ME might be
428turned off), this is a minimum amount.
429
430IMSI_PSEUDO: 60 bits::
431Telephony Binary Coded Decimal (TBCD, 3GPP TS 29.002) version of the next
432pseudonymous IMSI.
433
434PAD: 8 bits::
Oliver Smith4d3277f2020-05-08 09:42:11 +0200435Padding at the end, must be filled with 1111 as in the TBCD specification.
Oliver Smithef43ac32020-04-07 16:02:19 +0200436
Oliver Smith968dd352020-04-16 11:34:01 +0200437<<<
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200438== Error Scenarios
Oliver Smith5de45c02020-04-08 14:37:58 +0200439
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200440=== Next Pseudonymous IMSI SMS is Lost
Oliver Smith5de45c02020-04-08 14:37:58 +0200441
Harald Welte9db94bb2020-04-16 10:36:19 +0200442If the SMS with the next pseudonymous IMSI does not arrive, the SIM/USIM will start
Oliver Smith5de45c02020-04-08 14:37:58 +0200443the next Location Updating Procedure with the old pseudonymous IMSI. Because
Harald Welte9db94bb2020-04-16 10:36:19 +0200444the HLR/HSS has both the old and the new pseudonymous IMSI allocated at this point,
Oliver Smith6aa67e32020-05-11 08:45:26 +0200445the subscriber is not locked out of the network. The HLR/HSS sends the same next
446pseudonymous IMSI again (<<next-pseudo-imsi-timer-expires>>).
Oliver Smith5de45c02020-04-08 14:37:58 +0200447
Oliver Smitha2814642020-04-14 14:31:29 +0200448=== Next Pseudonymous IMSI SMS Arrives Out of Order
Oliver Smith5de45c02020-04-08 14:37:58 +0200449
450The next pseudonymous IMSI SMS may arrive out of order. Either, because the
451network is not able to deliver them in order, or even because an attacker would
452perform a replay attack.
453
Harald Welte9db94bb2020-04-16 10:36:19 +0200454If the SMS arrives out of order, the `imsi_pseudo_i` counter will not be higher
Oliver Smith5de45c02020-04-08 14:37:58 +0200455than the value the SIM applet (<<sim-app>>) has stored. Therefore, the applet
456will discard the message and the subscriber is not locked out of the network.
Oliver Smith7afd7012020-04-06 11:59:59 +0200457
Oliver Smith8b68e4e2020-04-07 09:38:49 +0200458// === SMS Arrives Before Timer Expires
459// FIXME: OS#4486
460
Oliver Smith968dd352020-04-16 11:34:01 +0200461<<<
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200462== Recommendations for Real-World Implementations
Oliver Smithcbe90582020-04-08 15:38:29 +0200463
Oliver Smith18bf9bb2020-04-08 15:26:59 +0200464=== BCCH SI3: ATT = 0
Oliver Smithcbe90582020-04-08 15:38:29 +0200465
Oliver Smith18bf9bb2020-04-08 15:26:59 +0200466When changing from one pseudonymous IMSI to the next, it is important that the
467ME does not detach from the network. Otherwise it would be trivial for an
468attacker to correlate the detach with the attach of the same ME with the next
469pseudonymous IMSI.
470
471This is controlled with the ATT flag in the SYSTEM INFORMATION TYPE 3 (SI3)
472message on the Broadcast Control Channel (BCCH), see 3GPP TS 44.018 Section
47310.5.2.11. It must be set to 0.
474
475// FIXME: verify how it set with operators in germany (OS#4404)
476
Oliver Smith5c95bc92020-04-03 14:03:24 +0200477=== End to End Encryption of SMS
Oliver Smithcbe90582020-04-08 15:38:29 +0200478
Oliver Smith4d3277f2020-05-08 09:42:11 +0200479When deploying the IMSI pseudonymization, the operator must make sure that
Oliver Smithcbe90582020-04-08 15:38:29 +0200480the next pseudonymous IMSI SMS (<<sms-structure>>) cannot be read or modified
481by third parties. Otherwise, the next pseudonymous IMSI is leaked, and if the
Harald Welte9db94bb2020-04-16 10:36:19 +0200482pseudonymous IMSI in the SMS was changed, the SIM/USIM would be locked out of the
Oliver Smithcbe90582020-04-08 15:38:29 +0200483network.
484
485The safest way to protect the next pseudonymous IMSI SMS is a layer of end to
Harald Welte9db94bb2020-04-16 10:36:19 +0200486end encryption from the HLR/HSS to the SIM/USIM. The existing means for OTA SMS
Oliver Smitha2814642020-04-14 14:31:29 +0200487security (3GPP TS 23.048) provide mechanisms for integrity protection,
488confidentiality as well as replay protection and must be implemented when using
489IMSI pseudonymization.
Oliver Smithcbe90582020-04-08 15:38:29 +0200490
Oliver Smith5c95bc92020-04-03 14:03:24 +0200491=== User-configurable Minimum Duration Between IMSI Changes
Oliver Smith2c8a19c2020-04-06 14:04:13 +0200492
Oliver Smitha0354de2020-04-09 15:13:38 +0200493It may be desirable to let subscribers configure their minimum duration between
494IMSI changes. This allows subscribers with a high privacy requirement to switch
495their pseudonymous IMSI more often, and it allows the pseudonymous IMSI change
496to happen less frequently if it is distracting to the subscriber.
497
498How distracting the pseudonymous IMSI change is, depends on the ME. The
499following examples were observed:
500
501// FIXME: might need an update after SYS#4481
502
503* A Samsung GT-I9100 Galaxy SII smartphone with Android 4.0.3 displays a
504 message at the bottom of the screen for about 5 seconds, but the user
505 interface remains usable.
506* A Samsung GT-E1200 feature phone displays a waiting screen for 16 to 17
507 seconds and is unusable during that time.
508
Oliver Smith968dd352020-04-16 11:34:01 +0200509<<<
Oliver Smith0feaa892020-04-09 15:15:29 +0200510[[reference-src]]
511== Reference Implementation with Source Code
512
513A reference implementation for the SIM applet (<<sim-app>>) is available in
514source code under the Apache-2.0 license at:
515
516https://osmocom.org/projects/imsi-pseudo
517
Harald Welte9db94bb2020-04-16 10:36:19 +0200518The HLR/HSS modifications described in <<hlr-imsi-pseudo-storage>> and
Oliver Smith0feaa892020-04-09 15:15:29 +0200519<<process-update-location-hlr>> were implemented for reference in OsmoHLR from
520the Osmocom project, licensed under AGPL-3.0. Information about the source code
521and related branches for IMSI pseudonymization can be found at the above URL as
522well.