1111
1212public class A {
1313 public Object deserialize1 (Socket sock ) throws java .io .IOException , ClassNotFoundException {
14- InputStream inputStream = sock .getInputStream ();
14+ InputStream inputStream = sock .getInputStream (); // $ Source
1515 ObjectInputStream in = new ObjectInputStream (inputStream );
16- return in .readObject (); // $unsafeDeserialization
16+ return in .readObject (); // $ Alert
1717 }
1818
1919 public Object deserialize2 (Socket sock ) throws java .io .IOException , ClassNotFoundException {
20- InputStream inputStream = sock .getInputStream ();
20+ InputStream inputStream = sock .getInputStream (); // $ Source
2121 ObjectInputStream in = new ObjectInputStream (inputStream );
22- return in .readUnshared (); // $unsafeDeserialization
22+ return in .readUnshared (); // $ Alert
2323 }
2424
2525 public Object deserializeWithSerialKiller (Socket sock ) throws java .io .IOException , ClassNotFoundException {
@@ -29,24 +29,24 @@ public Object deserializeWithSerialKiller(Socket sock) throws java.io.IOExceptio
2929 }
3030
3131 public Object deserialize3 (Socket sock ) throws java .io .IOException {
32- InputStream inputStream = sock .getInputStream ();
32+ InputStream inputStream = sock .getInputStream (); // $ Source
3333 XMLDecoder d = new XMLDecoder (inputStream );
34- return d .readObject (); // $unsafeDeserialization
34+ return d .readObject (); // $ Alert
3535 }
3636
3737 public Object deserialize4 (Socket sock ) throws java .io .IOException {
3838 XStream xs = new XStream ();
39- InputStream inputStream = sock .getInputStream ();
39+ InputStream inputStream = sock .getInputStream (); // $ Source
4040 Reader reader = new InputStreamReader (inputStream );
41- return xs .fromXML (reader ); // $unsafeDeserialization
41+ return xs .fromXML (reader ); // $ Alert
4242 }
4343
4444 public void deserialize5 (Socket sock ) throws java .io .IOException {
4545 Kryo kryo = new Kryo ();
46- Input input = new Input (sock .getInputStream ());
47- A a1 = kryo .readObject (input , A .class ); // $unsafeDeserialization
48- A a2 = kryo .readObjectOrNull (input , A .class ); // $unsafeDeserialization
49- Object o = kryo .readClassAndObject (input ); // $unsafeDeserialization
46+ Input input = new Input (sock .getInputStream ()); // $ Source
47+ A a1 = kryo .readObject (input , A .class ); // $ Alert
48+ A a2 = kryo .readObjectOrNull (input , A .class ); // $ Alert
49+ Object o = kryo .readClassAndObject (input ); // $ Alert
5050 }
5151
5252 private Kryo getSafeKryo () throws java .io .IOException {
@@ -64,22 +64,22 @@ public void deserialize6(Socket sock) throws java.io.IOException {
6464
6565 public void deserializeSnakeYaml (Socket sock ) throws java .io .IOException {
6666 Yaml yaml = new Yaml ();
67- InputStream input = sock .getInputStream ();
68- Object o = yaml .load (input ); // $unsafeDeserialization
69- Object o2 = yaml .loadAll (input ); // $unsafeDeserialization
70- Object o3 = yaml .parse (new InputStreamReader (input )); // $unsafeDeserialization
71- A o4 = yaml .loadAs (input , A .class ); // $unsafeDeserialization
72- A o5 = yaml .loadAs (new InputStreamReader (input ), A .class ); // $unsafeDeserialization
67+ InputStream input = sock .getInputStream (); // $ Source
68+ Object o = yaml .load (input ); // $ Alert
69+ Object o2 = yaml .loadAll (input ); // $ Alert
70+ Object o3 = yaml .parse (new InputStreamReader (input )); // $ Alert
71+ A o4 = yaml .loadAs (input , A .class ); // $ Alert
72+ A o5 = yaml .loadAs (new InputStreamReader (input ), A .class ); // $ Alert
7373 }
7474
7575 public void deserializeSnakeYaml2 (Socket sock ) throws java .io .IOException {
7676 Yaml yaml = new Yaml (new Constructor ());
77- InputStream input = sock .getInputStream ();
78- Object o = yaml .load (input ); // $unsafeDeserialization
79- Object o2 = yaml .loadAll (input ); // $unsafeDeserialization
80- Object o3 = yaml .parse (new InputStreamReader (input )); // $unsafeDeserialization
81- A o4 = yaml .loadAs (input , A .class ); // $unsafeDeserialization
82- A o5 = yaml .loadAs (new InputStreamReader (input ), A .class ); // $unsafeDeserialization
77+ InputStream input = sock .getInputStream (); // $ Source
78+ Object o = yaml .load (input ); // $ Alert
79+ Object o2 = yaml .loadAll (input ); // $ Alert
80+ Object o3 = yaml .parse (new InputStreamReader (input )); // $ Alert
81+ A o4 = yaml .loadAs (input , A .class ); // $ Alert
82+ A o5 = yaml .loadAs (new InputStreamReader (input ), A .class ); // $ Alert
8383 }
8484
8585 public void deserializeSnakeYaml3 (Socket sock ) throws java .io .IOException {
@@ -94,11 +94,11 @@ public void deserializeSnakeYaml3(Socket sock) throws java.io.IOException {
9494
9595 public void deserializeSnakeYaml4 (Socket sock ) throws java .io .IOException {
9696 Yaml yaml = new Yaml (new Constructor (A .class ));
97- InputStream input = sock .getInputStream ();
98- Object o = yaml .load (input ); // $unsafeDeserialization
99- Object o2 = yaml .loadAll (input ); // $unsafeDeserialization
100- Object o3 = yaml .parse (new InputStreamReader (input )); // $unsafeDeserialization
101- A o4 = yaml .loadAs (input , A .class ); // $unsafeDeserialization
102- A o5 = yaml .loadAs (new InputStreamReader (input ), A .class ); // $unsafeDeserialization
97+ InputStream input = sock .getInputStream (); // $ Source
98+ Object o = yaml .load (input ); // $ Alert
99+ Object o2 = yaml .loadAll (input ); // $ Alert
100+ Object o3 = yaml .parse (new InputStreamReader (input )); // $ Alert
101+ A o4 = yaml .loadAs (input , A .class ); // $ Alert
102+ A o5 = yaml .loadAs (new InputStreamReader (input ), A .class ); // $ Alert
103103 }
104104}
0 commit comments