cognium-dev 3.74.0 → 3.77.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 +60 -2
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -11388,6 +11388,12 @@ var DEFAULT_SINKS = [
11388
11388
  { method: "redirect", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [0], languages: ["javascript", "typescript"] },
11389
11389
  { method: "Set", class: "Header", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [1], languages: ["go"] },
11390
11390
  { method: "Add", class: "Header", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [1], languages: ["go"] },
11391
+ { method: "set", class: "headers", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [1], languages: ["python"] },
11392
+ { method: "add", class: "headers", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [1], languages: ["python"] },
11393
+ { method: "setdefault", class: "headers", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [1], languages: ["python"] },
11394
+ { method: "extend", class: "headers", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [0], languages: ["python"] },
11395
+ { method: "__setitem__", class: "headers", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [1], languages: ["python"] },
11396
+ { method: "set_cookie", type: "crlf", cwe: "CWE-113", severity: "medium", arg_positions: [1], languages: ["python"] },
11391
11397
  { method: "assign", class: "Object", type: "mass_assignment", cwe: "CWE-1321", severity: "high", arg_positions: [1, 2, 3], languages: ["javascript", "typescript"] },
11392
11398
  { method: "defineProperty", class: "Object", type: "mass_assignment", cwe: "CWE-1321", severity: "high", arg_positions: [1, 2], languages: ["javascript", "typescript"] },
11393
11399
  { method: "defineProperties", class: "Object", type: "mass_assignment", cwe: "CWE-1321", severity: "high", arg_positions: [1], languages: ["javascript", "typescript"] },
@@ -12408,6 +12414,10 @@ function receiverMightBeClass(receiver, className) {
12408
12414
  }
12409
12415
  }
12410
12416
  }
12417
+ const chainedCallSuffix = `.${className}()`;
12418
+ if (receiver.endsWith(chainedCallSuffix) || receiver.toLowerCase().endsWith(chainedCallSuffix.toLowerCase())) {
12419
+ return true;
12420
+ }
12411
12421
  if (receiver.includes("::")) {
12412
12422
  const scopePrefix = receiver.match(/^(\w+)::/);
12413
12423
  if (scopePrefix) {
@@ -23723,6 +23733,48 @@ function detectExpressionScanFlows(calls, sources, sinks, sanitizers, unreachabl
23723
23733
  }
23724
23734
  }
23725
23735
  }
23736
+ const aliasChains = [];
23737
+ {
23738
+ const codeLines2 = code.split(`
23739
+ `);
23740
+ for (let i2 = 0;i2 < codeLines2.length; i2++) {
23741
+ const ln = codeLines2[i2];
23742
+ if (ln.trimStart().startsWith("#"))
23743
+ continue;
23744
+ const m = ln.match(/^\s*([\p{L}\p{N}_]+)\s*=\s*([\p{L}\p{N}_]+)\s*$/u);
23745
+ if (!m)
23746
+ continue;
23747
+ const lineNum = i2 + 1;
23748
+ const lhs = m[1];
23749
+ if (derived.get(lhs) !== lineNum)
23750
+ continue;
23751
+ aliasChains.push({ lhs, upstream: m[2], line: lineNum });
23752
+ }
23753
+ }
23754
+ if (aliasChains.length > 0) {
23755
+ let changed = true;
23756
+ let guard = 0;
23757
+ while (changed && guard < aliasChains.length + 2) {
23758
+ changed = false;
23759
+ guard++;
23760
+ for (const { lhs, upstream } of aliasChains) {
23761
+ const upCov = aliasSanitizedFor.get(upstream);
23762
+ if (!upCov || upCov.size === 0)
23763
+ continue;
23764
+ let downCov = aliasSanitizedFor.get(lhs);
23765
+ if (!downCov) {
23766
+ downCov = new Set;
23767
+ aliasSanitizedFor.set(lhs, downCov);
23768
+ }
23769
+ for (const t of upCov) {
23770
+ if (!downCov.has(t)) {
23771
+ downCov.add(t);
23772
+ changed = true;
23773
+ }
23774
+ }
23775
+ }
23776
+ }
23777
+ }
23726
23778
  }
23727
23779
  }
23728
23780
  if (language === "rust" && typeof code === "string" && sourcesWithVar.length > 0) {
@@ -29929,6 +29981,12 @@ class WeakRandomPass {
29929
29981
  return `${rt}.${method}`;
29930
29982
  }
29931
29983
  }
29984
+ if (JAVA_RANDOM_METHODS.has(method)) {
29985
+ if (/^new\s+Random\s*\(/.test(receiver))
29986
+ return `new Random.${method}`;
29987
+ if (/^new\s+SplittableRandom\s*\(/.test(receiver))
29988
+ return `new SplittableRandom.${method}`;
29989
+ }
29932
29990
  if (JAVA_RANDOM_METHODS.has(method) && /ThreadLocalRandom\.current\(\)/.test(receiver)) {
29933
29991
  return `ThreadLocalRandom.current.${method}`;
29934
29992
  }
@@ -30773,7 +30831,7 @@ class JwtVerifyDisabledPass {
30773
30831
  out2.push({ pattern: "Algorithm.none()", api: "JWT.require" });
30774
30832
  }
30775
30833
  }
30776
- if (method === "parse" && receiver.includes("parser")) {
30834
+ if (method === "parse" && /\bJwts\s*\.\s*parser\s*\(/.test(receiver)) {
30777
30835
  out2.push({ pattern: "parse() instead of parseClaimsJws()", api: "Jwts.parser().parse" });
30778
30836
  }
30779
30837
  return out2;
@@ -32482,7 +32540,7 @@ var colors = {
32482
32540
  };
32483
32541
 
32484
32542
  // src/version.ts
32485
- var version = "3.74.0";
32543
+ var version = "3.77.0";
32486
32544
 
32487
32545
  // src/formatters.ts
32488
32546
  var SINK_SEVERITY = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognium-dev",
3
- "version": "3.74.0",
3
+ "version": "3.77.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.74.0"
68
+ "circle-ir": "^3.77.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/node": "^25.5.0",