/

CVE-2025-70123

Severity:

HIGH RISK

(7.5)

Improper Input Validation in free5GC UPF PFCP Association

CVE-2025-70123

Analyzed

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20

Impact:

Denial of Service and Control Plane Instability

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

free5GC v4.0.1 contains an improper input validation issue in the User Plane Function (UPF) when processing PFCP Association Setup Requests, allowing malformed control-plane messages to be accepted in violation of 3GPP TS 29.244.

A remote PFCP peer that sends a crafted Association Setup Request can leave the UPF in an inconsistent state, causing subsequent valid PFCP Session Establishment Requests to trigger cascading failures, degrade service, and disrupt the SMF–UPF connection.

Affected context

This vulnerability affects deployments using free5GC v4.0.1 where the UPF communicates with Session Management Functions (SMFs) or other PFCP-capable peers over the Packet Forwarding Control Protocol (PFCP).

It is relevant in environments where PFCP traffic can be influenced or generated by remote entities, such as multi-vendor 5G core networks, testbed environments, or less strictly segmented control-plane networks.

The issue arises specifically when the UPF processes PFCP Association Setup Requests that do not conform to 3GPP TS 29.244 but are still accepted and applied to internal state.

Exploit preconditions

  • Attack surface: PFCP control-plane interface exposed by the UPF (typically N4 or equivalent control interface).
  • Required access: Ability to send PFCP Association Setup Requests to the UPF, usually by controlling or impersonating a PFCP peer (e.g., an SMF) or having network-level access to the PFCP endpoint.
  • Trigger point: Sending a malformed PFCP Association Setup Request that violates TS 29.244 but is still accepted, followed by a valid PFCP Session Establishment Request.
  • Why exploitation is possible: The UPF fails to strictly validate PFCP Association messages for protocol compliance and updates its internal state despite malformed or inconsistent fields, leading to a state machine that cannot correctly handle subsequent valid PFCP sessions.

Why this happens

The root cause is improper input validation (CWE-20) in the PFCP message handling logic of the UPF.

Specifically, the PFCP Association Setup Request parser and associated state machine do not enforce all mandatory checks required by 3GPP TS 29.244, allowing malformed or non-compliant messages to be treated as valid.

As a result, the UPF transitions into an inconsistent or partially initialized association state, so when a fully compliant PFCP Session Establishment Request arrives, it interacts with this corrupted state and triggers a cascading failure affecting the SMF connection and service continuity.

At an abstract level, this reflects a stateful protocol implementation that trusts incoming control messages without complete structural and semantic validation, and without robust error handling or rollback when protocol invariants are violated.

Potential impact

  • Remote attackers may cause denial of service on the UPF by forcing it into a state where subsequent PFCP sessions fail.
  • The SMF–UPF control-plane relationship can be disrupted, leading to dropped or failed session establishments.
  • Active subscriber sessions may experience service degradation, such as loss of data connectivity or inability to set up new PDU sessions.
  • Control-plane instability can ripple into other 5G core components that depend on UPF availability and predictable behavior.
  • In multi-tenant or shared environments, one malicious or misbehaving PFCP peer could impact other tenants' traffic handled by the same UPF instance.

General mitigation guidance

Effective mitigation focuses on enforcing strict protocol validation and robust state management in PFCP handling:

  • Validate all incoming PFCP Association Setup Requests against 3GPP TS 29.244, including message structure, mandatory Information Elements (IEs), length fields, and semantic constraints, before updating internal state.
  • Design the PFCP state machine to reject and cleanly handle malformed or unexpected messages, including explicit error responses and rollback of any partial state changes.
  • Introduce defensive programming patterns around protocol handlers, such as sanity checks on state transitions, invariants, and timeouts, to avoid lingering inconsistent states.
  • Limit the trust boundary of the PFCP control-plane by isolating PFCP interfaces on protected network segments and only allowing known, authenticated PFCP peers to connect.
  • Apply least-privilege principles and resource limits (e.g., connection, session, and rate limits) so that abusive PFCP behavior cannot easily exhaust UPF resources.

How teams detect issues like this

Detection generally involves monitoring and analyzing both code and runtime behavior around PFCP handling:

  • Static analysis and code review:
  • Look for protocol parsers that lack comprehensive field and bounds checks for PFCP messages, especially Association Setup and Session Establishment handlers.
  • Review state machine logic for missing validation steps, unchecked transitions, and error paths that do not reset or quarantine inconsistent state.
  • Use automated analysis tools or custom rules to flag areas where protocol fields are trusted without validation against specification constraints.
  • Runtime monitoring and logging:
  • Enable detailed logging for PFCP Association and Session message handling, including reasons for rejection and state transitions.
  • Monitor for patterns such as malformed Association Setup Requests followed by internal errors on valid Session Establishment Requests.
  • Employ anomaly detection or SIEM rules that alert on repeated PFCP parsing errors, unexpected association churn, or sudden drops in successful session establishment.
  • Network-level inspection:
  • Use PFCP-aware probes or protocol analyzers to identify non-compliant PFCP messages and correlate them with UPF-side failures.
  • Apply network policies or firewalls capable of basic PFCP validation to block obviously malformed control-plane traffic before it reaches the UPF.

Sources

SourceLink
github.comgithub.com/free5gc/free5gc/issues/745

Frequently asked

questions

Exploitability is limited to entities that can send PFCP traffic to the UPF. In many production deployments, this interface is restricted to trusted core network components, but in lab, test, or misconfigured environments, it may be reachable by untrusted systems or malicious insiders.

Typically, PFCP itself does not use application-layer authentication, so exploitation hinges on network-level access and the ability to appear as or reach a PFCP peer. If the PFCP control-plane is not strictly isolated, an attacker with such reach can attempt to exploit the vulnerability without additional credentials.

The safest pattern is to implement strict, specification-driven validation for all PFCP messages, especially Association Setup, before mutating any internal UPF state. Combined with robust error handling and state rollback, this ensures that malformed messages are cleanly rejected without side effects.

Future prevention relies on building protocol implementations from clearly defined state machines and schema-validated parsers, adding comprehensive unit and interoperability tests for malformed and boundary-case messages, and enforcing security-focused code reviews around control-plane parsers and state management logic.

Find out what's already
exploitable in your codebase.