Skip to content

Commit 427b73e

Browse files
committed
Clarify that deserialization that follows a schema is safe
1 parent 7aa3fd8 commit 427b73e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ supports Kryo, XmlDecoder, XStream, SnakeYaml, JYaml, JsonIO, YAMLBeans, Hessian
1818
Jackson, Jabsorb, Jodd JSON, Flexjson, Gson, JMS, and Java IO serialization through
1919
<code>ObjectInputStream</code>/<code>ObjectOutputStream</code>.
2020
</p>
21+
<p>
22+
Note that a deserialization method is only dangerous if it can instantiate
23+
arbitrary classes. Serialization frameworks that use a schema to instantiate
24+
only expected, predefined types are generally safe and are not tracked by this
25+
query. For example, Apache Avro's deserialization methods follow a schema and
26+
therefore cannot instantiate arbitrary classes, making them safe to use even
27+
with untrusted data.
28+
</p>
2129
</overview>
2230

2331
<recommendation>

0 commit comments

Comments
 (0)