File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
swift/ql/src/queries/Security/CWE-311 Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ import codeql.swift.dataflow.TaintTracking
18
18
import DataFlow:: PathGraph
19
19
20
20
/**
21
- * An `Expr ` that is stored in a local database.
21
+ * A `DataFlow::Node ` that is something stored in a local database.
22
22
*/
23
23
abstract class Stored extends DataFlow:: Node { }
24
24
25
25
/**
26
- * An `Expr ` that is stored with the Core Data library.
26
+ * A `DataFlow::Node ` that is an expression stored with the Core Data library.
27
27
*/
28
28
class CoreDataStore extends Stored {
29
29
CoreDataStore ( ) {
@@ -39,16 +39,17 @@ class CoreDataStore extends Stored {
39
39
}
40
40
41
41
/**
42
- * An `Expr` that is stored with the Realm database library.
42
+ * A `DataFlow::Node` that is an expression stored with the Realm database
43
+ * library.
43
44
*/
44
- class RealmStore extends Stored {
45
+ class RealmStore extends Stored instanceof DataFlow :: PostUpdateNode {
45
46
RealmStore ( ) {
46
47
// any write into a class derived from `RealmSwiftObject` is a sink. For
47
48
// example in `realmObj.data = sensitive` the post-update node corresponding
48
49
// with `realmObj.data` is a sink.
49
50
exists ( ClassDecl cd , Expr e |
50
51
cd .getABaseTypeDecl * ( ) .getName ( ) = "RealmSwiftObject" and
51
- this .( DataFlow :: PostUpdateNode ) . getPreUpdateNode ( ) .asExpr ( ) = e and
52
+ this .getPreUpdateNode ( ) .asExpr ( ) = e and
52
53
e .getFullyConverted ( ) .getType ( ) = cd .getType ( ) and
53
54
not e .( DeclRefExpr ) .getDecl ( ) instanceof SelfParamDecl
54
55
)
You can’t perform that action at this time.
0 commit comments