Skip to content

Commit c2cd097

Browse files
authored
Merge branch 'master' into master
2 parents 1126819 + d27ab61 commit c2cd097

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)