SEC011
Dynamic library loading with variable path
Object Pascal — Delphi & Free Pascal
Warning
Security
LoadLibrary with a variable path enables DLL hijacking if the search order is exploited
LoadLibrary with a variable path enables DLL hijacking if the search order is exploited.
Why this severity
LoadLibrary with a variable path enables DLL hijacking if the search order is exploited.
Known false positives
paths constructed from a verified application directory.
Remediation example
LibPath := ExtractFilePath(ParamStr(0)) + 'mylib.dll'; hLib := LoadLibrary(PChar(LibPath));