Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]:Security Risk in TypeNameHandling.All in JsonSerializerSettings #1280

Open
contione opened this issue Jul 23, 2024 · 0 comments

Comments

@contione
Copy link

contione commented Jul 23, 2024

Issue Description:

I have identified a potential security vulnerability in the code where external data sources are being deserialized using Newtonsoft.Json with TypeNameHandling.All enabled. This setting allows the deserialization of types based on the type information present in the JSON payload. While convenient for polymorphic deserialization, it can also pose a security risk if the JSON data comes from untrusted sources. This setting could potentially be exploited for remote code execution (RCE) attacks if not handled carefully.

Code Reference:

private static JsonSerializerSettings SerializerSettings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All };

@contione contione changed the title Security concern regarding the usage of TypeNameHandling.All in JsonSerializerSettings Security Risk in TypeNameHandling.All in JsonSerializerSettings Jul 23, 2024
@contione contione changed the title Security Risk in TypeNameHandling.All in JsonSerializerSettings [Question]:Security Risk in TypeNameHandling.All in JsonSerializerSettings Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant