← Book home
Part 2 · Authentication and Access Security
9

AS, RRC, and User-Plane Security

Where the keys finally meet the bits — and 5G’s headline upgrade

“4G encrypted your data but never checked whether someone changed it in flight. That single omission was exploited. 5G’s answer has a name: user-plane integrity.” — THE POINT OF THIS CHAPTER

Access Stratum (AS) security is the protection between the UE and the gNB — the radio link itself. It runs in the PDCP layer and covers both signaling (RRC) and user data. This chapter walks the AS Security Mode Command, the RRC and user-plane ciphering and integrity, and 5G’s defining radio-security upgrade: user-plane integrity protection, the fix for the aLTEr class of attacks.

🎯 Learning objectives
📘 Standards reference box — Chapter 9
SpecificationTitleRelease / version verified
TS 33.5015G security — AS security & UP security policy (clause 6.5, 6.6)Rel-18, v18.11.0 (2026-04)
TS 38.331NR RRC — security mode, RRC protectionRel-18/19 edition
TS 38.323NR PDCP — ciphering & integrity executionRel-18/19 edition

Checked June 2026 — verify against the latest 3GPP version. Full-rate UP integrity is Rel-16+; confirm RAN capability.

9.1 The Access-Stratum Model — Security in PDCP

AS security protects the Uu interface. Both RRC signaling and user data are secured in the PDCP layer using the AS keys derived from KgNB (Chapter 7). RRC gets ciphering and integrity; user data gets ciphering and — new in 5G — optional integrity. Everything terminates at the gNB; the keys live there, which is why the gNB’s physical and platform security matters (Chapter 15).

FIGURE 9.1AS Security in the NR Stack — It All Happens in PDCP
RRC (signaling) · SDAP→user datacontrol + user traffic both descend into PDCP PDCP — the AS security layer 🔒 ciphering (NEA) · integrity (NIA) · COUNT (HFN+SN) · reordering · duplicate detection keys: K_RRCenc/int (signaling) · K_UPenc/int (user data) RLC → MAC → PHY (radio) terminates at gNB AS keys live in the gNB → site security matters (Chapter 15) vs NAS (Ch 8) NAS = UE↔AMF AS = UE↔gNB two independent layers
Purpose: where radio security executes. PDCP is the single layer that ciphers and integrity-protects everything on the air — both your RRC commands and your data packets.

9.2 The AS Security Mode Command

After NAS security and the delivery of KgNB, the gNB activates radio protection with its own AS Security Mode Command over RRC — selecting the AS algorithms and switching on RRC protection. Like NAS, the first message is integrity-protected so the UE can trust the algorithm choice before ciphering fully engages.

FIGURE 9.2The AS Security Mode Command Procedure
UE gNB context: K_gNB delivered by AMF over N2 → AS keys derivable ① AS Security Mode Command (selected AS NEA + NIA) ↑ integrity-protected with K_RRCint ② UE verifies RRC MAC-I, derives AS keys, starts RRC protection ③ AS Security Mode Complete (ciphered + integrity-protected) ④ RRC now protected → DRBs set up per UP security policy (§9.4)
Purpose: the radio counterpart of the NAS SMC. RRC integrity starts first (so the algorithm choice is trustworthy), then full RRC ciphering, then data bearers are established under the UP security policy.
FIGURE 9.3SRB vs DRB — What Gets Which Protection
bearer ciphering integrity SRB (RRC signaling)always (per algorithm)ALWAYS — mandatory DRB (user data)per UP security policyper UP security policy ← NEW in 5G THE KEY DIFFERENCE FROM 4G LTE never had a user-plane integrity key. In 5G, DRB integrity is a real, policy-controlled option (K_UPint) — the aLTEr fix (§9.5)
Purpose: the protection matrix you must know cold. Signaling integrity is mandatory; the headline change is that data integrity is now possible at all.

9.3 RRC Ciphering and Integrity

FIGURE 9.4RRC Protection — Ciphering and Integrity in PDCP
RRC ciphering NEA(K_RRCenc,COUNT,BEARER,DIR) keystream ⊕ RRC hides the RRC message content (measurement config, mobility, bearer setup…) eavesdropper can’t read your RRC RRC integrity (mandatory) NIA(K_RRCint,COUNT,BEARER,DIR) MAC-I appended every RRC message carries a MAC-I receiver verifies → reject if altered attacker can’t forge/modify RRC commands
Purpose: RRC is the gNB’s command channel to the UE — so it gets both confidentiality and mandatory integrity. A forged RRC reconfiguration could move a UE or change its security; integrity stops it.
FIGURE 9.5The PDCP COUNT — HFN + SN
HFN (hyper frame number) PDCP SN COUNT = HFN ∥ SN → feeds NEA & NIA as freshness SN wraps → HFN increments (no reuse) if COUNT ever repeats with the same key/bearer/direction, the stream cipher breaks — refresh K_gNB before exhaustion (Chapter 7)
Purpose: the AS freshness counter. The HFN extends the short on-air SN so the effective COUNT space is huge — but not infinite, which is why long-lived bearers need re-keying.

