Skip to content

Commit d27ab61

Browse files
authored
Merge pull request #655 from icetiger1974/patch-1
Update moduleobject.cs
2 parents f0f6b6b + f0c5f62 commit d27ab61

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/runtime/moduleobject.cs

+8
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,14 @@ public static Assembly AddReference(string name)
395395
{
396396
assembly = AssemblyManager.LoadAssemblyFullPath(name);
397397
}
398+
if (System.IO.File.Exists(name))
399+
{
400+
var zone = System.Security.Policy.Zone.CreateFromUrl(name);
401+
if (zone.SecurityZone != System.Security.SecurityZone.MyComputer)
402+
{
403+
throw new Exception($"File is blocked (NTFS Security)");
404+
}
405+
}
398406
if (assembly == null)
399407
{
400408
throw new FileNotFoundException($"Unable to find assembly '{name}'.");

0 commit comments

Comments
 (0)