mirror of
https://github.com/github/codeql.git
synced 2026-04-25 08:45:14 +02:00
python: model string property of resultof finditer
This commit is contained in:
@@ -3463,6 +3463,14 @@ module StdlibPrivate {
|
||||
) and
|
||||
preservesValue = false
|
||||
)
|
||||
or
|
||||
// flow from input string to attribute on match object
|
||||
exists(int arg | arg = methodName.(RegexExecutionMethod).getStringArgIndex() - offset |
|
||||
input in ["Argument[" + arg + "]", "Argument[string:]"] and
|
||||
methodName = "finditer" and
|
||||
output = "ReturnValue.ListElement.Attribute[string]" and
|
||||
preservesValue = true
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ ensure_tainted(
|
||||
compiled_pat.match(ts).string, # $ tainted
|
||||
re.compile(ts).match("safe").re.pattern, # $ tainted
|
||||
|
||||
list(re.finditer(pat, ts))[0].string, # $ MISSING: tainted
|
||||
[m.string for m in re.finditer(pat, ts)], # $ MISSING: tainted
|
||||
list(re.finditer(pat, ts))[0].string, # $ tainted
|
||||
[m.string for m in re.finditer(pat, ts)], # $ tainted
|
||||
|
||||
list(re.finditer(pat, ts))[0].groups()[0], # $ MISSING: tainted
|
||||
[m.groups()[0] for m in re.finditer(pat, ts)], # $ MISSING: tainted
|
||||
|
||||
Reference in New Issue
Block a user