Skip to content

Commit 317757b

Browse files
committed
Swift: Create proper models for JavaScriptCore.
1 parent 6ef6be7 commit 317757b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

swift/ql/lib/codeql/swift/frameworks/Frameworks.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
private import Alamofire.Alamofire
6+
private import JavaScriptCore.JavaScriptCore
67
private import StandardLibrary.StandardLibrary
78
private import UIKit.UIKit
89
private import Xml.Xml
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Provides models for the `JavaScriptCore` library.
3+
*/
4+
5+
import swift
6+
private import codeql.swift.dataflow.ExternalFlow
7+
8+
/**
9+
* A model for `JavaScriptCore` functions and class members that permit taint flow.
10+
*/
11+
private class JSStringSummaries extends SummaryModelCsv {
12+
override predicate row(string row) {
13+
row =
14+
[
15+
";;false;JSStringCreateWithUTF8CString(_:);;;Argument[0];ReturnValue;taint",
16+
";;false;JSStringCreateWithCharacters(_:_:);;;Argument[0];ReturnValue;taint",
17+
";;false;JSStringRetain(_:);;;Argument[0];ReturnValue;taint",
18+
]
19+
}
20+
}

0 commit comments

Comments
 (0)