CVE-2025-62221 Microsoft Sentinel · KQL

Detect CVE-2025-62221 Microsoft Windows Use After Free Exploitation in Microsoft Sentinel

Detects exploitation attempts of CVE-2025-62221, a use-after-free vulnerability in Microsoft Windows. This class of memory corruption flaw allows attackers to execute arbitrary code by manipulating freed memory objects. As a CISA KEV entry, active exploitation in the wild has been confirmed. Detection focuses on anomalous process behavior, kernel-mode memory corruption indicators, crash telemetry, and privilege escalation patterns consistent with UAF exploitation chains.

MITRE ATT&CK

Tactic
Privilege Escalation Execution

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let timeframe = 24h;
let suspiciousProcesses = dynamic(["lsass.exe", "csrss.exe", "winlogon.exe", "services.exe", "svchost.exe"]);
union
(
    SecurityEvent
    | where TimeGenerated >= ago(timeframe)
    | where EventID in (4688, 4689)
    | where NewProcessName has_any ("exploit", "shellcode") or
            (ParentProcessName in~ (suspiciousProcesses) and NewProcessName !in~ (suspiciousProcesses))
    | project TimeGenerated, Computer, Account, NewProcessName, ParentProcessName, CommandLine, EventID
),
(
    DeviceEvents
    | where TimeGenerated >= ago(timeframe)
    | where ActionType in ("ExploitGuardNetworkProtectionAudited", "ExploitGuardNetworkProtectionBlocked", "MemoryAllocationViolation", "UnexpectedKernelWriteAttempt")
    | project TimeGenerated, DeviceName, ActionType, InitiatingProcessFileName, InitiatingProcessCommandLine, AdditionalFields
),
(
    DeviceProcessEvents
    | where TimeGenerated >= ago(timeframe)
    | where InitiatingProcessIntegrityLevel == "High" and AccountName != "SYSTEM"
    | where ProcessVersionInfoOriginalFileName in~ (suspiciousProcesses) or
            (InitiatingProcessParentFileName in~ (suspiciousProcesses) and InitiatingProcessFileName !in~ (suspiciousProcesses))
    | project TimeGenerated, DeviceName, AccountName, FileName, InitiatingProcessFileName, InitiatingProcessCommandLine
)
| extend CVE = "CVE-2025-62221"
| sort by TimeGenerated desc
critical severity medium confidence

Detects process anomalies, memory violation events, and privilege escalation patterns consistent with CVE-2025-62221 Windows use-after-free exploitation using Defender for Endpoint and Security Event logs.

Data Sources

Microsoft Defender for EndpointWindows Security EventsAzure Monitor

Required Tables

SecurityEventDeviceEventsDeviceProcessEvents

False Positives & Tuning

  • Legitimate software installers or update agents spawning child processes from system parents
  • Security scanning tools or EDR agents performing memory inspection may trigger memory violation events
  • Administrative scripts running under elevated context that spawn unusual child processes
  • Crash dump collection utilities accessing process memory post-crash

Other platforms for CVE-2025-62221


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Simulate UAF-style anomalous child process from lsass.exe parent (lab only)

    Expected signal: Sysmon Event ID 1 with ParentImage pointing to lsass.exe and Image of cmd.exe; Windows Security EventID 4688 with anomalous parent-child relationship

  2. Test 2WER crash trigger on system process to simulate pre-exploit crash artifacts

    Expected signal: Windows Event ID 1000 (Application Error) and 1001 (Windows Error Reporting) in Application event log; WER report created in %LOCALAPPDATA%\Microsoft\Windows\WER\ReportQueue

  3. Test 3Elevated token process launch from spoofed system parent context

    Expected signal: Sysmon Event ID 1 showing cmd.exe with IntegrityLevel=System spawned by psexec service; Windows Security EventID 4688 with elevated token; EventID 4672 (special privileges assigned to new logon)

  4. Test 4Heap spray pattern simulation via PowerShell memory allocation

    Expected signal: PowerShell Script Block Logging (EventID 4104) capturing the allocation loop; potential AMSI or Defender behavioral alert on large sequential memory allocation patterns

Unlock Pro Content

Get the full detection package for CVE-2025-62221 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections