mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
14 lines
290 B
C#
14 lines
290 B
C#
using System.Xml.Serialization;
|
|
using System.IO;
|
|
using System;
|
|
|
|
class BadXmlSerializer
|
|
{
|
|
public static object Deserialize(Type type, Stream s)
|
|
{
|
|
var ds = new XmlSerializer(type);
|
|
// BAD
|
|
return ds.Deserialize(s); // $ Alert[cs/unsafe-deserialization]
|
|
}
|
|
}
|