# DLL search-order sideloading

Signed binary loading a bare-name DLL from its own or a writable directory

_Area: Memory corruption and native code. Seen in 3 disclosed reports; latest 2026-05-07. Updated 2026-12-05._

## How it works

Windows resolves a library loaded by bare name (no full path) through a search order that includes the directory of the loading executable. A signed binary that calls `LoadLibrary("foo.dll")` runs whatever `foo.dll` sits next to it. The assumption that breaks is "the binary is signed, so its code is trusted": the signature covers the executable, not the libraries it pulls from a writable location. Anyone who can drop a file beside the binary — an installer, an updater, a user tricked into running a package — gets code execution inside the trusted, often privileged, process [E1](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md)[E2](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-fake-tech-support-havoc-command-control.md)[E3](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md).

## Where it shows up

- Signed installers or MSIs that ship a host executable plus plugin DLLs in the same folder [E1](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md)[E3](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md).
- Flutter/Electron desktop apps loading plugin DLLs from their install directory [E1](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md).
- Signed vendor binaries that load a same-directory DLL: LogiAiPromptBuilder.exe [E1](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md), ADNotificationManager.exe, DLPUserAgent.exe, Werfault.exe [E2](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-fake-tech-support-havoc-command-control.md), core.exe [E3](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md).
- Any `LoadLibrary` of a bare filename where the sibling directory is user-writable or populated from untrusted input.

## How to review

The invariant: every library a privileged or signed process loads must resolve to a path a non-admin cannot write. Check each load call — is the name bare or fully qualified? Is the directory writable by a non-admin, or populated from untrusted input (URL filename, update metadata)? The safe pattern is `LoadLibraryEx` with `LOAD_LIBRARY_SEARCH_*` flags (or `SetDefaultDllDirectories`) so the search excludes the app directory and CWD. For installers, confirm no same-named DLL can be bundled beside the signed host [E1](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md)[E3](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md). Treat "signed host + writable sibling directory" as unsafe regardless of signature.

## How finders spotted it

- DE&TH flagged an anomalous process execution chain in a partner environment, then expanded into a multi-day hunt across five partners, correlating spam/tech-support lures with DLL sideloading and Havoc tradecraft [E2](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-fake-tech-support-havoc-command-control.md).
- IR response to a hands-on intrusion; analysts unwound the layered execution chain from MSI through sideloads, ChaCha20 string/shellcode decryption, Lua interpreter, and reflective loaders to identify the previously unseen RAT [E3](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md).
- Malware analysis: identified the family as an update to MAVERICK/SORVEPOTEL, statically deobfuscated the .NET Reactor-protected modules, and pivoted on the phishing-page body hash and Cloudflare Workers infrastructure to map related domains; the sideload itself was confirmed by the MSI bundling a fake plugin DLL beside the signed host [E1](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md).

## Variants seen

- Trojanized installer bundling a fake plugin DLL beside a signed host [E1](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md)[E3](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md).
- Social-engineered "patch" dropping DLLs beside legitimate signed binaries [E2](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-fake-tech-support-havoc-command-control.md).

## Impact and severity

Enabled banking-trojan session hijack and self-propagation [E1](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md); delivered Havoc C2 with lateral movement to nine endpoints in ~11 hours via three persistence mechanisms [E2](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-fake-tech-support-havoc-command-control.md); beachhead to domain-wide movement toward a DC [E3](https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md). Severity rises with the privilege of the host process and chaining to lateral movement.

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **Logi AI Prompt Builder** (screen_retriever_plugin.dll) (version not stated): TCLBANKER: Brazilian Banking Trojan Spreading via WhatsApp and Outlook. Report: https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md
- **Havoc** (Demon agent) (version not stated): Fake Tech Support Delivers Havoc Command & Control. Report: https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-fake-tech-support-havoc-command-control.md
- **Zillya Antivirus** (core.exe / SystemStatus.dll DLL sideloading) (version not stated): A New RAT and a Hands-on-Keyboard Intrusion. Report: https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md

## Evidence
- E1: https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-tclbanker-brazilian-banking-trojan.md
- E2: https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-fake-tech-support-havoc-command-control.md
- E3: https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-clickfix-matanbuchus-astarionrat-analysis.md
