Skip to content

Commit 4e47f77

Browse files
committed
C#: Clarify that deserialization following a schema is safe
1 parent e2874ac commit 4e47f77

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

csharp/ql/src/Security Features/CWE-502/UnsafeDeserialization.qhelp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
<p>Deserializing an object from untrusted input may result in security problems, such
88
as denial of service or remote code execution.</p>
99

10+
<p>
11+
Note that a deserialization method is only dangerous if it can instantiate
12+
arbitrary classes. Serialization frameworks that use a schema to instantiate
13+
only expected, predefined types are generally not tracked by this query. Such
14+
frameworks are generally safe with respect to arbitrary-class-instantiation and
15+
gadget-chain attacks when the schema is trusted and does not permit
16+
user-controlled type resolution.
17+
</p>
18+
1019
</overview>
1120
<recommendation>
1221

csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.qhelp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
<p>Deserializing an object from untrusted input may result in security problems, such
88
as denial of service or remote code execution.</p>
99

10+
<p>
11+
Note that a deserialization method is only dangerous if it can instantiate
12+
arbitrary classes. Serialization frameworks that use a schema to instantiate
13+
only expected, predefined types are generally not tracked by this query. Such
14+
frameworks are generally safe with respect to arbitrary-class-instantiation and
15+
gadget-chain attacks when the schema is trusted and does not permit
16+
user-controlled type resolution.
17+
</p>
18+
1019
</overview>
1120
<recommendation>
1221

0 commit comments

Comments
 (0)