Skip to content

Commit 1d7881e

Browse files
JLLeitschuhsmowton
andcommitted
Apply suggestions from code review
Co-authored-by: Chris Smowton <[email protected]>
1 parent b7364f5 commit 1d7881e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.qhelp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,54 +35,54 @@ of the existence of so-called Bypass Gadgets, which can circumvent such
3535
protection measures.
3636
</p>
3737
<p>
38-
Fixes by framework:
38+
Recommendations specific to particular frameworks supported by this query:
3939
</p>
4040
<table>
4141
<tbody>
4242
<tr>
4343
<th>Project</th>
4444
<th>Maven Coordinates</th>
4545
<th>Secure by Default</th>
46-
<th>Fix</th>
46+
<th>Recommendation</th>
4747
</tr>
4848
<tr>
4949
<td>XMLDecoder</td>
5050
<td>Java Standard Library</td>
5151
<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>
5353
</tr>
5454
<tr>
5555
<td>ObjectInputStream</td>
5656
<td>Java Standard Library</td>
5757
<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>
5959
</tr>
6060
<tr>
6161
<td>FastJson</td>
6262
<td>com.alibaba:fastjson</td>
6363
<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>
6565
</tr>
6666
<tr>
6767
<td>SnakeYAML</td>
6868
<td>org.yaml:snakeyaml</td>
6969
<td><a href="https://bitbucket.org/snakeyaml/snakeyaml/wiki/CVE%20&amp;%20NIST.md">No</a> (<a href="https://bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in">maintainer response</a>)</td>
70-
<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>
7171
</tr>
7272
<tr>
7373
<td>FasterXML jackson-databind</td>
7474
<td>com.fasterxml.jackson.core:jackson-databind</td>
7575
<td>Yes</td>
7676
<td>
77-
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.
7878
Read <a href="https://cowtowncoder.medium.com/jackson-2-10-safe-default-typing-2d018f0ce2ba">this guide</a>.
7979
</td>
8080
</tr>
8181
<tr>
8282
<td>Kryo</td>
8383
<td>com.esotericsoftware:kryo and com.esotericsoftware:kryo5</td>
8484
<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>
8686
</tr>
8787
</tbody>
8888
</table>

0 commit comments

Comments
 (0)