File tree Expand file tree Collapse file tree
ruby/ql/src/queries/security/cwe-502 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ Deserializing untrusted data using any method that allows the construction of
77arbitrary objects is easily exploitable and, in many cases, allows an attacker
88to execute arbitrary code.
99</p >
10+ <p >
11+ Note that a deserialization method is only dangerous if it can instantiate
12+ arbitrary classes or objects. 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 >
1018</overview >
1119
1220<recommendation >
@@ -31,7 +39,7 @@ safely be used.
3139If deserializing an untrusted XML document using the <code >ox</code > gem,
3240do not use <code >parse_obj</code > and <code >load</code > using the non-default :object mode.
3341Instead use the <code >load</code > method in the default mode or better explicitly set a safe
34- mode such as :hash.
42+ mode such as :hash.
3543</p >
3644
3745<p >
You can’t perform that action at this time.
0 commit comments