File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed
lib/codeql/swift/frameworks/StandardLibrary
test/library-tests/dataflow/taint/libraries Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -74,19 +74,15 @@ private class WKNavigationDelegateSource extends RemoteFlowSource {
7474}
7575
7676/**
77- * A taint step implying that, if a `WKNavigationAction` is tainted, its `request` field is also tainted.
77+ * A content implying that, if a `WKNavigationAction` is tainted, its
78+ * `request` field is also tainted.
7879 */
79- private class WKNavigationActionTaintStep extends AdditionalTaintStep {
80- override predicate step ( DataFlow:: Node n1 , DataFlow:: Node n2 ) {
81- exists ( MemberRefExpr e , Expr self , VarDecl member |
82- self .getType ( ) .getName ( ) = "WKNavigationAction" and
83- member .getName ( ) = "request"
84- |
85- e .getBase ( ) = self and
86- e .getMember ( ) = member and
87- n1 .asExpr ( ) = self and
88- n2 .asExpr ( ) = e
89- )
80+ private class UrlRequestFieldsInheritTaint extends TaintInheritingContent ,
81+ DataFlow:: Content:: FieldContent
82+ {
83+ UrlRequestFieldsInheritTaint ( ) {
84+ this .getField ( ) .getEnclosingDecl ( ) .asNominalTypeDecl ( ) .getName ( ) = "WKNavigationAction" and
85+ this .getField ( ) .getName ( ) = "request"
9086 }
9187}
9288
Original file line number Diff line number Diff line change @@ -150,5 +150,5 @@ func testWKNavigationAction() {
150150 sink ( src. request) // $ tainted=WKNavigationAction
151151
152152 let keypath = \WKNavigationAction . request
153- sink ( src [ keyPath: keypath] ) // $ MISSING: tainted=WKNavigationAction
153+ sink ( src [ keyPath: keypath] ) // $ tainted=WKNavigationAction
154154}
You can’t perform that action at this time.
0 commit comments