cognium-dev 3.95.0 → 3.96.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.
Files changed (2) hide show
  1. package/dist/cli.js +20 -1
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -12125,6 +12125,19 @@ var CWE_78_RECEIVER_ALLOWLIST = new Set([
12125
12125
  "ProcessExecutor",
12126
12126
  "RuntimeUtil"
12127
12127
  ]);
12128
+ function isFunctionCallbackArgument(arg) {
12129
+ if (arg.literal !== null && arg.literal !== undefined)
12130
+ return false;
12131
+ const expr = (arg.expression ?? "").trim();
12132
+ if (expr.length === 0)
12133
+ return false;
12134
+ const body2 = expr.startsWith("async ") ? expr.slice(6).trimStart() : expr;
12135
+ if (body2.startsWith("("))
12136
+ return true;
12137
+ if (/^function\b/.test(body2))
12138
+ return true;
12139
+ return false;
12140
+ }
12128
12141
  function findSinks(calls, patterns, typeHierarchy, language, sourceLines) {
12129
12142
  const sinkMap = new Map;
12130
12143
  for (const call of calls) {
@@ -12157,6 +12170,12 @@ function findSinks(calls, patterns, typeHierarchy, language, sourceLines) {
12157
12170
  }
12158
12171
  }
12159
12172
  }
12173
+ if (pattern.type === "code_injection" && (call.method_name === "setInterval" || call.method_name === "setTimeout")) {
12174
+ const firstArg = call.arguments.find((a) => a.position === 0);
12175
+ if (firstArg && isFunctionCallbackArgument(firstArg)) {
12176
+ continue;
12177
+ }
12178
+ }
12160
12179
  const location = formatCallLocation(call);
12161
12180
  const key = `${location}:${call.location.line}:${pattern.cwe}`;
12162
12181
  const confidence = calculateSinkConfidence(call, pattern);
@@ -34579,7 +34598,7 @@ var colors = {
34579
34598
  };
34580
34599
 
34581
34600
  // src/version.ts
34582
- var version = "3.95.0";
34601
+ var version = "3.96.0";
34583
34602
 
34584
34603
  // src/formatters.ts
34585
34604
  var SINK_SEVERITY = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognium-dev",
3
- "version": "3.95.0",
3
+ "version": "3.96.0",
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.95.0"
68
+ "circle-ir": "^3.96.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/node": "^25.5.0",