Kaganapan
Mar 17, 9 PM - Mar 21, 10 AM
Sumali sa serye ng meetup upang bumuo ng mga scalable AI solusyon batay sa mga kaso ng paggamit ng tunay na mundo sa mga kapwa developer at eksperto.
Magparehistro naHindi na suportado ang browser na ito.
Mag-upgrade sa Microsoft Edge para samantalahin ang mga pinakabagong tampok, update sa seguridad, at teknikal na suporta.
Property | Value |
---|---|
Rule ID | CA5367 |
Title | Do not serialize types with pointer fields |
Category | Security |
Fix is breaking or non-breaking | Non-breaking |
Enabled by default in .NET 9 | No |
Pointers are not type safe, which means you cannot guarantee the correctness of the memory they point at. So, serializing types with pointer fields is a security risk, as it may allow an attacker to control the pointer.
This rule checks whether there’s a serializable class with a pointer field or property. Members that can’t be serialized can be a pointer, such as static members or fields marked with System.NonSerializedAttribute.
Don't use pointer types for members in a serializable class or don't serialize the members that are pointers.
Don't take the risk to use pointers in serializable types.
using System;
[Serializable()]
unsafe class TestClassA
{
private int* pointer;
}
using System;
[Serializable()]
unsafe class TestClassA
{
private int i;
}
using System;
[Serializable()]
unsafe class TestClassA
{
private static int* pointer;
}
Feedback sa .NET
Ang .NET ay isang open source na project. Pumili ng link para magbibigay ng feedback:
Kaganapan
Mar 17, 9 PM - Mar 21, 10 AM
Sumali sa serye ng meetup upang bumuo ng mga scalable AI solusyon batay sa mga kaso ng paggamit ng tunay na mundo sa mga kapwa developer at eksperto.
Magparehistro na