diff --git a/javascript/ql/lib/semmle/javascript/dataflow/TaintTracking.qll b/javascript/ql/lib/semmle/javascript/dataflow/TaintTracking.qll index 237c7c45dd66..01d2b10a14ea 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/TaintTracking.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/TaintTracking.qll @@ -409,7 +409,7 @@ module TaintTracking { not assgn.getWriteNode() instanceof Property and // not a write inside an object literal pred = assgn.getRhs() and assgn = obj.getAPropertyWrite() and - succ = obj + succ = assgn.getBase().getPostUpdateNode() | obj instanceof DataFlow::ObjectLiteralNode or diff --git a/javascript/ql/lib/semmle/javascript/dataflow/internal/DataFlowPrivate.qll b/javascript/ql/lib/semmle/javascript/dataflow/internal/DataFlowPrivate.qll index 0e95d3511559..e25f93bca3f5 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/internal/DataFlowPrivate.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/internal/DataFlowPrivate.qll @@ -1432,6 +1432,23 @@ predicate readStep(Node node1, ContentSet c, Node node2) { c = ContentSet::arrayElementLowerBound(pos.asPositionalLowerBound()) ) ) + or + // Implicitly read array elements before stringification + stringifiedNode(node1) and + node2 = node1 and + c = ContentSet::arrayElement() +} + +private predicate stringifiedNode(Node node) { + exists(Expr e | node = TValueNode(e) | + e = any(AddExpr add).getAnOperand() and + not e instanceof StringLiteral + or + e = any(TemplateLiteral t).getAnElement() and + not e instanceof TemplateElement + ) + or + node = DataFlow::globalVarRef("String").getAnInvocation().getArgument(0) } /** Gets the post-update node for which `node` is the corresponding pre-update node. */ diff --git a/javascript/ql/lib/semmle/javascript/dataflow/internal/TaintTrackingPrivate.qll b/javascript/ql/lib/semmle/javascript/dataflow/internal/TaintTrackingPrivate.qll index 5f290b557fe1..5ba7cddf0971 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/internal/TaintTrackingPrivate.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/internal/TaintTrackingPrivate.qll @@ -14,13 +14,10 @@ predicate defaultAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) FlowSummaryPrivate::Steps::summaryLocalStep(node1.(FlowSummaryNode).getSummaryNode(), node2.(FlowSummaryNode).getSummaryNode(), false, _) // TODO: preserve 'model' parameter or - // Convert steps into and out of array elements to plain taint steps + // Convert steps out of array elements to plain taint steps FlowSummaryPrivate::Steps::summaryReadStep(node1.(FlowSummaryNode).getSummaryNode(), ContentSet::arrayElement(), node2.(FlowSummaryNode).getSummaryNode()) or - FlowSummaryPrivate::Steps::summaryStoreStep(node1.(FlowSummaryNode).getSummaryNode(), - ContentSet::arrayElement(), node2.(FlowSummaryNode).getSummaryNode()) - or // If the spread argument itself is tainted (not inside a content), store it into the dynamic argument array. exists(InvokeExpr invoke, Content c | node1 = TValueNode(invoke.getAnArgument().stripParens().(SpreadElement).getOperand()) and diff --git a/javascript/ql/lib/semmle/javascript/frameworks/LodashUnderscore.qll b/javascript/ql/lib/semmle/javascript/frameworks/LodashUnderscore.qll index dcf361f6734e..7c2e6aa37a58 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/LodashUnderscore.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/LodashUnderscore.qll @@ -96,7 +96,7 @@ module LodashUnderscore { /** * A data flow step propagating an exception thrown from a callback to a Lodash/Underscore function. */ - private class ExceptionStep extends DataFlow::SharedFlowStep { + private class ExceptionStep extends DataFlow::LegacyFlowStep { override predicate step(DataFlow::Node pred, DataFlow::Node succ) { exists(DataFlow::CallNode call, string name | // Members ending with By, With, or While indicate that they are a variant of @@ -144,7 +144,13 @@ module LodashUnderscore { name = ["union", "zip"] and pred = call.getAnArgument() and succ = call - or + ) + } + + private predicate underscoreTaintStepLegacy(DataFlow::Node pred, DataFlow::Node succ) { + exists(string name, DataFlow::CallNode call | + call = any(Member member | member.getName() = name).getACall() + | name = ["each", "map", "every", "some", "max", "min", "sortBy", "partition", "mapObject", "tap"] and pred = call.getArgument(0) and @@ -168,6 +174,173 @@ module LodashUnderscore { underscoreTaintStep(pred, succ) } } + + private class UnderscoreTaintStepLegacy extends TaintTracking::LegacyTaintStep { + override predicate step(DataFlow::Node pred, DataFlow::Node succ) { + underscoreTaintStepLegacy(pred, succ) + } + } + + private class LodashEach extends DataFlow::SummarizedCallable { + LodashEach() { this = "_.each-like" } + + override DataFlow::CallNode getACall() { + result = member(["each", "eachRight", "forEach", "forEachRight", "every", "some"]).getACall() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = true and + input = "Argument[0].ArrayElement" and + output = "Argument[1].Parameter[0]" + } + } + + private class LodashMap extends DataFlow::SummarizedCallable { + LodashMap() { this = "_.map" } + + override DataFlow::CallNode getACall() { result = member("map").getACall() } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + ( + input = "Argument[0].ArrayElement" and + output = "Argument[1].Parameter[0]" + or + input = "Argument[1].ReturnValue" and + output = "ReturnValue.ArrayElement" + ) and + preservesValue = true + } + } + + private class LodashFlatMap extends DataFlow::SummarizedCallable { + LodashFlatMap() { this = "_.flatMap" } + + override DataFlow::CallNode getACall() { result = member("flatMap").getACall() } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + ( + input = "Argument[0].ArrayElement" and + output = "Argument[1].Parameter[0]" + or + input = "Argument[1].ReturnValue.WithoutArrayElement" and + output = "ReturnValue.ArrayElement" + or + input = "Argument[1].ReturnValue.ArrayElement" and + output = "ReturnValue.ArrayElement" + ) and + preservesValue = true + } + } + + private class LodashFlatMapDeep extends DataFlow::SummarizedCallable { + LodashFlatMapDeep() { this = "_.flatMapDeep" } + + override DataFlow::CallNode getACall() { + result = member(["flatMapDeep", "flatMapDepth"]).getACall() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + ( + input = "Argument[0].ArrayElement" and + output = "Argument[1].Parameter[0]" + or + input = "Argument[1].ReturnValue.WithoutArrayElement" and + output = "ReturnValue.ArrayElement" + or + input = "Argument[1].ReturnValue.ArrayElementDeep" and + output = "ReturnValue.ArrayElement" + ) and + preservesValue = true + } + } + + private class LodashReduce extends DataFlow::SummarizedCallable { + LodashReduce() { this = "_.reduce-like" } + + override DataFlow::CallNode getACall() { result = member(["reduce", "reduceRight"]).getACall() } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + ( + input = "Argument[0].ArrayElement" and + output = "Argument[1].Parameter[1]" + or + input = ["Argument[1].ReturnValue", "Argument[2]"] and + output = ["ReturnValue", "Argument[1].Parameter[0]"] + ) and + preservesValue = true + } + } + + private class LoashSortBy extends DataFlow::SummarizedCallable { + LoashSortBy() { this = "_.sortBy-like" } + + override DataFlow::CallNode getACall() { result = member(["sortBy", "orderBy"]).getACall() } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + input = "Argument[0].ArrayElement" and + output = + [ + "Argument[1].Parameter[0]", "Argument[1].ArrayElement.Parameter[0]", + "ReturnValue.ArrayElement" + ] and + preservesValue = true + } + } + + private class LodashMinMaxBy extends DataFlow::SummarizedCallable { + LodashMinMaxBy() { this = "_.minBy / _.maxBy" } + + override DataFlow::CallNode getACall() { result = member(["minBy", "maxBy"]).getACall() } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + input = "Argument[0].ArrayElement" and + output = ["Argument[1].Parameter[1]", "ReturnValue"] and + preservesValue = true + } + } + + private class LodashPartition extends DataFlow::SummarizedCallable { + LodashPartition() { this = "_.partition" } + + override DataFlow::CallNode getACall() { result = member("partition").getACall() } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + input = "Argument[0].ArrayElement" and + output = ["Argument[1].Parameter[1]", "ReturnValue.ArrayElement.ArrayElement"] and + preservesValue = true + } + } + + private class UnderscoreMapObject extends DataFlow::SummarizedCallable { + UnderscoreMapObject() { this = "_.mapObject" } + + override DataFlow::CallNode getACall() { result = member("mapObject").getACall() } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + // Just collapse all properties with AnyMember. We could be more precise by generating a summary + // for each property name, but for a rarely-used method like this it dosn't seem worth it. + ( + input = "Argument[0].AnyMember" and + output = "Argument[1].Parameter[1]" + or + input = "Argument[1].ReturnValue" and + output = "ReturnValue.AnyMember" + ) and + preservesValue = true + } + } + + private class LodashTap extends DataFlow::SummarizedCallable { + LodashTap() { this = "_.tap" } + + override DataFlow::CallNode getACall() { result = member("tap").getACall() } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + input = "Argument[0]" and + output = ["Argument[1].Parameter[0]", "ReturnValue"] and + preservesValue = true + } + } } /** diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AmbiguousCoreMethods.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AmbiguousCoreMethods.qll index 95981a6fb95d..45ad9cf7a9c9 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AmbiguousCoreMethods.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AmbiguousCoreMethods.qll @@ -24,6 +24,7 @@ private import javascript private import semmle.javascript.dataflow.internal.DataFlowNode private import semmle.javascript.dataflow.FlowSummary +private import Arrays private import FlowSummaryUtil class At extends SummarizedCallable { @@ -41,15 +42,18 @@ class At extends SummarizedCallable { } class Concat extends SummarizedCallable { - Concat() { this = "Array#concat / String#concat" } + Concat() { this = "Array#concat / String#concat / Buffer.concat" } override InstanceCall getACallSimple() { result.getMethodName() = "concat" } override predicate propagatesFlow(string input, string output, boolean preservesValue) { + // Array#concat. + // Also models Buffer.concat as this happens to out work well with our toString() model. preservesValue = true and input = "Argument[this,0..].ArrayElement" and output = "ReturnValue.ArrayElement" or + // String#concat preservesValue = false and input = "Argument[this,0..]" and output = "ReturnValue" @@ -149,3 +153,20 @@ class Values extends SummarizedCallable { output = "ReturnValue.IteratorElement" } } + +class ToString extends SummarizedCallable { + ToString() { this = "Object#toString / Array#toString" } + + override InstanceCall getACallSimple() { + result.(DataFlow::MethodCallNode).getMethodName() = "toString" + or + result = arrayConstructorRef().getAPropertyRead("prototype").getAMemberCall("toString") + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = false and + // Arrays stringify their contents and joins by "," + input = "Argument[this].ArrayElementDeep" and + output = "ReturnValue" + } +} diff --git a/javascript/ql/src/change-notes/2025-02-18-no-implicit-array-taint.md b/javascript/ql/src/change-notes/2025-02-18-no-implicit-array-taint.md new file mode 100644 index 000000000000..444ffb30905f --- /dev/null +++ b/javascript/ql/src/change-notes/2025-02-18-no-implicit-array-taint.md @@ -0,0 +1,5 @@ +--- +category: majorAnalysis +--- +* Improved precision of data flow through arrays, fixing some spurious flows + that would sometimes cause the `length` property of an array to be seen as tainted. diff --git a/javascript/ql/test/library-tests/FlowSummary/DataFlowConsistency.expected b/javascript/ql/test/library-tests/FlowSummary/DataFlowConsistency.expected index da22cf7e7786..f3b3ca527c3b 100644 --- a/javascript/ql/test/library-tests/FlowSummary/DataFlowConsistency.expected +++ b/javascript/ql/test/library-tests/FlowSummary/DataFlowConsistency.expected @@ -20,6 +20,7 @@ reverseRead | tst.js:267:28:267:31 | map3 | Origin of readStep is missing a PostUpdateNode. | argHasPostUpdate postWithInFlow +| file://:0:0:0:0 | [summary] to write: Argument[0] in _.tap | PostUpdateNode should not be the target of local flow. | | file://:0:0:0:0 | [summary] to write: Argument[1] in Array method with flow into callback | PostUpdateNode should not be the target of local flow. | | file://:0:0:0:0 | [summary] to write: Argument[1] in Array#filter | PostUpdateNode should not be the target of local flow. | | file://:0:0:0:0 | [summary] to write: Argument[1] in Array#find / Array#findLast | PostUpdateNode should not be the target of local flow. | @@ -29,6 +30,7 @@ postWithInFlow | file://:0:0:0:0 | [summary] to write: Argument[1] in Array#reduce / Array#reduceRight | PostUpdateNode should not be the target of local flow. | | file://:0:0:0:0 | [summary] to write: Argument[2] in 'array.prototype.find' / 'array-find' | PostUpdateNode should not be the target of local flow. | | file://:0:0:0:0 | [summary] to write: Argument[2] in Array.from(arg, callback, [thisArg]) | PostUpdateNode should not be the target of local flow. | +| file://:0:0:0:0 | [summary] to write: Argument[2] in _.reduce-like | PostUpdateNode should not be the target of local flow. | | file://:0:0:0:0 | [summary] to write: Argument[this] in Array#flatMap | PostUpdateNode should not be the target of local flow. | | file://:0:0:0:0 | [summary] to write: Argument[this] in Array#forEach / Map#forEach / Set#forEach | PostUpdateNode should not be the target of local flow. | | file://:0:0:0:0 | [summary] to write: Argument[this] in Array#map | PostUpdateNode should not be the target of local flow. | diff --git a/javascript/ql/test/library-tests/TripleDot/arrays.js b/javascript/ql/test/library-tests/TripleDot/arrays.js index 0a18066eb767..9376d4aba6c8 100644 --- a/javascript/ql/test/library-tests/TripleDot/arrays.js +++ b/javascript/ql/test/library-tests/TripleDot/arrays.js @@ -20,3 +20,27 @@ function shiftTaint() { sink(array.shift()); // $ hasTaintFlow=shift.directly-tainted sink(array.shift()); // $ hasTaintFlow=shift.directly-tainted } + +function implicitToString() { + const array = [source('implicitToString.1')]; + array.push(source('implicitToString.2')) + + sink(array + "foo"); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink("foo" + array); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink("" + array); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink(array + 1); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink(1 + array); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink(unknown() + array); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink(array + unknown()); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + + sink(`${array}`); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink(`${array} foo`); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + + sink(String(array)); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + + sink(array.toString()); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink(array.toString("utf8")); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + + sink(Array.prototype.toString.call(array)); // $ hasTaintFlow=implicitToString.1 hasTaintFlow=implicitToString.2 + sink(Object.prototype.toString.call(array)); // OK - returns "[object Array]" +} diff --git a/javascript/ql/test/library-tests/TripleDot/buffer.js b/javascript/ql/test/library-tests/TripleDot/buffer.js new file mode 100644 index 000000000000..db32a5d99159 --- /dev/null +++ b/javascript/ql/test/library-tests/TripleDot/buffer.js @@ -0,0 +1,7 @@ +import 'dummy'; + +function t1() { + const b1 = Buffer.from(source("t1.1")); + const b2 = Buffer.from(source("t1.2")); + sink(Buffer.concat([b1, b2]).toString("utf8")); // $ hasTaintFlow=t1.1 hasTaintFlow=t1.2 +} diff --git a/javascript/ql/test/query-tests/Security/CWE-078/IndirectCommandInjection/IndirectCommandInjection.expected b/javascript/ql/test/query-tests/Security/CWE-078/IndirectCommandInjection/IndirectCommandInjection.expected index b8ce07f4ca8e..af0b8090ff7b 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/IndirectCommandInjection/IndirectCommandInjection.expected +++ b/javascript/ql/test/query-tests/Security/CWE-078/IndirectCommandInjection/IndirectCommandInjection.expected @@ -27,7 +27,6 @@ edges | command-line-parameter-command-injection.js:14:6:14:30 | fewerArgs [ArrayElement] | command-line-parameter-command-injection.js:18:13:18:21 | fewerArgs [ArrayElement] | provenance | | | command-line-parameter-command-injection.js:14:18:14:21 | args | command-line-parameter-command-injection.js:14:18:14:30 | args.slice(1) | provenance | | | command-line-parameter-command-injection.js:14:18:14:21 | args | command-line-parameter-command-injection.js:14:18:14:30 | args.slice(1) [ArrayElement] | provenance | | -| command-line-parameter-command-injection.js:14:18:14:21 | args [ArrayElement] | command-line-parameter-command-injection.js:14:18:14:30 | args.slice(1) | provenance | | | command-line-parameter-command-injection.js:14:18:14:21 | args [ArrayElement] | command-line-parameter-command-injection.js:14:18:14:30 | args.slice(1) [ArrayElement] | provenance | | | command-line-parameter-command-injection.js:14:18:14:30 | args.slice(1) | command-line-parameter-command-injection.js:14:6:14:30 | fewerArgs | provenance | | | command-line-parameter-command-injection.js:14:18:14:30 | args.slice(1) [ArrayElement] | command-line-parameter-command-injection.js:14:6:14:30 | fewerArgs [ArrayElement] | provenance | | diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/UnsafeShellCommandConstruction.expected b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/UnsafeShellCommandConstruction.expected index 0e0cf297fa29..482c3cfff1b4 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/UnsafeShellCommandConstruction.expected +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/UnsafeShellCommandConstruction.expected @@ -89,18 +89,14 @@ edges | lib/lib.js:414:40:414:43 | name | lib/lib.js:426:11:426:14 | name | provenance | | | lib/lib.js:414:40:414:43 | name | lib/lib.js:426:11:426:14 | name | provenance | | | lib/lib.js:414:40:414:43 | name | lib/lib.js:428:36:428:39 | name | provenance | | -| lib/lib.js:426:2:426:4 | [post update] arr | lib/lib.js:427:14:427:16 | arr | provenance | | | lib/lib.js:426:2:426:4 | [post update] arr [ArrayElement] | lib/lib.js:427:14:427:16 | arr | provenance | | -| lib/lib.js:426:11:426:14 | name | lib/lib.js:426:2:426:4 | [post update] arr | provenance | | | lib/lib.js:426:11:426:14 | name | lib/lib.js:426:2:426:4 | [post update] arr [ArrayElement] | provenance | | | lib/lib.js:428:28:428:57 | (name ? ... ) + '-' | lib/lib.js:428:14:428:58 | build(" ... + '-') | provenance | | | lib/lib.js:428:28:428:57 | (name ? ... ) + '-' | lib/lib.js:431:23:431:26 | last | provenance | | | lib/lib.js:428:36:428:39 | name | lib/lib.js:428:28:428:57 | (name ? ... ) + '-' | provenance | | | lib/lib.js:431:23:431:26 | last | lib/lib.js:436:19:436:22 | last | provenance | | | lib/lib.js:431:23:431:26 | last | lib/lib.js:436:19:436:22 | last | provenance | | -| lib/lib.js:436:10:436:12 | [post update] arr | lib/lib.js:437:9:437:11 | arr | provenance | | | lib/lib.js:436:10:436:12 | [post update] arr [ArrayElement] | lib/lib.js:437:9:437:11 | arr [ArrayElement] | provenance | | -| lib/lib.js:436:19:436:22 | last | lib/lib.js:436:10:436:12 | [post update] arr | provenance | | | lib/lib.js:436:19:436:22 | last | lib/lib.js:436:10:436:12 | [post update] arr [ArrayElement] | provenance | | | lib/lib.js:441:39:441:42 | name | lib/lib.js:442:24:442:27 | name | provenance | | | lib/lib.js:446:20:446:23 | name | lib/lib.js:447:25:447:28 | name | provenance | | @@ -273,7 +269,6 @@ nodes | lib/lib.js:419:32:419:35 | name | semmle.label | name | | lib/lib.js:420:29:420:32 | name | semmle.label | name | | lib/lib.js:424:24:424:27 | name | semmle.label | name | -| lib/lib.js:426:2:426:4 | [post update] arr | semmle.label | [post update] arr | | lib/lib.js:426:2:426:4 | [post update] arr [ArrayElement] | semmle.label | [post update] arr [ArrayElement] | | lib/lib.js:426:11:426:14 | name | semmle.label | name | | lib/lib.js:426:11:426:14 | name | semmle.label | name | @@ -282,11 +277,9 @@ nodes | lib/lib.js:428:28:428:57 | (name ? ... ) + '-' | semmle.label | (name ? ... ) + '-' | | lib/lib.js:428:36:428:39 | name | semmle.label | name | | lib/lib.js:431:23:431:26 | last | semmle.label | last | -| lib/lib.js:436:10:436:12 | [post update] arr | semmle.label | [post update] arr | | lib/lib.js:436:10:436:12 | [post update] arr [ArrayElement] | semmle.label | [post update] arr [ArrayElement] | | lib/lib.js:436:19:436:22 | last | semmle.label | last | | lib/lib.js:436:19:436:22 | last | semmle.label | last | -| lib/lib.js:437:9:437:11 | arr | semmle.label | arr | | lib/lib.js:437:9:437:11 | arr [ArrayElement] | semmle.label | arr [ArrayElement] | | lib/lib.js:441:39:441:42 | name | semmle.label | name | | lib/lib.js:442:24:442:27 | name | semmle.label | name | @@ -354,7 +347,6 @@ nodes subpaths | lib/lib.js:251:27:251:30 | name | lib/lib.js:239:28:239:28 | s | lib/lib.js:245:9:245:9 | s | lib/lib.js:251:16:251:31 | cleanInput(name) | | lib/lib.js:340:25:340:25 | n | lib/lib.js:329:13:329:13 | x | lib/lib.js:330:9:330:9 | x | lib/lib.js:340:22:340:26 | id(n) | -| lib/lib.js:428:28:428:57 | (name ? ... ) + '-' | lib/lib.js:431:23:431:26 | last | lib/lib.js:437:9:437:11 | arr | lib/lib.js:428:14:428:58 | build(" ... + '-') | | lib/lib.js:428:28:428:57 | (name ? ... ) + '-' | lib/lib.js:431:23:431:26 | last | lib/lib.js:437:9:437:11 | arr [ArrayElement] | lib/lib.js:428:14:428:58 | build(" ... + '-') | #select | lib/isImported.js:6:10:6:25 | "rm -rf " + name | lib/isImported.js:5:49:5:52 | name | lib/isImported.js:6:22:6:25 | name | This string concatenation which depends on $@ is later used in a $@. | lib/isImported.js:5:49:5:52 | name | library input | lib/isImported.js:6:2:6:26 | cp.exec ... + name) | shell command | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/Xss.expected b/javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/Xss.expected index 7d067911c197..443e8c18d2c3 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/Xss.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/Xss.expected @@ -1145,7 +1145,6 @@ edges | various-concat-obfuscations.js:18:10:18:59 | '