.NET Deserialization
Last updated
Last updated
Insecure deserialization is a vulnerability that can affect applications built using the .NET framework. They occurs when the deserialization process is not properly secured and validated, allowing attackers to exploit it and execute arbitrary code or perform other malicious activities.
In .NET application that uses JSON.net (Newtonsoft library), we can inject arbitrary code or read local files by abusing JSON deserialization objects.
To decompile a .NET application you can use dnSpy on windows or AvaloniaILSpy on Linux
If the application have the TypeNameHandling not being set to None
and deserialize a parameter without proper validation, it is vulnerable.
In the previous code, Example
is the class to what json data will be converted (deserialized)