CVE-2025-66786
Executive Summary
CVE-2025-66786 is a denial-of-service (DoS) vulnerability in the OpenAirInterface (OAI) CN5G Access and Mobility Management Function (AMF) component, version 2.0.1 and earlier. The flaw resides in the Service-Based Interface (SBI) when processing JSON-formatted requests. An unauthenticated, remote attacker can send specially crafted malicious JSON data to the AMF's SBI interface, causing a logical error that leads to a denial-of-service condition. This can disrupt 5G core network operations, impacting subscriber mobility management and network availability.
This vulnerability is particularly critical for 5G network operators and testbeds using OAI, as it can be exploited without authentication and from a remote network position. The lack of a publicly available patch or exploit code increases the risk for unmonitored deployments.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the OpenAirInterface CN5G software, which is distributed as open-source code. Organizations using OAI in their 5G core network must verify their AMF version and apply any available updates or mitigations immediately. The absence of a patch means that supply chain security relies on manual code review and network segmentation.
CVSS Breakdown & Threat Level
CVSS Score: 0.0 (No official vector assigned) Threat Level: High (based on impact and exploitability)
Rationale:
- Attack Vector (AV): Network – The SBI interface is network-accessible.
- Attack Complexity (AC): Low – Sending crafted JSON requires minimal skill.
- Privileges Required (PR): None – No authentication needed.
- User Interaction (UI): None – No user action required.
- Scope (S): Unchanged – The vulnerability affects only the AMF.
- Confidentiality (C): None – No data exposure.
- Integrity (I): None – No data modification.
- Availability (A): High – The AMF becomes unavailable, disrupting 5G core services.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Deep Dive & Mechanics
The OpenAirInterface CN5G AMF implements a Service-Based Interface (SBI) that uses JSON for request/response serialization. The vulnerability is a logical error in the JSON parsing logic. When the AMF receives a malformed or specially crafted JSON payload, the parser enters an unexpected state, causing the AMF process to crash or hang.
Root Cause Analysis: The issue likely stems from improper validation of JSON structure or data types. For example, if the parser expects a specific key-value pair but receives a nested object or an array with unexpected depth, it may fail to handle the exception gracefully. This can lead to a null pointer dereference, infinite loop, or memory exhaustion.
Attack Vector:
- The attacker identifies the AMF's SBI endpoint (typically port 80/443 or a custom port).
- The attacker sends a POST request with a malicious JSON payload to the SBI interface.
- The AMF's JSON parser processes the payload, triggering the logical error.
- The AMF process crashes or becomes unresponsive, causing a denial of service.
Impact:
- Loss of AMF functionality, preventing UE registration, mobility management, and session establishment.
- Cascading failures in other 5G core components (e.g., SMF, UPF) that depend on AMF.
- Network downtime for all subscribers served by the affected AMF.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common fixes for JSON parsing issues.
Vulnerable Code (Conceptual):
# Vulnerable JSON parsing logic
def handle_sbi_request(json_data):
# No validation of JSON structure
amf_id = json_data["amfId"]
# Process request...
Patched Code (Conceptual):
# Patched JSON parsing logic with input validation
def handle_sbi_request(json_data):
# Validate JSON structure
if not isinstance(json_data, dict):
return error_response("Invalid JSON format")
if "amfId" not in json_data:
return error_response("Missing required field")
amf_id = json_data["amfId"]
# Process request...
The patch would involve adding input validation, type checking, and exception handling to prevent the parser from entering an undefined state.
Exploitation & Lab Setup
Red Team
Lab Environment:
- OpenAirInterface CN5G AMF v2.0.1 running in a Docker container or VM.
- Attacker machine with Python and
requestslibrary.
Exploitation Steps:
- Identify the AMF SBI endpoint (e.g.,
http://<AMF_IP>:8080/nsmf-pdusession/v1/sm-contexts). - Craft a malicious JSON payload that triggers the logical error. Example payloads:
- Deeply nested JSON:
{"a": {"b": {"c": {"d": ...}}}} - JSON with unexpected data types:
{"amfId": null, "plmnList": "invalid"} - JSON with extremely long strings:
{"amfId": "A" * 100000}
- Deeply nested JSON:
- Send the payload using a Python script:
import requests import json url = "http://<AMF_IP>:8080/nsmf-pdusession/v1/sm-contexts" payload = {"amfId": None, "plmnList": "invalid"} headers = {"Content-Type": "application/json"} response = requests.post(url, data=json.dumps(payload), headers=headers) print(response.status_code) - Monitor the AMF service. If successful, the AMF will crash or become unresponsive.
Expected Outcome: The AMF process terminates or enters an infinite loop, causing a denial of service.
Blue Team
Detection and Response:
- Monitor AMF logs for unusual error messages related to JSON parsing (e.g.,
JSONDecodeError,KeyError,TypeError). - Implement rate limiting on the SBI interface to reduce the impact of repeated malicious requests.
- Use a Web Application Firewall (WAF) to filter malformed JSON payloads.
- Deploy an Intrusion Detection System (IDS) with custom rules to detect anomalous JSON structures.
Mitigation Steps:
- Isolate the AMF behind a firewall and restrict access to trusted networks only.
- Apply input validation at the network edge (e.g., reverse proxy) to reject malformed JSON before it reaches the AMF.
- Monitor for crashes and implement auto-restart mechanisms (e.g., systemd
Restart=always). - Upgrade to a patched version once available.
Indicators of Compromise (IOCs)
Network IOCs:
- Unusual POST requests to the AMF SBI endpoint with malformed JSON payloads.
- High volume of HTTP 500 errors from the AMF.
- Repeated connection attempts from a single IP address.
System IOCs:
- AMF process crashes (core dumps, segmentation faults).
- AMF service logs containing JSON parsing errors.
- High CPU or memory usage on the AMF host.
File IOCs:
- Temporary files created by the AMF during crash (e.g.,
/tmp/amf_crash_*.log).
- Temporary files created by the AMF during crash (e.g.,
Detection Engineering
YARA Rule
rule CVE_2025_66786_JSON_DoS {
meta:
description = "Detects malicious JSON payloads targeting OpenAirInterface AMF SBI"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-66786"
strings:
$json1 = /{"[^"]+":\s*null/ nocase
$json2 = /{"[^"]+":\s*"A{100,}/ nocase
$json3 = /{.*{.*{.*{.*{/ nocase
condition:
any of them
}
Sigma Rule
title: CVE-2025-66786 - Malicious JSON to OpenAirInterface AMF SBI
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects POST requests with malformed JSON to AMF SBI endpoint
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/nsmf-pdusession/v1/sm-contexts'
sc-status: 500
condition: selection
falsepositives:
- Legitimate malformed requests from developers
level: high
Suricata Rule
alert http $EXTERNAL_NET any -> $HOME_NET $HTTP_PORTS (msg:"CVE-2025-66786 - Malicious JSON to OpenAirInterface AMF SBI"; flow:to_server,established; content:"POST"; http_method; content:"/nsmf-pdusession/v1/sm-contexts"; http_uri; pcre:"/{"[^"]+":\s*null/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Restrict network access to the AMF SBI interface using firewall rules. Only allow trusted IPs.
- Implement input validation at the reverse proxy or API gateway level to reject malformed JSON.
- Enable AMF process monitoring and auto-restart to minimize downtime.
Long-term Fix:
- Apply the official patch once released by OpenAirInterface.
- Upgrade to a version where the JSON parsing logic is hardened.
- Conduct code review of the SBI handler to ensure proper exception handling.
Workaround:
- If patching is not possible, consider disabling the SBI interface or replacing it with a more robust implementation.
Valters IT Signature: This report was generated by Valters IT DevSecOps AI Assistant. For questions, contact security@valters-it.com.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.