mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Handle all methods in StringKind.getTaintOfMethodResult
This commit is contained in:
@@ -8,8 +8,38 @@ abstract class StringKind extends TaintKind {
|
||||
StringKind() { this = this }
|
||||
|
||||
override TaintKind getTaintOfMethodResult(string name) {
|
||||
name in ["strip", "format", "lstrip", "rstrip", "ljust", "rjust", "title", "capitalize"] and
|
||||
name in [
|
||||
"capitalize",
|
||||
"casefold",
|
||||
"center",
|
||||
"expandtabs",
|
||||
"format",
|
||||
"format_map",
|
||||
"ljust",
|
||||
"lstrip",
|
||||
"lower",
|
||||
"replace",
|
||||
"rjust",
|
||||
"rstrip",
|
||||
"strip",
|
||||
"swapcase",
|
||||
"title",
|
||||
"upper",
|
||||
"zfill",
|
||||
/* encode/decode is technically not correct, but close enough */
|
||||
"encode",
|
||||
"decode"
|
||||
] and
|
||||
result = this
|
||||
or
|
||||
name in [
|
||||
"partition",
|
||||
"rpartition",
|
||||
"rsplit",
|
||||
"split",
|
||||
"splitlines"
|
||||
] and
|
||||
result.(SequenceKind).getItem() = this
|
||||
}
|
||||
|
||||
override TaintKind getTaintForFlowStep(ControlFlowNode fromnode, ControlFlowNode tonode) {
|
||||
|
||||
Reference in New Issue
Block a user