Skip to content
vetkitChecksChangelogDocumentation

vetkit.csharp.deserialization.dynamic-serializer-type

An XmlSerializer / DataContractSerializer is created for a type whose name is resolved at runtime from a non-constant string. If the name comes from the payload or the request, an attacker chooses which type is instantiated (unsafe deserialization).

Last updated:

Suite: Security

csharp

An XmlSerializer / DataContractSerializer is created for a type whose name is resolved at runtime from a non-constant string. If the name comes from the payload or the request, an attacker chooses which type is instantiated (unsafe deserialization).

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Create serializers only for compile-time types (typeof(T)); if the payload must select a type, map the name through a fixed dictionary of allowed types.

References

Source: packages/engine/rules/sast/csharp.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.