diff --git a/src/runtime/moduleobject.cs b/src/runtime/moduleobject.cs index e683026f9..4accb1531 100644 --- a/src/runtime/moduleobject.cs +++ b/src/runtime/moduleobject.cs @@ -395,6 +395,14 @@ public static Assembly AddReference(string name) { assembly = AssemblyManager.LoadAssemblyFullPath(name); } + if (System.IO.File.Exists(name)) + { + var zone = System.Security.Policy.Zone.CreateFromUrl(name); + if (zone.SecurityZone != System.Security.SecurityZone.MyComputer) + { + throw new Exception($"File is blocked (NTFS Security)"); + } + } if (assembly == null) { throw new FileNotFoundException($"Unable to find assembly '{name}'.");