Skip to content

Commit

Permalink
#4133 Backfit of : Prevent use of .. or : in file path #3552 (#4138)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaceySoftware committed Aug 6, 2024
1 parent e4855c6 commit 445bc60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/Csla.Shared/Reflection/MethodCaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ public static Type GetType(string typeName, bool throwOnError, bool ignoreCase)
string[] splitName = typeName.Split(',');
if (splitName.Length > 2)
{
var asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(AppContext.BaseDirectory + splitName[1].Trim() + ".dll");
var path = AppContext.BaseDirectory + splitName[1].Trim() + ".dll";
if (path.Contains("..") || path.Contains(':'))
throw new TypeLoadException(path);

var asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(path);
return asm.GetType(splitName[0].Trim());
}
else
Expand Down

0 comments on commit 445bc60

Please sign in to comment.