cognium-dev 3.90.0 → 3.90.1
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/cli.js +48 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -15075,8 +15075,17 @@ class AnalysisPipeline {
|
|
|
15075
15075
|
return findings;
|
|
15076
15076
|
}
|
|
15077
15077
|
};
|
|
15078
|
+
const timingEnabled = globalThis.__circleIrPassTiming === true;
|
|
15078
15079
|
for (const pass of this.passes) {
|
|
15080
|
+
if (timingEnabled) {
|
|
15081
|
+
console.error(`[pass-start] ${pass.name} file=${graph.ir.meta.file}`);
|
|
15082
|
+
}
|
|
15083
|
+
const t0 = timingEnabled ? Date.now() : 0;
|
|
15079
15084
|
const result = pass.run(context);
|
|
15085
|
+
if (timingEnabled) {
|
|
15086
|
+
const dt = Date.now() - t0;
|
|
15087
|
+
console.error(`[pass-timing] ${pass.name} ${dt}ms file=${graph.ir.meta.file}`);
|
|
15088
|
+
}
|
|
15080
15089
|
results.set(pass.name, result);
|
|
15081
15090
|
}
|
|
15082
15091
|
return { results, findings };
|
|
@@ -15857,6 +15866,7 @@ class ConstantPropagator {
|
|
|
15857
15866
|
inConstructor = false;
|
|
15858
15867
|
constructorParamPositions = new Map;
|
|
15859
15868
|
safePatternFieldsCache = null;
|
|
15869
|
+
isTaintedExpressionCache = null;
|
|
15860
15870
|
analyze(tree, sourceCode, additionalTaintPatterns = [], sanitizerMethods = [], taintedParameters = []) {
|
|
15861
15871
|
this.source = sourceCode;
|
|
15862
15872
|
this.additionalTaintPatterns = additionalTaintPatterns;
|
|
@@ -15888,6 +15898,7 @@ class ConstantPropagator {
|
|
|
15888
15898
|
this.inConstructor = false;
|
|
15889
15899
|
this.constructorParamPositions.clear();
|
|
15890
15900
|
this.safePatternFieldsCache = null;
|
|
15901
|
+
this.isTaintedExpressionCache = null;
|
|
15891
15902
|
this.collectClassFields(tree.rootNode);
|
|
15892
15903
|
for (const methodName of sanitizerMethods) {
|
|
15893
15904
|
this.methodReturnsSanitized.add(methodName);
|
|
@@ -17237,18 +17248,52 @@ class ConstantPropagator {
|
|
|
17237
17248
|
return null;
|
|
17238
17249
|
}
|
|
17239
17250
|
isTaintedExpression(node) {
|
|
17251
|
+
const isTopLevel = this.isTaintedExpressionCache === null;
|
|
17252
|
+
if (isTopLevel) {
|
|
17253
|
+
this.isTaintedExpressionCache = new Map;
|
|
17254
|
+
}
|
|
17255
|
+
try {
|
|
17256
|
+
return this.isTaintedExpressionImpl(node);
|
|
17257
|
+
} finally {
|
|
17258
|
+
if (isTopLevel) {
|
|
17259
|
+
this.isTaintedExpressionCache = null;
|
|
17260
|
+
}
|
|
17261
|
+
}
|
|
17262
|
+
}
|
|
17263
|
+
isTaintedExpressionImpl(node) {
|
|
17264
|
+
const cache = this.isTaintedExpressionCache;
|
|
17265
|
+
const rootId = node.id;
|
|
17266
|
+
const cachedRoot = cache.get(rootId);
|
|
17267
|
+
if (cachedRoot !== undefined) {
|
|
17268
|
+
return cachedRoot;
|
|
17269
|
+
}
|
|
17240
17270
|
const stack = [node];
|
|
17241
17271
|
while (stack.length > 0) {
|
|
17242
17272
|
const current = stack.pop();
|
|
17273
|
+
const currentId = current.id;
|
|
17274
|
+
const cached = cache.get(currentId);
|
|
17275
|
+
if (cached !== undefined) {
|
|
17276
|
+
if (cached) {
|
|
17277
|
+
cache.set(rootId, true);
|
|
17278
|
+
return true;
|
|
17279
|
+
}
|
|
17280
|
+
continue;
|
|
17281
|
+
}
|
|
17243
17282
|
const result = this.isTaintedExpressionStep(current);
|
|
17244
|
-
if (result === true)
|
|
17283
|
+
if (result === true) {
|
|
17284
|
+
cache.set(currentId, true);
|
|
17285
|
+
cache.set(rootId, true);
|
|
17245
17286
|
return true;
|
|
17246
|
-
|
|
17287
|
+
}
|
|
17288
|
+
if (result === false) {
|
|
17289
|
+
cache.set(currentId, false);
|
|
17247
17290
|
continue;
|
|
17291
|
+
}
|
|
17248
17292
|
for (let i2 = current.children.length - 1;i2 >= 0; i2--) {
|
|
17249
17293
|
stack.push(current.children[i2]);
|
|
17250
17294
|
}
|
|
17251
17295
|
}
|
|
17296
|
+
cache.set(rootId, false);
|
|
17252
17297
|
return false;
|
|
17253
17298
|
}
|
|
17254
17299
|
isTaintedExpressionStep(node) {
|
|
@@ -34472,7 +34517,7 @@ var colors = {
|
|
|
34472
34517
|
};
|
|
34473
34518
|
|
|
34474
34519
|
// src/version.ts
|
|
34475
|
-
var version = "3.90.
|
|
34520
|
+
var version = "3.90.1";
|
|
34476
34521
|
|
|
34477
34522
|
// src/formatters.ts
|
|
34478
34523
|
var SINK_SEVERITY = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cognium-dev",
|
|
3
|
-
"version": "3.90.
|
|
3
|
+
"version": "3.90.1",
|
|
4
4
|
"description": "Static Application Security Testing CLI for detecting security vulnerabilities via taint tracking",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"registry": "https://registry.npmjs.org/"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"circle-ir": "^3.90.
|
|
68
|
+
"circle-ir": "^3.90.1"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^25.5.0",
|