9.4 User-Plane Ciphering and Integrity

User data on a DRB is ciphered in PDCP with KUPenc exactly like RRC. The new dimension is user-plane integrity with KUPint: each data PDU can carry a MAC-I, so the network (and UE) reject modified user packets. Whether it’s on is decided by the UP security policy.

FIGURE 9.6User-Plane Protection — Ciphering Always, Integrity by Policy
UP ciphering (K_UPenc) data ⊕ keystream — confidentiality prevents reading your traffic present since LTE ✓ confidentiality UP integrity (K_UPint) — NEW each DRB PDU can carry a MAC-I prevents MODIFYING your traffic enabled by UP security policy (§9.7) ✓ the aLTEr fix (§9.5)
Purpose: the two halves of user-plane protection. Confidentiality is the old guarantee; integrity is the new one — and the one attackers had learned to exploit in its absence.

9.5 Why UP Integrity Matters: the aLTEr Attack

In LTE, user data was encrypted but not integrity-protected. Stream ciphers are malleable: flip a bit in the ciphertext and you flip the same bit in the plaintext. Researchers’ aLTEr attack used this to alter encrypted DNS requests, silently redirecting a victim to a malicious server — without ever breaking the encryption. 5G’s user-plane integrity makes any such modification fail the MAC check.

FIGURE 9.7The aLTEr Attack — and How UP Integrity Stops It
LTE — no UP integrity UE network attacker sits in the middle (relay) encrypted DNS request: “go to bank.com” bit-flip ciphertext → flips plaintext no integrity → no MAC to fail DNS now resolves to attacker’s server victim redirected — encryption never broken ✗ undetectable to the victim 5G — UP integrity on UE network same bit-flip on the ciphertext… …but each PDU carries a MAC-I (K_UPint) modified PDU → MAC verification FAILS PDU discarded — redirection prevented attack visible as integrity-failure counter ✓ tampering detected and dropped
Purpose: the concrete attack that justifies an entire new key. Encryption hides content but doesn’t protect integrity — and for control-carrying traffic like DNS, integrity is what actually matters.

9.6 The UP Security Policy

Who decides whether a DRB gets integrity (and ciphering)? The SMF, per PDU session, sends a UP security policy to the gNB with two parameters — confidentiality and integrity — each set to required, preferred, or not needed. The gNB enforces it when setting up the DRB, and informs the UE.

FIGURE 9.8UP Security Policy — SMF Decides, gNB Enforces
SMF derives policy from subscription · DNN · slice per PDU session UP security policy gNB enforces per DRB confidentiality: req/pref/not-needed integrity: req/pref/not-needed checks its own capability UE told via RRC which protection applies REQUIRED must be on; if gNB can’t, the PDU session is rejected strongest guarantee PREFERRED on if the gNB supports it, silently off otherwise ⚠ may end up OFF — verify! NOT NEEDED protection not applied (e.g. legacy throughput cases) justify every use
Purpose: the policy that determines whether the aLTEr fix is actually active. “Preferred” is the trap — it can silently resolve to “off” on a RAN that lacks the capability, leaving you no integrity and no error.
FIGURE 9.9UP Integrity at Line Rate — the Rel-16 Upgrade
Rel-15 UP integrity rate-LIMITED (e.g. ~64 kbps) Rel-16+ FULL data-rate UP integrity audit implication: a Rel-15 RAN may be physically unable to integrity-protect a high-throughput DRB → “required” could be unachievable. Confirm RAN release before mandating it.
Purpose: why the release matters operationally. Early 5G could only integrity-protect low-rate data; mandating full-rate UP integrity requires a Rel-16+ capable RAN.
FIGURE 9.10The Bearer-Level Security Decision Tree
DRB to set up integrity = required?(from UP security policy) required preferred / not-needed gNB supports it? YES → integrity ON, MAC-I per PDU NO → REJECT the PDU session (required means required) preferred? ON if supported, else silently OFF not-needed? OFF — no integrity applied
Purpose: exactly what happens per bearer. “Required” fails closed (reject); “preferred” fails open (silently off) — which is why security-critical slices must use “required,” not “preferred.”
FIGURE 9.11gNB Security Requirements Map
gNB holds K_gNB + AS keys secure key storagekeys not extractable secure boot + signed SWtrusted code only secure environmentAS crypto in protected exec protected interfacesF1/E1/Xn/N2/N3 (Ch 14/15) the gNB is exposed (towers, street sites) yet holds live keys → physical + platform security is part of AS security (Ch 15)
Purpose: AS security isn’t just algorithms — it assumes the gNB protects its keys. A physically compromised gNB undermines the strongest cipher.
FIGURE 9.12What an Attacker Sees on the Air
AS security ON RRC content: encrypted (NEA) user data: encrypted + (policy) integrity visible: only timing, volume, some L1/L2 headers eavesdropper gets metadata, not content AS security OFF / NEA0 RRC + data: readable (no integrity) modifiable in flight visible: everything full content exposure + aLTEr-class tampering
Purpose: the difference AS security makes, from the attacker’s seat. Even with perfect ciphering, traffic-analysis metadata remains — a reminder that confidentiality ≠ full privacy (Chapter 19).
FIGURE 9.13End-to-End — an App Packet Through the Security Layers
app dataplaintext SDAPQoS→DRB PDCPcipher + MAC-I🔒 here RLC MAC PHY over the air →gNB reverses it security is applied at exactly ONE layer (PDCP) on the way down, and verified/removed at PDCP on the way up — clean, single-point protection
Purpose: follow a byte from the app to the antenna. Security lives at one well-defined layer — PDCP — which is why “where is it encrypted?” always has the same answer on the radio.
FIGURE 9.14AS and NAS — Two Independent Shields
NAS security (Ch 8) UE ↔ AMF · keys from K_AMF protects signaling intentions survives a compromised gNB relay end-to-end to the core AS security (this chapter) UE ↔ gNB · keys from K_gNB protects the radio link (RRC + data) includes UP integrity (the aLTEr fix) hop to the base station
Purpose: keep the two layers distinct. They use different keys, cover different spans, and a UE needs both — NAS for its conversation with the core, AS for its link to the gNB.
FIGURE 9.15Choosing UP Integrity by Service — an Operator Map
IoT / URLLC / control small packets, high stakes tampering = safety/operational risk integrity = REQUIRED rate is low → no throughput issue enterprise / slice (Ch 20) contractually security-sensitive don’t inherit eMBB defaults! integrity = REQUIRED (verify RAN) needs Rel-16+ full-rate mass-market eMBB very high throughput historical rate concerns integrity = preferred/not-needed ⚠ revisit as RAN matures
Purpose: a practical policy guide. The classic mistake (Chapter 1’s example) is copying the eMBB “not needed” default into an enterprise or IoT slice where integrity is exactly the point.

