Detection Library
highexperimentalmacOSEndpointT1574.006T1055

DYLD_INSERT_LIBRARIES Dynamic Library Injection

Detects processes launched with the DYLD_INSERT_LIBRARIES environment variable set to a non-standard path, a long-standing macOS code injection technique used to hook into trusted, often signed, processes.

Updated Oct 29, 2026 · Detection Engineering Team

macosdylib-hijackinjectiondefense-evasion

Problem Statement

DYLD_INSERT_LIBRARIES remains a reliable injection technique against any process that hasn't opted into the hardened runtime, letting malware execute inside the address space of a trusted, often network-connected application to blend outbound traffic and evade process-based allowlisting.

Sample Logs

{"event":"process.exec","timestamp":"2026-10-29T15:20:33Z","host":"MACBOOK-C3","user":"rlee","image":"/Applications/Slack.app/Contents/MacOS/Slack","environment_variables":"DYLD_INSERT_LIBRARIES=/private/tmp/.cache/libhook.dylib","parent_image":"/bin/zsh"}

Required Fields

process.image / Image
process.env_vars / EnvironmentVariables
process.parent.image / ParentImage
user.name
host.name

False Positives

  • ·Developer profiling/debugging workflows (Xcode Instruments)
  • ·Some legitimate EDR/AV products inject their own monitoring dylibs

Tuning Guidance

Allowlist known EDR/AV self-protection dylib paths explicitly (by code-signature, not just path). Prioritize alerts where the injected dylib path is in a world-writable or hidden directory (dotfile directories, /tmp, /private/tmp).