mirror of
https://github.com/github/codeql.git
synced 2026-08-04 17:33:18 +02:00
14 lines
324 B
C#
14 lines
324 B
C#
using System.Runtime.Serialization.Json;
|
|
using System.IO;
|
|
using System;
|
|
|
|
class BadDataContractJsonSerializer
|
|
{
|
|
public static object Deserialize(Type type, Stream s)
|
|
{
|
|
var ds = new DataContractJsonSerializer(type);
|
|
// BAD
|
|
return ds.ReadObject(s); // $ Alert[cs/unsafe-deserialization]
|
|
}
|
|
}
|