9.7 The Practical Operator View

Common misconfiguration risks

9.8 Threats and Mitigations

ThreatVectorDefense
User-plane modification (aLTEr)bit-flip encrypted dataUP integrity (K_UPint), policy = required
RRC command forgeryinject/alter RRCmandatory RRC integrity (K_RRCint)
Radio eavesdroppingpassive captureRRC + UP ciphering (NEA)
Keystream reuseCOUNT exhaustionHFN+SN COUNT, K_gNB refresh
Silent integrity bypass“preferred” on weak RANuse “required”; verify RAN capability
Key extraction at sitephysical gNB compromisesecure storage, secure boot (Ch 15)

9.9 Terminology, Example, Checklist

TermMeaning
ASAccess Stratum — UE↔gNB radio-link protection
PDCPThe layer where AS ciphering and integrity execute
SRB / DRBSignaling radio bearer (RRC) / data radio bearer (user data)
K_RRCenc/int, K_UPenc/intRRC and user-plane ciphering/integrity keys (from K_gNB)
UP security policySMF-set per-session confidentiality/integrity = required/preferred/not-needed
aLTErThe LTE attack exploiting absent user-plane integrity

Real network example. An industrial customer’s private-5G slice (Chapter 21) carried PLC control traffic. During acceptance testing, the integrator captured DRB setup and found UP integrity resolving to “off” despite the slice template saying “preferred.” The gNB model on site was an early Rel-15 unit that could only integrity-protect at a low rate, so “preferred” silently dropped it for the higher-rate control bearer. For a factory where a tampered command could move a robot arm, “off” was unacceptable. Fix: set the slice’s UP integrity to required (forcing the issue) and upgrade the affected cells to Rel-16-capable units; sessions on non-capable cells were then correctly rejected rather than silently unprotected. “Required” turned a silent gap into a visible, fixable error.

Chapter Summary

? Review Questions

  1. In which layer does AS security execute, and what two key pairs does it use?
  2. Why is RRC integrity mandatory while user-plane integrity is policy-controlled?
  3. Explain the aLTEr attack and exactly how user-plane integrity defeats it.
  4. Contrast “required,” “preferred,” and “not needed” — which fails open, which fails closed, and why does it matter?
  5. Why might mandating full-rate UP integrity fail on a Rel-15 RAN, and what is the correct response?
  6. How does the PDCP COUNT (HFN+SN) prevent keystream reuse, and what triggers the need to refresh K_gNB?
  7. A private-5G control slice shows UP integrity “off” despite a “preferred” template. Diagnose and fix it.
  8. Distinguish AS and NAS security: spans, keys, and why a UE needs both.
🧪 Mini lab — see UP integrity decide

With Open5GS + UERANSIM: (1) Set the SMF UP security policy for a DNN to integrity = preferred and bring up a PDU session; capture the RRC/DRB setup and note whether integrity was actually applied. (2) Change the policy to required; if your UERANSIM gNB advertises the capability, confirm integrity is now on; if not, confirm the session is rejected rather than silently unprotected — the “fails closed” behavior. (3) Force AS ciphering to NEA0 and capture: see RRC and data become readable. (4) Restore NEA2 and integrity = required. You have now demonstrated, in packets, both 5G’s headline upgrade and the exact policy setting that makes it real.