Skip to content

Commit f3a5c34

Browse files
#4133 Backfit of : Prevent use of .. or : in file path #3552 (#4144)
1 parent 6973dbb commit f3a5c34

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)