Detect Apple Multiple Products Buffer Overflow Exploitation (CVE-2025-31277) in Google Chronicle
Detects potential exploitation of CVE-2025-31277, a buffer overflow vulnerability (CWE-119) affecting multiple Apple products. This vulnerability is listed in CISA's Known Exploited Vulnerabilities catalog, indicating active exploitation in the wild. Successful exploitation may allow attackers to execute arbitrary code, escalate privileges, or cause denial of service on affected Apple devices and systems.
MITRE ATT&CK
YARA-L Detection Query
rule cve_2025_31277_apple_buffer_overflow {
meta:
author = "df00tech"
description = "Detects CVE-2025-31277 Apple buffer overflow exploitation via daemon crashes and shell spawning"
severity = "HIGH"
priority = "HIGH"
cve = "CVE-2025-31277"
mitre_attack = "T1203, T1068"
events:
(
$crash.metadata.event_type = "PROCESS_UNCAUGHT_EXCEPTION"
OR $crash.metadata.event_type = "PROCESS_TERMINATION"
)
AND $crash.principal.process.file.full_path = /\/(mdmclient|mobileassetd|softwareupdated|nsurlsessiond|trustd|accountsd|apsd|securityd|notifyd)$/
AND $crash.principal.asset.platform_software.platform = "APPLE_MAC"
$spawn.metadata.event_type = "PROCESS_LAUNCH"
AND $spawn.principal.process.file.full_path = /(sh|bash|zsh|python3|perl|osascript|ruby)$/
AND $spawn.principal.process.parent_process.file.full_path = /\/(mdmclient|mobileassetd|softwareupdated|nsurlsessiond|trustd|accountsd|apsd|securityd)$/
AND $spawn.principal.asset.platform_software.platform = "APPLE_MAC"
$crash.principal.hostname = $spawn.principal.hostname
match:
$crash.principal.hostname over 5m
condition:
$crash and $spawn
} Chronicle YARA-L rule detecting CVE-2025-31277 exploitation on Apple macOS by correlating system daemon crashes with subsequent shell spawning from the same host within a 5-minute window.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate macOS update sequences that restart system daemons and trigger validation scripts
- Authorized red team exercises targeting Apple endpoint vulnerabilities
- Enterprise MDM workflows that use daemon contexts to execute management actions
Other platforms for CVE-2025-31277
Testing Methodology
Validate this detection against 3 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.
- Test 1Simulate Apple System Daemon Crash with Non-Zero Exit
Expected signal: Process crash event for 'trustd' (or mock process) with SIGSEGV signal, non-zero exit code, and EXC_BAD_ACCESS exception type visible in /Library/Logs/DiagnosticReports/ and EDR crash telemetry
- Test 2Spawn Shell from Apple Daemon Context (Post-Exploitation Simulation)
Expected signal: ProcessCreate event showing bash spawning /tmp/daemon_spawn_test.sh, with subsequent child processes for whoami, uname, id, and ls commands — EDR should record full process ancestry and command lines
- Test 3Generate Crash Report Artifact for Apple Daemon
Expected signal: File creation event in ~/Library/Logs/DiagnosticReports/ for trustd crash file; log collection agents (Elastic Agent, CrowdStrike) should ingest the .crash file and surface EXC_BAD_ACCESS exception type in SIEM
Unlock Pro Content
Get the full detection package for CVE-2025-31277 including response playbook, investigation guide, and atomic red team tests.