Open JarLob opened 6 years ago
Also consider the example:
public T Deserialize<T>(string xmlString)
{
var serializer = new XmlSerializer(typeof(T));
StringReader reader = new StringReader(xmlString);
return (T) serial.Deserialize(reader);
}
It is tricky to call the function with non-hardcoded T, but can be done with reflection. Thus typeof(T)
could be considered unsafe in Audit Mode only.
For some deserializers like
XmlSerializer
andDataContractSerializer
bothtype
andserialized data
have to be tainted to make it exploitable. Currently it gives false positives if only one is:It doesn't mean the
MyType
cannot be used as a gadget, the class should be investigated further.