Skip to content

Commit b59b9c8

Browse files
committed
Added modeling underscore.string of function which contain multiple sources points.
1 parent 77e1e17 commit b59b9c8

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

javascript/ql/lib/ext/underscore.string.model.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ extensions:
66
- ["'underscore.string'", "Member[slugify,capitalize,decapitalize,clean,cleanDiacritics,swapCase,escapeHTML,unescapeHTML,wrap,dedent,reverse,pred,succ,titleize,camelize,classify,underscored,dasherize,humanize,trim,ltrim,rtrim,truncate,sprintf,strRight,strRightBack,strLeft,strLeftBack,stripTags,unquote,map]", "Argument[0]", "ReturnValue", "taint"]
77
- ["'underscore.string'", "Member[chop,chars,words,lines]", "Argument[0]", "ReturnValue", "taint"]
88
- ["'underscore.string'", "Member[toSentence,toSentenceSerial]", "Argument[0].ArrayElement", "ReturnValue", "taint"]
9+
- ["'underscore.string'", "Member[insert,replaceAll,splice,prune,pad,lpad,rpad,repeat]", "Argument[0,2]", "ReturnValue", "taint"]
10+
- ["'underscore.string'", "Member[splice]", "Argument[0,3]", "ReturnValue", "taint"]
11+
- ["'underscore.string'", "Member[join]", "Argument[0..N-1]", "ReturnValue", "taint"]
12+
- ["'underscore.string'", "Member[surround,quote]", "Argument[0,1]", "ReturnValue", "taint"]

javascript/ql/test/library-tests/TripleDot/underscore.string.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,36 @@ function arrayToStr() {
4747
}
4848

4949
function multiSource() {
50-
sink(s.insert("str", 4, source("s1"))); // $ MISSING: hasTaintFlow=s1
51-
sink(s.insert(source("s2"), 4, "")); // $ MISSING: hasTaintFlow=s2
50+
sink(s.insert("str", 4, source("s1"))); // $ hasTaintFlow=s1
51+
sink(s.insert(source("s2"), 4, "")); // $ hasTaintFlow=s2
5252

53-
sink(s.replaceAll("astr", "a", source("s3"))); // $ MISSING: hasTaintFlow=s3
54-
sink(s.replaceAll(source("s4"), "a", "")); // $ MISSING: hasTaintFlow=s4
53+
sink(s.replaceAll("astr", "a", source("s3"))); // $ hasTaintFlow=s3
54+
sink(s.replaceAll(source("s4"), "a", "")); // $ hasTaintFlow=s4
5555

56-
sink(s.join(",", source("s5"), "str")); // $ MISSING: hasTaintFlow=s5
57-
sink(s.join(",", "str", source("s6"))); // $ MISSING: hasTaintFlow=s6
56+
sink(s.join(",", source("s5"), "str")); // $ hasTaintFlow=s5
57+
sink(s.join(",", "str", source("s6"))); // $ hasTaintFlow=s6
5858

59-
sink(s.splice(source("s7"), 1, 2, "str")); // $ MISSING: hasTaintFlow=s7 SPURIOUS: hasTaintFlow=s8
60-
sink(s.splice("str", 1, 2, source("s8"))); // $ SPURIOUS: hasTaintFlow=s8
59+
sink(s.splice(source("s7"), 1, 2, "str")); // $ hasTaintFlow=s7 SPURIOUS: hasTaintFlow=s8
60+
sink(s.splice("str", 1, 2, source("s8"))); // $ hasTaintFlow=s8
6161

62-
sink(s.prune(source("s9"), 1, "additional")); // $ MISSING: hasTaintFlow=s9
63-
sink(s.prune("base", 1, source("s10"))); // $ MISSING: hasTaintFlow=s10
62+
sink(s.prune(source("s9"), 1, "additional")); // $ hasTaintFlow=s9
63+
sink(s.prune("base", 1, source("s10"))); // $ hasTaintFlow=s10
6464

65-
sink(s.pad(source("s11"), 10, "charsToPad", "right")); // $ MISSING: hasTaintFlow=s11
66-
sink(s.pad("base", 10, source("s12"), "right")); // $ MISSING: hasTaintFlow=s12
65+
sink(s.pad(source("s11"), 10, "charsToPad", "right")); // $ hasTaintFlow=s11
66+
sink(s.pad("base", 10, source("s12"), "right")); // $ hasTaintFlow=s12
6767

68-
sink(s.lpad(source("s13"), 10, "charsToPad")); // $ MISSING: hasTaintFlow=s13
69-
sink(s.lpad("base", 10, source("s14"))); // $ MISSING: hasTaintFlow=s14
68+
sink(s.lpad(source("s13"), 10, "charsToPad")); // $ hasTaintFlow=s13
69+
sink(s.lpad("base", 10, source("s14"))); // $ hasTaintFlow=s14
7070

71-
sink(s.rpad(source("s15"), 10, "charsToPad")); // $ MISSING: hasTaintFlow=s15
72-
sink(s.rpad("base", 10, source("s16"))); // $ MISSING: hasTaintFlow=s16
71+
sink(s.rpad(source("s15"), 10, "charsToPad")); // $ hasTaintFlow=s15
72+
sink(s.rpad("base", 10, source("s16"))); // $ hasTaintFlow=s16
7373

74-
sink(s.repeat(source("s17"), 3, "seperator")); // $ MISSING: hasTaintFlow=s17
75-
sink(s.repeat("base", 3, source("s18"))); // $ MISSING: hasTaintFlow=s18
74+
sink(s.repeat(source("s17"), 3, "seperator")); // $ hasTaintFlow=s17
75+
sink(s.repeat("base", 3, source("s18"))); // $ hasTaintFlow=s18
7676

77-
sink(s.surround(source("s19"), "wrap")); // $ MISSING: hasTaintFlow=s19
78-
sink(s.surround("base", source("s20"))); // $ MISSING: hasTaintFlow=s20
77+
sink(s.surround(source("s19"), "wrap")); // $ hasTaintFlow=s19
78+
sink(s.surround("base", source("s20"))); // $ hasTaintFlow=s20
7979

80-
sink(s.quote(source("s21"), "quote")); // $ MISSING: hasTaintFlow=s21
81-
sink(s.quote("base", source("s22"))); // $ MISSING: hasTaintFlow=s22
80+
sink(s.quote(source("s21"), "quote")); // $ hasTaintFlow=s21
81+
sink(s.quote("base", source("s22"))); // $ hasTaintFlow=s22
8282
}

0 commit comments

Comments
 (0)