Събитие
Създаване на интелигентни приложения
17.03, 23 ч. - 21.03, 23 ч.
Присъединете се към поредицата срещи, за да изградите мащабируеми AI решения, базирани на реални случаи на употреба с колеги разработчици и експерти.
Регистрирайте се сегаТози браузър вече не се поддържа.
Надстройте до Microsoft Edge, за да се възползвате от най-новите функции, актуализации на защитата и техническа поддръжка.
Property | Value |
---|---|
Rule ID | CA2315 |
Title | Do not use insecure deserializer ObjectStateFormatter |
Category | Security |
Fix is breaking or non-breaking | Non-breaking |
Enabled by default in .NET 9 | No |
A System.Web.UI.ObjectStateFormatter deserialization method was called or referenced.
Insecure deserializers are vulnerable when deserializing untrusted data. An attacker could modify the serialized data to include unexpected types to inject objects with malicious side effects. An attack against an insecure deserializer could, for example, execute commands on the underlying operating system, communicate over the network, or delete files.
This rule finds System.Web.UI.ObjectStateFormatter deserialization method calls or references.
If possible, use a secure serializer instead, and don't allow an attacker to specify an arbitrary type to deserialize. Some safer serializers include:
Make the serialized data tamper-proof. After serialization, cryptographically sign the serialized data. Before deserialization, validate the cryptographic signature. Protect the cryptographic key from being disclosed and design for key rotations.
It's safe to suppress a warning from this rule if:
using System.IO;
using System.Web.UI;
public class ExampleClass
{
public object MyDeserialize(byte[] bytes)
{
ObjectStateFormatter formatter = new ObjectStateFormatter();
return formatter.Deserialize(new MemoryStream(bytes));
}
}
Imports System.IO
Imports System.Web.UI
Public Class ExampleClass
Public Function MyDeserialize(bytes As Byte()) As Object
Dim formatter As ObjectStateFormatter = New ObjectStateFormatter()
Return formatter.Deserialize(New MemoryStream(bytes))
End Function
End Class
Обратна връзка за .NET
.NET е проект с отворен код. Изберете връзка, за да предоставите обратна връзка:
Събитие
Създаване на интелигентни приложения
17.03, 23 ч. - 21.03, 23 ч.
Присъединете се към поредицата срещи, за да изградите мащабируеми AI решения, базирани на реални случаи на употреба с колеги разработчици и експерти.
Регистрирайте се сега