Skip to content

Commit e2874ac

Browse files
committed
Python: Clarify that deserialization following a schema is safe
1 parent f2ea3b9 commit e2874ac

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ may have unforeseen effects, such as the execution of arbitrary code.
1616
There are many different serialization frameworks. This query currently
1717
supports Pickle, Marshal and Yaml.
1818
</p>
19+
<p>
20+
Note that a deserialization method is only dangerous if it can instantiate
21+
arbitrary classes. Serialization frameworks that use a schema to instantiate
22+
only expected, predefined types are generally not tracked by this query. Such
23+
frameworks are generally safe with respect to arbitrary-class-instantiation and
24+
gadget-chain attacks when the schema is trusted and does not permit
25+
user-controlled type resolution.
26+
</p>
1927
</overview>
2028

2129
<recommendation>

0 commit comments

Comments
 (0)