-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Guard against (de)serializing SerializationInfo instances #42605
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
Conversation
...ries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Converters.cs
Outdated
Show resolved
Hide resolved
|
Given time I imagine we'll also want to deny the types |
....Json/src/System/Text/Json/Serialization/Converters/Value/UnsupportedTypeConverterFactory.cs
Outdated
Show resolved
Hide resolved
eiriktsarpalis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this getting backported for 5.0? If not, wouldn't this be a 6.0 breaking change for the hypothetical customer code that relies on SerializationInfo?
src/libraries/System.Text.Json/tests/Serialization/ExceptionTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Serialization/TestClasses/TestClasses.cs
Outdated
Show resolved
Hide resolved
...em.Text.Json/src/System/Text/Json/Serialization/Converters/Value/UnsupportedTypeConverter.cs
Outdated
Show resolved
Hide resolved
wrt. adapting the error message appropriately, we could add a new internal |
This change won't be a breaking change in 6.0, so we don't need to port it to 5.0. The |
|
Test failures appear unrelated - 2 timeouts:
|
Also prevents the serializer from calling parameterized ctors with signature
.ctor(SerializationInfo, StreamingContext).FYI @GrabYourPitchforks, @eiriktsarpalis