A Mach-O load command that instructs the system to load a specific dynamic library when the binary runs. It is commonly used for legitimate dependencies, but it can also be abused to inject additional code into an application at startup if the binary is modified and re-signed.
What LC_LOAD_DYLIB Does in a Mach-O Binary
LC_LOAD_DYLIB is a Mach-O load command, so the loader reads it as part of a binary’s startup instructions. It points the runtime to a dynamic library dependency that must be resolved before the program can execute normally.
In legitimate software, this is how executables share code with frameworks and libraries instead of embedding everything in one file. The command is part of the binary format itself, which means it shapes launch-time behavior rather than application logic after the process is already running.
Why It Matters for Binary Integrity
The security significance comes from the fact that load commands influence what code is trusted at startup. If an attacker can modify the binary and preserve or restore signatures, a changed LC_LOAD_DYLIB entry can redirect execution toward an unexpected library and alter the program’s behavior before the application’s own defenses have a chance to run.
This makes the load command relevant to software integrity, tamper resistance, and post-compromise persistence. For defenders, the important question is not just whether the binary runs, but whether it loads only the libraries it was intended to trust.
Apple’s hardened startup and code-signing model is built around the idea that the executable image and its trusted dependencies should remain bound together, so tampering with load commands is security-relevant even when the surrounding application source code is unchanged.
How It Differs From Other Load-Time Mechanisms
LC_LOAD_DYLIB is about dependency declaration, not direct execution by itself. It is one of several Mach-O load commands, but unlike metadata that only describes the binary, this command affects which external code is mapped into the process address space during launch.
That distinction matters because a library dependency is executable code, not passive data. A malicious or unexpected library can introduce functions, hooks, or side effects that change the security posture of the entire process, especially when the binary loads that library before higher-level application checks begin.
In practice, the impact depends on both the signed binary and the trustworthiness of the library path, library contents, and the integrity of the code-signing chain that permits them to load together.
Where Administrators and Reverse Engineers Look for Abuse
Investigators usually examine LC_LOAD_DYLIB when they are validating whether a binary’s dependencies are expected, signed, and aligned with the software supply chain. It is especially relevant when startup behavior changes after repackaging, when a binary is redistributed outside its original build pipeline, or when a library path points somewhere unusual.
Reverse engineers also use the command to understand how a Mach-O binary is assembled, because the load commands reveal how the application depends on frameworks and shared objects at runtime. That dependency map helps separate ordinary linking from suspicious startup-time code injection.
For defenders, the practical value is in comparing the declared load commands to the known-good build, then confirming that the loaded libraries and their signatures match the expected execution path.
Apple’s code signing and runtime integrity model is the broader context for why modified load commands are meaningful, because the operating system treats signed binaries and their trusted contents as a protected launch-time boundary.
Risk and Threat Considerations
LC_LOAD_DYLIB can be abused when an attacker gains the ability to alter a Mach-O binary, its embedded load commands, or the library resolution path. The risk is startup-time code injection, where a process loads attacker-controlled code before the application can establish its own trust decisions.
Failure mechanism: A malicious or replaced dynamic library is introduced through a modified load command, then executed as part of the program’s normal launch sequence.
Impact: The attacker can redirect execution, persist inside a trusted application, or undermine integrity in a way that is difficult to notice from the outside.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | SI-7 — Software, Firmware, and Information Integrity | LC_LOAD_DYLIB affects binary and dependency integrity at startup. |
| CM-5 — Access Restrictions for Change | Load-command tampering is a controlled change to executable behavior. | |
| Recommendation — Validate signed binaries and expected load commands before release and runtime execution. Restrict who can modify or repackage executables and their load commands. | ||
| CIS Controls v8 | CIS-2 — Inventory and Control of Software Assets | Declared dynamic-library dependencies should be inventoried and compared to known-good software assets. |
| Recommendation — Track approved binaries and dependency sets so altered load commands stand out quickly. | ||
Practitioner Guidance
What to watch for: Treat unexpected load-command changes as a binary integrity issue, not just a build artifact difference. A new or unusual LC_LOAD_DYLIB entry often deserves the same scrutiny as any other signed-code tamper signal, especially when the dependency was not part of the original release.
Governance implication: Keep the expected dependency set under change control so teams can distinguish a legitimate library update from a modified launch path. That makes it easier to review provenance, detect repackaging, and confirm that the binary still loads only the code it was meant to trust.
Related resources from NHI Mgmt Group
- How do teams reduce support load without weakening access control?
- How can security teams tell whether managed services are actually reducing operational load?
- How do you know whether query caching is actually reducing load?
- What breaks when project-local AI filters load automatically from a repository?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 30, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org