MemberInfo[] members = type.GetMembers(); // Sensitive
members = type.GetMember(methodName); // Sensitive
members = type.GetDefaultMembers(); // Sensitive
type.InvokeMember(...); // Sensitive, when the method name is provided as a string
assembly.CreateInstance(typeName); // Sensitive
type = Type.ReflectionOnlyGetType(typeName,true, true); // This is OK as the resulting type is not executable.
Activator.CreateComInstanceFrom(...); // Sensitive, when the type name is provided as a string
Activator.CreateInstance(...); // Sensitive, when the type name is provided as a string
Activator.CreateInstanceFrom(...); // Sensitive, when the type name is provided as a string
Activator.CreateInstance<>(); // OK - can only be created from a referenced type
}
}
----
== Exceptions
No issue will be created if one of the methods above is called with a hard-coded type/method/field/property/interface/module name. There can be no injection in this specific scenario.
No issue will be created if one of the methods is called on an instance of _Type_ created using _typeof_. There can be no injection in this specific scenario.