Skip to content

Commit 8fbdd8c

Browse files
#4133 Backfit of : Prevent use of .. or : in file path #3552 for v6.x (#4145)
1 parent 0ef702d commit 8fbdd8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/Csla/Reflection/MethodCaller.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,11 @@ public static Type GetType(string typeName, bool throwOnError, bool ignoreCase)
252252

253253
if (splitName.Length > 2)
254254
{
255-
var asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(AppContext.BaseDirectory + splitName[1].Trim() + ".dll");
255+
var path = AppContext.BaseDirectory + splitName[1].Trim() + ".dll";
256+
if (path.Contains("..") || path.Contains(':'))
257+
throw new TypeLoadException(path);
256258

259+
var asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(path);
257260
return asm.GetType(splitName[0].Trim());
258261
}
259262
else

0 commit comments

Comments
 (0)