You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 9. 5G NAS Registration Attacks: SUCI leaks, downgrade to EEA0/EIA0, and NAS replay
145
+
146
+
The 5G registration procedure runs over NAS (Non-Access Stratum) on top of NGAP. Until NAS security is activated by Security Mode Command/Complete, initial messages are unauthenticated and unencrypted. This pre-security window enables multiple attack paths when you can observe or tamper with N2 traffic (e.g., on-path inside the core, rogue gNB, or testbed).
147
+
148
+
Registration flow (simplified):
149
+
- Registration Request: UE sends SUCI (encrypted SUPI) and capabilities.
Expected: UE/USIM must transmit SUCI (SUPI encrypted with the home-network public key). Finding a plaintext SUPI/IMSI in the Registration Request indicates a privacy defect enabling persistent subscriber tracking.
164
+
165
+
How to test:
166
+
- Capture the first NAS message in InitialUEMessage and inspect the Mobile Identity IE.
167
+
- Wireshark quick checks:
168
+
- It should decode as SUCI, not IMSI.
169
+
- Filter examples: `nas-5gs.mobile_identity.suci || nas_5g.mobile_identity.suci` should exist; absence plus presence of `imsi` indicates leakage.
170
+
171
+
What to collect:
172
+
- MCC/MNC/MSIN if exposed; log per-UE and track across time/locations.
173
+
174
+
Mitigation:
175
+
- Enforce SUCI-only UEs/USIMs; alert on any IMSI/SUPI in initial NAS.
176
+
177
+
### 9.2 Capability bidding-down to null algorithms (EEA0/EIA0)
178
+
Background:
179
+
- UE advertises supported EEA (encryption) and EIA (integrity) in the UE Security Capability IE of the Registration Request.
180
+
- Common mappings: EEA1/EIA1 = SNOW3G, EEA2/EIA2 = AES, EEA3/EIA3 = ZUC; EEA0/EIA0 are null algorithms.
181
+
182
+
Issue:
183
+
- Because the Registration Request is not integrity protected, an on-path attacker can clear capability bits to coerce selection of EEA0/EIA0 later during Security Mode Command. Some stacks wrongly allow null algorithms outside emergency services.
184
+
185
+
Offensive steps:
186
+
- Intercept InitialUEMessage and modify the NAS UE Security Capability to advertise only EEA0/EIA0.
187
+
- With Sni5Gect, hook the NAS message and patch the capability bits before forwarding.
188
+
- Observe whether AMF accepts null ciphers/integrity and completes Security Mode with EEA0/EIA0.
189
+
190
+
Verification/visibility:
191
+
- In Wireshark, confirm selected algorithms after Security Mode Command/Complete.
192
+
- Example passive sniffer output:
193
+
```
194
+
Encyrption in use [EEA0]
195
+
Integrity in use [EIA0, EIA1, EIA2]
196
+
SUPI (MCC+MNC+MSIN) 9997000000001
197
+
```
198
+
199
+
Mitigations (must):
200
+
- Configure AMF/policy to reject EEA0/EIA0 except where strictly mandated (e.g., emergency calls).
201
+
- Prefer enforcing EEA2/EIA2 at minimum; log and alarm on any NAS security context that negotiates null algorithms.
202
+
203
+
### 9.3 Replay of initial Registration Request (pre-security NAS)
204
+
Because initial NAS lacks integrity and freshness, captured InitialUEMessage+Registration Request can be replayed to AMF.
205
+
206
+
PoC rule for 5GReplay to forward matching replays:
207
+
208
+
```xml
209
+
<beginning>
210
+
<propertyvalue="THEN"
211
+
property_id="101"
212
+
type_property="FORWARD"
213
+
description="Forward InitialUEMessage with Registration Request">
214
+
215
+
<!-- Trigger on NGAP InitialUEMessage (procedureCode == 15) -->
216
+
<eventvalue="COMPUTE"
217
+
event_id="1"
218
+
description="Trigger: InitialUEMessage"
219
+
boolean_expression="ngap.procedure_code == 15"/>
220
+
221
+
<!-- Context match on NAS Registration Request (message_type == 65) -->
222
+
<eventvalue="COMPUTE"
223
+
event_id="2"
224
+
description="Context: Registration Request"
225
+
boolean_expression="nas_5g.message_type == 65"/>
226
+
227
+
</property>
228
+
</beginning>
229
+
```
230
+
231
+
What to observe:
232
+
- Whether AMF accepts the replay and proceeds to Authentication; lack of freshness/context validation indicates exposure.
233
+
234
+
Mitigations:
235
+
- Enforce replay protection/context binding at AMF; rate-limit and correlate per-GNB/UE.
236
+
237
+
### 9.4 Tooling pointers (reproducible)
238
+
- Open5GS: spin up an AMF/SMF/UPF to emulate core; observe N2 (NGAP) and NAS.
239
+
- Wireshark: verify decodes of NGAP/NAS; apply the filters above to isolate Registration.
240
+
- 5GReplay: capture a registration, then replay specific NGAP + NAS messages as per the rule.
241
+
- Sni5Gect: live sniff/modify/inject NAS control-plane to coerce null algorithms or perturb authentication sequences.
0 commit comments