Visualstudio-docs: How can an attacker run malicious code during deserialization?

Created on 9 Jun 2020  Â·  7Comments  Â·  Source: MicrosoftDocs/visualstudio-docs

If an attacker writes a C# class that's meant to run malicious code on your machine and includes the name of that class in the JSON, doesn't your machine only get the class name and not the code? Can't Newtonsoft only use type information for deserialization if the type has been loaded in the .NET runtime? How could malicious code be run if the code hasn't been transferred to the target machine?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 doc-bug visual-studio-windowprod vs-ide-code-analysitech

All 7 comments

@v-kydela -- Kyle, thank you for your questions. Please consider these resources:

@dotpaul -- Paul, please look into this issue.

Hi @v-kydela, your understanding of only type names appearing in serialized data is correct; an attack involves types that are already available to the attacked process.

@dotpaul - The article says "An attack against an insecure deserializer could, for example, execute commands on the underlying operating system, communicate over the network, or delete files."

Are there any builtin .NET types that could be used to do that just by being constructed during deserialization?

Yep, there are.

@dotpaul Is there any doc clarification needed for this? Otherwise, I will close it.

@Mikejo5000 no doc updates need. Thanks!

Great, thx!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nitinjs picture nitinjs  Â·  3Comments

Ogglas picture Ogglas  Â·  3Comments

wellwind picture wellwind  Â·  3Comments

suhailmahmood picture suhailmahmood  Â·  3Comments

H35am picture H35am  Â·  4Comments