mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
15 lines
361 B
C#
15 lines
361 B
C#
using System.Web.UI.WebControls;
|
|
using System.Runtime.Serialization.Formatters.Binary;
|
|
using System.IO;
|
|
using System.Text;
|
|
|
|
class BadBinaryFormatter
|
|
{
|
|
public static object Deserialize(TextBox textBox)
|
|
{
|
|
var ds = new BinaryFormatter();
|
|
// BAD
|
|
return ds.Deserialize(new MemoryStream(Encoding.UTF8.GetBytes(textBox.Text)));
|
|
}
|
|
}
|