mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Swift: Add more test cases exploring the timeout.
This commit is contained in:
@@ -380,7 +380,12 @@ func myRegexpVariantsTests(myUrl: URL) throws {
|
||||
|
||||
// BAD
|
||||
// TODO: QL evaluation times out (for test, at 5 minutes)
|
||||
// times out:
|
||||
// _ = try Regex(#"(\w*foobarbaz\w*foobarbaz\w*foobarbaz\w*foobarbaz\s*foobarbaz\d*foobarbaz\w*)+-"#).firstMatch(in: tainted) // $ redos-vulnerable=
|
||||
// a simpler regex that times out:
|
||||
// _ = try Regex(#"(\w*foobarfoobarfoobarfoobarfoobarfoobarfoobarfoobar)+"#).firstMatch(in: tainted) // $ redos-vulnerable=
|
||||
// a simpler regerx that doesn't time out but is slow to evaluate:
|
||||
// _ = try Regex(#"(\w*foobarfoobarfoobar)+"#).firstMatch(in: tainted) // $ redos-vulnerable=
|
||||
|
||||
// BAD (but cannot currently construct a prefix)
|
||||
// attack string: "aa" + "b" x lots + "!"
|
||||
|
||||
Reference in New Issue
Block a user