You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.qhelp
+37-49Lines changed: 37 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -37,55 +37,43 @@ protection measures.
37
37
<p>
38
38
Recommendations specific to particular frameworks supported by this query:
39
39
</p>
40
-
<table>
41
-
<tbody>
42
-
<tr>
43
-
<th>Project</th>
44
-
<th>Maven Coordinates</th>
45
-
<th>Secure by Default</th>
46
-
<th>Recommendation</th>
47
-
</tr>
48
-
<tr>
49
-
<td>XMLDecoder</td>
50
-
<td>Java Standard Library</td>
51
-
<td>No</td>
52
-
<td>Do not use with untrusted user input.</td>
53
-
</tr>
54
-
<tr>
55
-
<td>ObjectInputStream</td>
56
-
<td>Java Standard Library</td>
57
-
<td>No</td>
58
-
<td>Use a validating input stream, such as <code>org.apache.commons.io.serialization.ValidatingObjectInputStream</code>.</td>
59
-
</tr>
60
-
<tr>
61
-
<td>FastJson</td>
62
-
<td>com.alibaba:fastjson</td>
63
-
<td>Partially</td>
64
-
<td>Call <code>com.alibaba.fastjson.parser.ParserConfig#setSafeMode</code> with the argument <code>true</code> before deserializing untrusted data.</td>
<td>Pass an instance of <code>org.yaml.snakeyaml.constructor.SafeConstructor</code> to <code>org.yaml.snakeyaml.Yaml</code>'s constructor before using it to deserialize untrusted data.</td>
Don't call <code>com.fasterxml.jackson.databind.ObjectMapper#enableDefaultTyping</code> and don't annotate any object fields with <code>@JsonTypeInfo(CLASS) or @JsonTypeInfo(MINIMAL_CLASS)</code> if untrusted data may be deserialized.
<td>com.esotericsoftware:kryo and com.esotericsoftware:kryo5</td>
84
-
<td>com.esotericsoftware:kryo >= 5.0.0 and com.esotericsoftware:kryo5 Yes</td>
85
-
<td>Don't call <code>com.esotericsoftware.kryo(5).Kryo#setRegistrationRequired</code> with the argument <code>false</code> on any <code>Kryo</code> instance that may deserialize untrusted data.</td>
<li><b>Recommendation</b>: Call <code>com.alibaba.fastjson.parser.ParserConfig#setSafeMode</code> with the argument <code>true</code> before deserializing untrusted data.</li>
<li><b>Recommendation</b>: Don't call <code>com.fasterxml.jackson.databind.ObjectMapper#enableDefaultTyping</code> and don't annotate any object fields with <code>com.fasterxml.jackson.annotation.JsonTypeInfo</code> passing either the <code>CLASS</code> or <code>MINIMAL_CLASS</code> values to the annotation.
<p><b>Kryo</b> - <code>com.esotericsoftware:kryo</code> and <code>com.esotericsoftware:kryo5</code></p>
54
+
<ul>
55
+
<li><b>Secure by Default</b>: Yes for <code>com.esotericsoftware:kryo5</code> and for <code>com.esotericsoftware:kryo</code> >= v5.0.0</li>
56
+
<li><b>Recommendation</b>: Don't call <code>com.esotericsoftware.kryo(5).Kryo#setRegistrationRequired</code> with the argument <code>false</code> on any <code>Kryo</code> instance that may deserialize untrusted data.</li>
57
+
</ul>
58
+
<p></p>
59
+
<p><b>ObjectInputStream</b> - <code>Java Standard Library</code></p>
60
+
<ul>
61
+
<li><b>Secure by Default</b>: No</li>
62
+
<li><b>Recommendation</b>: Use a validating input stream, such as <code>org.apache.commons.io.serialization.ValidatingObjectInputStream</code>.</li>
<li><b>Recommendation</b>: Pass an instance of <code>org.yaml.snakeyaml.constructor.SafeConstructor</code> to <code>org.yaml.snakeyaml.Yaml</code>'s constructor before using it to deserialize untrusted data.</li>
0 commit comments