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
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -35,54 +35,54 @@ of the existence of so-called Bypass Gadgets, which can circumvent such
35
35
protection measures.
36
36
</p>
37
37
<p>
38
-
Fixes by framework:
38
+
Recommendations specific to particular frameworks supported by this query:
39
39
</p>
40
40
<table>
41
41
<tbody>
42
42
<tr>
43
43
<th>Project</th>
44
44
<th>Maven Coordinates</th>
45
45
<th>Secure by Default</th>
46
-
<th>Fix</th>
46
+
<th>Recommendation</th>
47
47
</tr>
48
48
<tr>
49
49
<td>XMLDecoder</td>
50
50
<td>Java Standard Library</td>
51
51
<td>No</td>
52
-
<td>Don't use XMLDecoder with untrusted user input. It is impossible to secure.</td>
52
+
<td>Do not use with untrusted user input.</td>
53
53
</tr>
54
54
<tr>
55
55
<td>ObjectInputStream</td>
56
56
<td>Java Standard Library</td>
57
57
<td>No</td>
58
-
<td>Leverage a validating input stream like <code>org.apache.commons.io.serialization.ValidatingObjectInputStream</code>.</td>
58
+
<td>Use a validating input stream, such as <code>org.apache.commons.io.serialization.ValidatingObjectInputStream</code>.</td>
59
59
</tr>
60
60
<tr>
61
61
<td>FastJson</td>
62
62
<td>com.alibaba:fastjson</td>
63
63
<td>Partially</td>
64
-
<td>Call <code>com.alibaba.fastjson.parser.ParserConfig#setSafeMode</code> with the argument <code>true</code>.</td>
64
+
<td>Call <code>com.alibaba.fastjson.parser.ParserConfig#setSafeMode</code> with the argument <code>true</code> before deserializing untrusted data.</td>
<td>Instantiate the <code>org.yaml.snakeyaml.Yaml</code> instance explicitly with an instance of <code>org.yaml.snakeyaml.constructor.SafeConstructor</code> as an argument.</td>
70
+
<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>com.fasterxml.jackson.annotation.JsonTypeInfo</code> passing either the <code>CLASS</code> or <code>MINIMAL_CLASS</code> values to the annotation.
77
+
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
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>.</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>
0 commit comments