Commit aadad0c
committed
fix(security): restrict default DllImport search to safe directories
Add assembly-wide [DefaultDllImportSearchPaths(AssemblyDirectory |
SafeDirectories)] so the runtime's initial native-library resolution
(before our DllImportResolver / FixDllNotFoundException fallback kicks
in) does not fall through to the current working directory or other
unsafe legacy search locations.
Resolves a DLL-hijack vector on Windows where libwebp.dll dropped into
CWD could be loaded before our trusted runtimes/<rid>/native/ copy.
Available since .NET Framework 4.0; honored across all target
frameworks (net472, net48, netstandard2.0, net8.0).1 parent 51b3c6e commit aadad0c
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments