From 85d8c6fa8fdafc9b9e31fd5b007515cf49024b01 Mon Sep 17 00:00:00 2001 From: Luke Macey Date: Tue, 6 Aug 2024 19:14:38 +0100 Subject: [PATCH] #4133 Backfit of : Prevent use of .. or : in file path #3552 --- Source/Csla/Reflection/MethodCaller.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Csla/Reflection/MethodCaller.cs b/Source/Csla/Reflection/MethodCaller.cs index e791076020..1aa039dc9f 100644 --- a/Source/Csla/Reflection/MethodCaller.cs +++ b/Source/Csla/Reflection/MethodCaller.cs @@ -252,8 +252,11 @@ public static Type GetType(string typeName, bool throwOnError, bool ignoreCase) 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