/

CVE-2025-66786

Severity:

HIGH RISK

(7.5)

Improper Input Validation in OpenAirInterface CN5G AMF SBI

CVE-2025-66786

Analyzed

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20

Impact:

Denial of Service

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

OpenAirInterface CN5G AMF versions up to and including v2.0.1 contain an improper input validation flaw when processing JSON-formatted requests on the SBI interface.

A remote, unauthorized attacker can send specially crafted JSON data that triggers a logical error in the AMF, potentially resulting in a denial-of-service condition for 5G core signaling.

Affected context

This vulnerability affects deployments of the OpenAirInterface CN5G Access and Mobility Management Function (AMF) that:

  • Expose the AMF's SBI (Service-Based Interface) endpoint to other network functions or potentially untrusted peers
  • Accept and parse JSON-formatted SBI requests
  • Do not enforce strict validation or schema checking on incoming JSON payloads before processing logic is applied

The issue is triggered at runtime during normal request handling, when malformed or malicious JSON data reaches the AMF's request-processing logic.

Exploit preconditions

  • Attack surface: Network-accessible AMF SBI interface (HTTP/JSON over the service-based architecture)
  • Required access: Ability to reach the AMF SBI endpoint over the control-plane network; no valid credentials are required according to the description
  • Trigger point: Submission of crafted JSON requests that exercise the logical error during parsing or business logic processing
  • Why exploitation is possible: The AMF trusts structural and semantic correctness of incoming JSON without robust validation, allowing malformed or adversarial data to reach code paths that cannot safely handle it, ultimately causing a denial-of-service condition

Why this happens

The underlying bug falls under CWE-20: Improper Input Validation. The AMF's SBI handler assumes that inbound JSON messages conform to expected shapes, types, and value ranges.

Instead of rigorously validating JSON against a schema or defensive parsing rules, the implementation appears to apply business logic directly to the parsed data. This creates a logical error path where unexpected or malformed JSON states are not gracefully handled, leading to resource exhaustion, crashes, or unstable AMF behavior when adversarial inputs are processed.

Potential impact

  • Disruption of AMF service availability due to process crashes or hangs
  • Temporary loss of mobility management and registration services in affected 5G core deployments
  • Interruption or degradation of user equipment (UE) attach, registration, and handover procedures
  • Potential cascading effects on other core network functions that rely on AMF responsiveness

General mitigation guidance

Effective mitigation focuses on tightening input validation and isolating the AMF from untrusted or malformed traffic:

  • Introduce strict JSON schema validation for all SBI endpoints, rejecting any request that does not conform before business logic is executed
  • Apply robust type checking, bounds checking, and presence checks for all critical fields parsed from JSON inputs
  • Implement defensive programming patterns in the request-processing path, ensuring that unexpected states are handled gracefully and cannot crash or stall the service
  • Use network segmentation and access control to ensure only trusted network functions can reach the AMF SBI interface
  • Employ rate-limiting and request-size limits at gateways or reverse proxies fronting the AMF to reduce the impact of abusive traffic patterns
  • Run the AMF with appropriate resource limits and supervision (e.g., process watchdogs) to support rapid recovery from failures without manual intervention

How teams detect issues like this

Detection typically combines traffic monitoring with code-level analysis:

  • Use static analysis or manual code review to identify request-handling paths that lack JSON schema validation, type checks, or error handling around parsing logic
  • Define secure coding guidelines for SBI handlers that mandate input validation layers separate from business logic, and review code for adherence
  • Monitor AMF logs for recurring parsing errors, malformed request traces, or abrupt termination messages associated with specific JSON patterns
  • Deploy network monitoring or WAF-like controls at the SBI boundary to flag or block anomalous JSON payloads, such as unexpected structures, extreme nesting, or oversized fields
  • Integrate automated security testing (e.g., fuzzing of JSON SBI endpoints) into CI/CD pipelines to surface crashes or hangs driven by malformed input

Sources

SourceLink
github.comgithub.com/swallele/Vulnerability/blob/main/Openairinterface/Dos/Json_Dos.md

Frequently asked

questions

Exploitability depends on network design. If the AMF's SBI interface is reachable from untrusted networks or peers, an attacker could potentially exploit it remotely. In well-segmented 5G cores, access may be restricted to internal or trusted network functions, reducing but not eliminating exposure if any NF is compromised.

According to the description, no authentication is required. The attacker only needs network-level access to the AMF SBI endpoint and the ability to send crafted JSON requests.

The most robust pattern is to introduce a dedicated validation layer that all SBI requests pass through, which validates JSON against explicit schemas and enforces strict type and range checks before invoking any AMF business logic. Additionally, error handling should ensure malformed data cannot crash or stall the service.

Preventive strategies include standardizing schema-based validation for all external interfaces, enforcing defensive parsing guidelines in coding standards, integrating static analysis and fuzz testing for protocol handlers, and regularly reviewing control-plane APIs for resilience against malformed or adversarial inputs.

Find out what's already
exploitable in your codebase.