circle-ir 3.47.0 → 3.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/constant-propagation/propagator.d.ts +7 -0
- package/dist/analysis/constant-propagation/propagator.d.ts.map +1 -1
- package/dist/analysis/constant-propagation/propagator.js +81 -41
- package/dist/analysis/constant-propagation/propagator.js.map +1 -1
- package/dist/analysis/html/html-attribute-security-pass.js +14 -9
- package/dist/analysis/html/html-attribute-security-pass.js.map +1 -1
- package/dist/analysis/html/html-extractor.d.ts.map +1 -1
- package/dist/analysis/html/html-extractor.js +16 -11
- package/dist/analysis/html/html-extractor.js.map +1 -1
- package/dist/browser/circle-ir.js +97 -73
- package/dist/core/circle-ir-core.cjs +62 -41
- package/dist/core/circle-ir-core.js +62 -41
- package/dist/core/parser.d.ts +10 -0
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/parser.js +20 -5
- package/dist/core/parser.js.map +1 -1
- package/dist/languages/plugins/base.d.ts.map +1 -1
- package/dist/languages/plugins/base.js +15 -11
- package/dist/languages/plugins/base.js.map +1 -1
- package/dist/languages/plugins/java.d.ts.map +1 -1
- package/dist/languages/plugins/java.js +8 -4
- package/dist/languages/plugins/java.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-attribute-security-pass.js","sourceRoot":"","sources":["../../../src/analysis/html/html-attribute-security-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAErF;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAAoB,EACpB,QAAgB;IAEhB,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,qBAAqB,CAC5B,IAAgB,EAChB,QAAgB,EAChB,QAAuB;IAEvB,
|
|
1
|
+
{"version":3,"file":"html-attribute-security-pass.js","sourceRoot":"","sources":["../../../src/analysis/html/html-attribute-security-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAErF;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAAoB,EACpB,QAAgB;IAEhB,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,qBAAqB,CAC5B,IAAgB,EAChB,QAAgB,EAChB,QAAuB;IAEvB,sEAAsE;IACtE,yDAAyD;IACzD,MAAM,KAAK,GAAiB,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,EAAG,CAAC;QAC7B,oEAAoE;QACpE,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,kBAAkB;YACjE,OAAO,CAAC,IAAI,KAAK,gBAAgB,IAAI,OAAO,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YAC1E,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC5C,CAAC;QACD,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACjD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,KAAK;gBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CA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AAO;KACR,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,MAAc;IACzC,OAAO,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-extractor.d.ts","sourceRoot":"","sources":["../../../src/analysis/html/html-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,IAAI,EAAE,QAAQ,GAAG,cAAc,CAAC;IAChC,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,aAAa,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAcD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,UAAU,GAAG,oBAAoB,CAO7E;
|
|
1
|
+
{"version":3,"file":"html-extractor.d.ts","sourceRoot":"","sources":["../../../src/analysis/html/html-extractor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EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -31,17 +31,22 @@ export function extractHtmlContent(rootNode) {
|
|
|
31
31
|
return { scriptBlocks, eventHandlers };
|
|
32
32
|
}
|
|
33
33
|
function walkNode(node, scriptBlocks, eventHandlers) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
|
|
34
|
+
// Iterative DFS — guards against stack overflow on pathological HTML
|
|
35
|
+
// (deeply nested elements / huge generated documents). Visits parent
|
|
36
|
+
// before children, children left-to-right.
|
|
37
|
+
const stack = [node];
|
|
38
|
+
while (stack.length > 0) {
|
|
39
|
+
const current = stack.pop();
|
|
40
|
+
if (current.type === 'script_element') {
|
|
41
|
+
extractScriptBlock(current, scriptBlocks);
|
|
42
|
+
}
|
|
43
|
+
if (current.type === 'element' || current.type === 'self_closing_tag') {
|
|
44
|
+
extractEventHandlers(current, eventHandlers);
|
|
45
|
+
}
|
|
46
|
+
for (let i = current.childCount - 1; i >= 0; i--) {
|
|
47
|
+
const child = current.child(i);
|
|
48
|
+
if (child)
|
|
49
|
+
stack.push(child);
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-extractor.js","sourceRoot":"","sources":["../../../src/analysis/html/html-extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0CH,iDAAiD;AACjD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa;IAClE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc;IAC3D,WAAW,EAAE,SAAS,EAAE,YAAY;IACpC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SA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AC;IACzC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,IAAY;IAC/B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5C,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,sEAAsE;AACtE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -4127,11 +4127,13 @@ function disposeTree(tree) {
|
|
|
4127
4127
|
}
|
|
4128
4128
|
}
|
|
4129
4129
|
function walkTree(node, visitor) {
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
const
|
|
4133
|
-
|
|
4134
|
-
|
|
4130
|
+
const stack = [node];
|
|
4131
|
+
while (stack.length > 0) {
|
|
4132
|
+
const current = stack.pop();
|
|
4133
|
+
visitor(current);
|
|
4134
|
+
for (let i2 = current.childCount - 1; i2 >= 0; i2--) {
|
|
4135
|
+
const child = current.child(i2);
|
|
4136
|
+
if (child) stack.push(child);
|
|
4135
4137
|
}
|
|
4136
4138
|
}
|
|
4137
4139
|
}
|
|
@@ -16032,8 +16034,10 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
16032
16034
|
* These are variables declared directly in the class body, not inside methods.
|
|
16033
16035
|
*/
|
|
16034
16036
|
collectClassFields(root) {
|
|
16035
|
-
const
|
|
16036
|
-
|
|
16037
|
+
const stack = [root];
|
|
16038
|
+
while (stack.length > 0) {
|
|
16039
|
+
const n = stack.pop();
|
|
16040
|
+
if (!n) continue;
|
|
16037
16041
|
if (n.type === "class_body") {
|
|
16038
16042
|
for (const child of n.children) {
|
|
16039
16043
|
if (child.type === "field_declaration") {
|
|
@@ -16047,32 +16051,28 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
16047
16051
|
}
|
|
16048
16052
|
}
|
|
16049
16053
|
}
|
|
16050
|
-
|
|
16051
|
-
traverse(child, true, true);
|
|
16052
|
-
} else {
|
|
16053
|
-
traverse(child, true, false);
|
|
16054
|
-
}
|
|
16054
|
+
stack.push(child);
|
|
16055
16055
|
}
|
|
16056
|
-
|
|
16056
|
+
continue;
|
|
16057
16057
|
}
|
|
16058
16058
|
for (const child of n.children) {
|
|
16059
|
-
|
|
16059
|
+
stack.push(child);
|
|
16060
16060
|
}
|
|
16061
|
-
}
|
|
16062
|
-
traverse(root, false, false);
|
|
16061
|
+
}
|
|
16063
16062
|
}
|
|
16064
16063
|
findAllMethods(node) {
|
|
16065
16064
|
const methods = [];
|
|
16066
|
-
const
|
|
16067
|
-
|
|
16065
|
+
const stack = [node];
|
|
16066
|
+
while (stack.length > 0) {
|
|
16067
|
+
const n = stack.pop();
|
|
16068
|
+
if (!n) continue;
|
|
16068
16069
|
if (n.type === "method_declaration" || n.type === "function_declaration") {
|
|
16069
16070
|
methods.push(n);
|
|
16070
16071
|
}
|
|
16071
16072
|
for (const child of n.children) {
|
|
16072
|
-
if (child)
|
|
16073
|
+
if (child) stack.push(child);
|
|
16073
16074
|
}
|
|
16074
|
-
}
|
|
16075
|
-
traverse(node);
|
|
16075
|
+
}
|
|
16076
16076
|
return methods;
|
|
16077
16077
|
}
|
|
16078
16078
|
getMethodName(method) {
|
|
@@ -16123,9 +16123,24 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
16123
16123
|
// AST Visitor
|
|
16124
16124
|
// ===========================================================================
|
|
16125
16125
|
visit(node) {
|
|
16126
|
+
const stack = [node];
|
|
16127
|
+
while (stack.length > 0) {
|
|
16128
|
+
const current = stack.pop();
|
|
16129
|
+
if (this.visitOne(current)) continue;
|
|
16130
|
+
for (let i2 = current.children.length - 1; i2 >= 0; i2--) {
|
|
16131
|
+
stack.push(current.children[i2]);
|
|
16132
|
+
}
|
|
16133
|
+
}
|
|
16134
|
+
}
|
|
16135
|
+
/**
|
|
16136
|
+
* Visit a single node. Returns true if the handler already descended into
|
|
16137
|
+
* children (and the caller should NOT push them), false to fall through to
|
|
16138
|
+
* the default pre-order descent.
|
|
16139
|
+
*/
|
|
16140
|
+
visitOne(node) {
|
|
16126
16141
|
const line = getNodeLine(node);
|
|
16127
16142
|
if (this.unreachableLines.has(line)) {
|
|
16128
|
-
return;
|
|
16143
|
+
return true;
|
|
16129
16144
|
}
|
|
16130
16145
|
if (this.conditionStack.length > 0 && !this.lineConditions.has(line)) {
|
|
16131
16146
|
this.lineConditions.set(line, this.conditionStack[this.conditionStack.length - 1]);
|
|
@@ -16134,43 +16149,41 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
16134
16149
|
case "method_declaration":
|
|
16135
16150
|
case "constructor_declaration":
|
|
16136
16151
|
this.handleMethodDeclaration(node);
|
|
16137
|
-
return;
|
|
16152
|
+
return true;
|
|
16138
16153
|
// Don't visit children directly, handleMethodDeclaration does it
|
|
16139
16154
|
case "local_variable_declaration":
|
|
16140
16155
|
this.handleVariableDeclaration(node);
|
|
16141
|
-
|
|
16156
|
+
return false;
|
|
16142
16157
|
case "assignment_expression":
|
|
16143
16158
|
this.handleAssignment(node);
|
|
16144
|
-
|
|
16159
|
+
return false;
|
|
16145
16160
|
case "update_expression":
|
|
16146
16161
|
this.handleUpdateExpression(node);
|
|
16147
|
-
|
|
16162
|
+
return false;
|
|
16148
16163
|
case "if_statement":
|
|
16149
16164
|
this.handleIfStatement(node);
|
|
16150
|
-
return;
|
|
16165
|
+
return true;
|
|
16151
16166
|
case "switch_expression":
|
|
16152
16167
|
case "switch_statement":
|
|
16153
16168
|
this.handleSwitch(node);
|
|
16154
|
-
return;
|
|
16169
|
+
return true;
|
|
16155
16170
|
case "ternary_expression":
|
|
16156
16171
|
this.handleTernary(node);
|
|
16157
|
-
|
|
16172
|
+
return false;
|
|
16158
16173
|
case "expression_statement":
|
|
16159
16174
|
this.handleExpressionStatement(node);
|
|
16160
|
-
|
|
16175
|
+
return false;
|
|
16161
16176
|
case "for_statement":
|
|
16162
16177
|
case "enhanced_for_statement":
|
|
16163
16178
|
case "while_statement":
|
|
16164
16179
|
case "do_statement":
|
|
16165
16180
|
this.handleLoopStatement(node);
|
|
16166
|
-
return;
|
|
16181
|
+
return true;
|
|
16167
16182
|
case "synchronized_statement":
|
|
16168
16183
|
this.handleSynchronizedStatement(node);
|
|
16169
|
-
return;
|
|
16184
|
+
return true;
|
|
16170
16185
|
default:
|
|
16171
|
-
|
|
16172
|
-
this.visit(child);
|
|
16173
|
-
}
|
|
16186
|
+
return false;
|
|
16174
16187
|
}
|
|
16175
16188
|
}
|
|
16176
16189
|
/**
|
|
@@ -16938,6 +16951,19 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
16938
16951
|
return null;
|
|
16939
16952
|
}
|
|
16940
16953
|
isTaintedExpression(node) {
|
|
16954
|
+
const stack = [node];
|
|
16955
|
+
while (stack.length > 0) {
|
|
16956
|
+
const current = stack.pop();
|
|
16957
|
+
const result = this.isTaintedExpressionStep(current);
|
|
16958
|
+
if (result === true) return true;
|
|
16959
|
+
if (result === false) continue;
|
|
16960
|
+
for (let i2 = current.children.length - 1; i2 >= 0; i2--) {
|
|
16961
|
+
stack.push(current.children[i2]);
|
|
16962
|
+
}
|
|
16963
|
+
}
|
|
16964
|
+
return false;
|
|
16965
|
+
}
|
|
16966
|
+
isTaintedExpressionStep(node) {
|
|
16941
16967
|
const text = getNodeText2(node, this.source);
|
|
16942
16968
|
if (node.type === "method_invocation") {
|
|
16943
16969
|
const nameNode = node.childForFieldName("name");
|
|
@@ -17197,12 +17223,7 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
17197
17223
|
}
|
|
17198
17224
|
return isTainted;
|
|
17199
17225
|
}
|
|
17200
|
-
|
|
17201
|
-
if (this.isTaintedExpression(child)) {
|
|
17202
|
-
return true;
|
|
17203
|
-
}
|
|
17204
|
-
}
|
|
17205
|
-
return false;
|
|
17226
|
+
return void 0;
|
|
17206
17227
|
}
|
|
17207
17228
|
checkCollectionTaint(node) {
|
|
17208
17229
|
const objectNode = node.childForFieldName("object");
|
|
@@ -17526,19 +17547,17 @@ var BaseLanguagePlugin = class {
|
|
|
17526
17547
|
*/
|
|
17527
17548
|
findNodes(root, type) {
|
|
17528
17549
|
const nodes = [];
|
|
17529
|
-
const
|
|
17530
|
-
|
|
17531
|
-
|
|
17532
|
-
|
|
17550
|
+
const stack = [root];
|
|
17551
|
+
while (stack.length > 0) {
|
|
17552
|
+
const node = stack.pop();
|
|
17553
|
+
if (node.type === type) {
|
|
17554
|
+
nodes.push(node);
|
|
17533
17555
|
}
|
|
17534
|
-
|
|
17535
|
-
|
|
17536
|
-
|
|
17537
|
-
} while (cursor.gotoNextSibling());
|
|
17538
|
-
cursor.gotoParent();
|
|
17556
|
+
for (let i2 = node.childCount - 1; i2 >= 0; i2--) {
|
|
17557
|
+
const child = node.child(i2);
|
|
17558
|
+
if (child) stack.push(child);
|
|
17539
17559
|
}
|
|
17540
|
-
}
|
|
17541
|
-
visit();
|
|
17560
|
+
}
|
|
17542
17561
|
return nodes;
|
|
17543
17562
|
}
|
|
17544
17563
|
/**
|
|
@@ -17894,16 +17913,17 @@ var JavaPlugin = class extends BaseLanguagePlugin {
|
|
|
17894
17913
|
}
|
|
17895
17914
|
}
|
|
17896
17915
|
};
|
|
17897
|
-
const
|
|
17916
|
+
const stack = [tree.rootNode];
|
|
17917
|
+
while (stack.length > 0) {
|
|
17918
|
+
const node = stack.pop();
|
|
17898
17919
|
if (node.type === "field_declaration" || node.type === "local_variable_declaration") {
|
|
17899
17920
|
collectDecl(node);
|
|
17900
17921
|
}
|
|
17901
17922
|
for (let i2 = 0; i2 < node.childCount; i2++) {
|
|
17902
17923
|
const child = node.child(i2);
|
|
17903
|
-
if (child)
|
|
17924
|
+
if (child) stack.push(child);
|
|
17904
17925
|
}
|
|
17905
|
-
}
|
|
17906
|
-
walk(tree.rootNode);
|
|
17926
|
+
}
|
|
17907
17927
|
this._typeMapCache.set(tree, map);
|
|
17908
17928
|
return map;
|
|
17909
17929
|
}
|
|
@@ -20700,16 +20720,18 @@ function extractHtmlContent(rootNode) {
|
|
|
20700
20720
|
return { scriptBlocks, eventHandlers };
|
|
20701
20721
|
}
|
|
20702
20722
|
function walkNode(node, scriptBlocks, eventHandlers) {
|
|
20703
|
-
|
|
20704
|
-
|
|
20705
|
-
|
|
20706
|
-
|
|
20707
|
-
|
|
20708
|
-
|
|
20709
|
-
|
|
20710
|
-
|
|
20711
|
-
|
|
20712
|
-
|
|
20723
|
+
const stack = [node];
|
|
20724
|
+
while (stack.length > 0) {
|
|
20725
|
+
const current = stack.pop();
|
|
20726
|
+
if (current.type === "script_element") {
|
|
20727
|
+
extractScriptBlock(current, scriptBlocks);
|
|
20728
|
+
}
|
|
20729
|
+
if (current.type === "element" || current.type === "self_closing_tag") {
|
|
20730
|
+
extractEventHandlers(current, eventHandlers);
|
|
20731
|
+
}
|
|
20732
|
+
for (let i2 = current.childCount - 1; i2 >= 0; i2--) {
|
|
20733
|
+
const child = current.child(i2);
|
|
20734
|
+
if (child) stack.push(child);
|
|
20713
20735
|
}
|
|
20714
20736
|
}
|
|
20715
20737
|
}
|
|
@@ -20806,13 +20828,15 @@ function runHtmlAttributeSecurityChecks(rootNode, filePath) {
|
|
|
20806
20828
|
return findings;
|
|
20807
20829
|
}
|
|
20808
20830
|
function walkForSecurityChecks(node, filePath, findings) {
|
|
20809
|
-
|
|
20810
|
-
|
|
20811
|
-
|
|
20812
|
-
|
|
20813
|
-
|
|
20814
|
-
|
|
20815
|
-
|
|
20831
|
+
const stack = [node];
|
|
20832
|
+
while (stack.length > 0) {
|
|
20833
|
+
const current = stack.pop();
|
|
20834
|
+
if (current.type === "element" || current.type === "self_closing_tag" || current.type === "script_element" || current.type === "style_element") {
|
|
20835
|
+
checkElement(current, filePath, findings);
|
|
20836
|
+
}
|
|
20837
|
+
for (let i2 = current.childCount - 1; i2 >= 0; i2--) {
|
|
20838
|
+
const child = current.child(i2);
|
|
20839
|
+
if (child) stack.push(child);
|
|
20816
20840
|
}
|
|
20817
20841
|
}
|
|
20818
20842
|
}
|
|
@@ -4152,11 +4152,13 @@ async function parse(code, language) {
|
|
|
4152
4152
|
return tree;
|
|
4153
4153
|
}
|
|
4154
4154
|
function walkTree(node, visitor) {
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
const
|
|
4158
|
-
|
|
4159
|
-
|
|
4155
|
+
const stack = [node];
|
|
4156
|
+
while (stack.length > 0) {
|
|
4157
|
+
const current = stack.pop();
|
|
4158
|
+
visitor(current);
|
|
4159
|
+
for (let i2 = current.childCount - 1; i2 >= 0; i2--) {
|
|
4160
|
+
const child = current.child(i2);
|
|
4161
|
+
if (child) stack.push(child);
|
|
4160
4162
|
}
|
|
4161
4163
|
}
|
|
4162
4164
|
}
|
|
@@ -13972,8 +13974,10 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
13972
13974
|
* These are variables declared directly in the class body, not inside methods.
|
|
13973
13975
|
*/
|
|
13974
13976
|
collectClassFields(root) {
|
|
13975
|
-
const
|
|
13976
|
-
|
|
13977
|
+
const stack = [root];
|
|
13978
|
+
while (stack.length > 0) {
|
|
13979
|
+
const n = stack.pop();
|
|
13980
|
+
if (!n) continue;
|
|
13977
13981
|
if (n.type === "class_body") {
|
|
13978
13982
|
for (const child of n.children) {
|
|
13979
13983
|
if (child.type === "field_declaration") {
|
|
@@ -13987,32 +13991,28 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
13987
13991
|
}
|
|
13988
13992
|
}
|
|
13989
13993
|
}
|
|
13990
|
-
|
|
13991
|
-
traverse(child, true, true);
|
|
13992
|
-
} else {
|
|
13993
|
-
traverse(child, true, false);
|
|
13994
|
-
}
|
|
13994
|
+
stack.push(child);
|
|
13995
13995
|
}
|
|
13996
|
-
|
|
13996
|
+
continue;
|
|
13997
13997
|
}
|
|
13998
13998
|
for (const child of n.children) {
|
|
13999
|
-
|
|
13999
|
+
stack.push(child);
|
|
14000
14000
|
}
|
|
14001
|
-
}
|
|
14002
|
-
traverse(root, false, false);
|
|
14001
|
+
}
|
|
14003
14002
|
}
|
|
14004
14003
|
findAllMethods(node) {
|
|
14005
14004
|
const methods = [];
|
|
14006
|
-
const
|
|
14007
|
-
|
|
14005
|
+
const stack = [node];
|
|
14006
|
+
while (stack.length > 0) {
|
|
14007
|
+
const n = stack.pop();
|
|
14008
|
+
if (!n) continue;
|
|
14008
14009
|
if (n.type === "method_declaration" || n.type === "function_declaration") {
|
|
14009
14010
|
methods.push(n);
|
|
14010
14011
|
}
|
|
14011
14012
|
for (const child of n.children) {
|
|
14012
|
-
if (child)
|
|
14013
|
+
if (child) stack.push(child);
|
|
14013
14014
|
}
|
|
14014
|
-
}
|
|
14015
|
-
traverse(node);
|
|
14015
|
+
}
|
|
14016
14016
|
return methods;
|
|
14017
14017
|
}
|
|
14018
14018
|
getMethodName(method) {
|
|
@@ -14063,9 +14063,24 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
14063
14063
|
// AST Visitor
|
|
14064
14064
|
// ===========================================================================
|
|
14065
14065
|
visit(node) {
|
|
14066
|
+
const stack = [node];
|
|
14067
|
+
while (stack.length > 0) {
|
|
14068
|
+
const current = stack.pop();
|
|
14069
|
+
if (this.visitOne(current)) continue;
|
|
14070
|
+
for (let i2 = current.children.length - 1; i2 >= 0; i2--) {
|
|
14071
|
+
stack.push(current.children[i2]);
|
|
14072
|
+
}
|
|
14073
|
+
}
|
|
14074
|
+
}
|
|
14075
|
+
/**
|
|
14076
|
+
* Visit a single node. Returns true if the handler already descended into
|
|
14077
|
+
* children (and the caller should NOT push them), false to fall through to
|
|
14078
|
+
* the default pre-order descent.
|
|
14079
|
+
*/
|
|
14080
|
+
visitOne(node) {
|
|
14066
14081
|
const line = getNodeLine(node);
|
|
14067
14082
|
if (this.unreachableLines.has(line)) {
|
|
14068
|
-
return;
|
|
14083
|
+
return true;
|
|
14069
14084
|
}
|
|
14070
14085
|
if (this.conditionStack.length > 0 && !this.lineConditions.has(line)) {
|
|
14071
14086
|
this.lineConditions.set(line, this.conditionStack[this.conditionStack.length - 1]);
|
|
@@ -14074,43 +14089,41 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
14074
14089
|
case "method_declaration":
|
|
14075
14090
|
case "constructor_declaration":
|
|
14076
14091
|
this.handleMethodDeclaration(node);
|
|
14077
|
-
return;
|
|
14092
|
+
return true;
|
|
14078
14093
|
// Don't visit children directly, handleMethodDeclaration does it
|
|
14079
14094
|
case "local_variable_declaration":
|
|
14080
14095
|
this.handleVariableDeclaration(node);
|
|
14081
|
-
|
|
14096
|
+
return false;
|
|
14082
14097
|
case "assignment_expression":
|
|
14083
14098
|
this.handleAssignment(node);
|
|
14084
|
-
|
|
14099
|
+
return false;
|
|
14085
14100
|
case "update_expression":
|
|
14086
14101
|
this.handleUpdateExpression(node);
|
|
14087
|
-
|
|
14102
|
+
return false;
|
|
14088
14103
|
case "if_statement":
|
|
14089
14104
|
this.handleIfStatement(node);
|
|
14090
|
-
return;
|
|
14105
|
+
return true;
|
|
14091
14106
|
case "switch_expression":
|
|
14092
14107
|
case "switch_statement":
|
|
14093
14108
|
this.handleSwitch(node);
|
|
14094
|
-
return;
|
|
14109
|
+
return true;
|
|
14095
14110
|
case "ternary_expression":
|
|
14096
14111
|
this.handleTernary(node);
|
|
14097
|
-
|
|
14112
|
+
return false;
|
|
14098
14113
|
case "expression_statement":
|
|
14099
14114
|
this.handleExpressionStatement(node);
|
|
14100
|
-
|
|
14115
|
+
return false;
|
|
14101
14116
|
case "for_statement":
|
|
14102
14117
|
case "enhanced_for_statement":
|
|
14103
14118
|
case "while_statement":
|
|
14104
14119
|
case "do_statement":
|
|
14105
14120
|
this.handleLoopStatement(node);
|
|
14106
|
-
return;
|
|
14121
|
+
return true;
|
|
14107
14122
|
case "synchronized_statement":
|
|
14108
14123
|
this.handleSynchronizedStatement(node);
|
|
14109
|
-
return;
|
|
14124
|
+
return true;
|
|
14110
14125
|
default:
|
|
14111
|
-
|
|
14112
|
-
this.visit(child);
|
|
14113
|
-
}
|
|
14126
|
+
return false;
|
|
14114
14127
|
}
|
|
14115
14128
|
}
|
|
14116
14129
|
/**
|
|
@@ -14878,6 +14891,19 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
14878
14891
|
return null;
|
|
14879
14892
|
}
|
|
14880
14893
|
isTaintedExpression(node) {
|
|
14894
|
+
const stack = [node];
|
|
14895
|
+
while (stack.length > 0) {
|
|
14896
|
+
const current = stack.pop();
|
|
14897
|
+
const result = this.isTaintedExpressionStep(current);
|
|
14898
|
+
if (result === true) return true;
|
|
14899
|
+
if (result === false) continue;
|
|
14900
|
+
for (let i2 = current.children.length - 1; i2 >= 0; i2--) {
|
|
14901
|
+
stack.push(current.children[i2]);
|
|
14902
|
+
}
|
|
14903
|
+
}
|
|
14904
|
+
return false;
|
|
14905
|
+
}
|
|
14906
|
+
isTaintedExpressionStep(node) {
|
|
14881
14907
|
const text = getNodeText2(node, this.source);
|
|
14882
14908
|
if (node.type === "method_invocation") {
|
|
14883
14909
|
const nameNode = node.childForFieldName("name");
|
|
@@ -15137,12 +15163,7 @@ var ConstantPropagator = class _ConstantPropagator {
|
|
|
15137
15163
|
}
|
|
15138
15164
|
return isTainted;
|
|
15139
15165
|
}
|
|
15140
|
-
|
|
15141
|
-
if (this.isTaintedExpression(child)) {
|
|
15142
|
-
return true;
|
|
15143
|
-
}
|
|
15144
|
-
}
|
|
15145
|
-
return false;
|
|
15166
|
+
return void 0;
|
|
15146
15167
|
}
|
|
15147
15168
|
checkCollectionTaint(node) {
|
|
15148
15169
|
const objectNode = node.childForFieldName("object");
|