Skip to content

Commit c894f00

Browse files
kjkclaude
andcommitted
add more DLLs to preload list to prevent DLL sideloading attacks
A crash report showed a malicious DWrite.dll planted next to the portable exe, executing shellcode via DLL search order hijacking. Preload all late-loaded DLLs from System32 to block this vector. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a0977af commit c894f00

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/utils/WinDynCalls.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,14 @@ HRESULT SetCaptionColor(HWND hwnd, COLORREF col) {
202202
}; // namespace dwm
203203

204204
static const char* dllsToPreload =
205-
"gdiplus.dll\0msimg32.dll\0shlwapi.dll\0urlmon.dll\0version.dll\0windowscodecs.dll\0wininet.dll\0";
205+
"gdiplus.dll\0msimg32.dll\0shlwapi.dll\0urlmon.dll\0version.dll\0windowscodecs.dll\0wininet.dll\0"
206+
"DWrite.dll\0TextShaping.dll\0textinputframework.dll\0"
207+
"WINTRUST.dll\0MSASN1.dll\0imagehlp.dll\0CRYPTSP.dll\0rsaenh.dll\0CRYPTBASE.dll\0"
208+
"bcryptPrimitives.dll\0kernel.appcore.dll\0MSCTF.dll\0"
209+
"CoreMessaging.dll\0CoreUIComponents.dll\0WS2_32.dll\0wintypes.dll\0"
210+
"ntmarta.dll\0clbcatq.dll\0profapi.dll\0PROPSYS.dll\0MrmCoreR.dll\0"
211+
"thumbcache.dll\0VCRUNTIME140.dll\0sendmail.dll\0policymanager.dll\0"
212+
"msvcp110_win.dll\0CFGMGR32.dll\0";
206213

207214
// try to mitigate dll hijacking by pre-loading all the dlls that we delay load or might
208215
// be loaded indirectly

0 commit comments

Comments
 (0)