mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Swift: Add test case.
This commit is contained in:
@@ -138,6 +138,7 @@
|
||||
| testGRDB.swift:208:81:208:81 | password | label:password, type:credential |
|
||||
| testGRDB.swift:210:85:210:85 | password | label:password, type:credential |
|
||||
| testGRDB.swift:212:99:212:99 | password | label:password, type:credential |
|
||||
| testRealm2.swift:18:11:18:11 | myPassword | label:myPassword, type:credential |
|
||||
| testRealm.swift:31:20:31:20 | .password | label:password, type:credential |
|
||||
| testRealm.swift:41:11:41:11 | myPassword | label:myPassword, type:credential |
|
||||
| testRealm.swift:49:11:49:11 | myPassword | label:myPassword, type:credential |
|
||||
|
||||
21
swift/ql/test/query-tests/Security/CWE-311/testRealm2.swift
Normal file
21
swift/ql/test/query-tests/Security/CWE-311/testRealm2.swift
Normal file
@@ -0,0 +1,21 @@
|
||||
//codeql-extractor-options: -module-name RealmSwift
|
||||
|
||||
// --- stubs ---
|
||||
|
||||
class Object {
|
||||
}
|
||||
|
||||
// --- tests ---
|
||||
|
||||
class MyRealmSwiftObject3 : Object {
|
||||
override init() { data = "" }
|
||||
|
||||
var data: String
|
||||
}
|
||||
|
||||
func test1(o: MyRealmSwiftObject3, myHarmless: String, myPassword : String) {
|
||||
// ...
|
||||
o.data = myPassword // BAD [NOT DETECTED]
|
||||
o.data = myHarmless
|
||||
// ...
|
||||
}
|
||||
Reference in New Issue
Block a user