Skip to content

Commit 96dece3

Browse files
committed
Swift: ReDoS query result changes.
1 parent 86c6960 commit 96dece3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
| ReDoS.swift:64:22:64:22 | a* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. |
12
| ReDoS.swift:65:22:65:22 | a* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. |
23
| ReDoS.swift:66:22:66:22 | a* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. |
34
| ReDoS.swift:69:18:69:18 | a* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. |
5+
| ReDoS.swift:75:46:75:46 | a* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. |
46
| ReDoS.swift:77:57:77:57 | a* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. |
57
| ReDoS.swift:80:57:80:57 | a* | This part of the regular expression may cause exponential backtracking on strings containing many repetitions of 'a'. |

swift/ql/test/query-tests/Security/CWE-1333/ReDoS.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func myRegexpTests(myUrl: URL) throws {
6161
// Regex
6262

6363
_ = "((a*)*b)" // GOOD (never used)
64-
_ = try Regex("((a*)*b)") // DUBIOUS (never used)
64+
_ = try Regex("((a*)*b)") // DUBIOUS (never used) [FLAGGED]
6565
_ = try Regex("((a*)*b)").firstMatch(in: untainted) // DUBIOUS (never used on tainted input) [FLAGGED]
6666
_ = try Regex("((a*)*b)").firstMatch(in: tainted) // BAD
6767
_ = try Regex(".*").firstMatch(in: tainted) // GOOD (safe regex)
@@ -72,7 +72,7 @@ func myRegexpTests(myUrl: URL) throws {
7272

7373
// NSRegularExpression
7474

75-
_ = try? NSRegularExpression(pattern: "((a*)*b)") // DUBIOUS (never used)
75+
_ = try? NSRegularExpression(pattern: "((a*)*b)") // DUBIOUS (never used) [FLAGGED]
7676

7777
let nsregex1 = try? NSRegularExpression(pattern: "((a*)*b)") // DUBIOUS (never used on tainted input) [FLAGGED]
7878
_ = nsregex1?.stringByReplacingMatches(in: untainted, range: NSRange(location: 0, length: untainted.utf16.count), withTemplate: "")

0 commit comments

Comments
 (0)