cognium-dev 4.9.23 → 4.9.24

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 +46 -8
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -16846,6 +16846,9 @@ function buildFileIndex(ir) {
16846
16846
  }
16847
16847
  return { callsByLine, defsByLine, usesByLine, callsByMethod, sinksByMethod, defsByMethod };
16848
16848
  }
16849
+ function escapeRegExp(s) {
16850
+ return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16851
+ }
16849
16852
 
16850
16853
  class CrossFileResolver {
16851
16854
  fileIndexes = new WeakMap;
@@ -17214,7 +17217,7 @@ class CrossFileResolver {
17214
17217
  candidates.push(arg.variable);
17215
17218
  if (arg.expression) {
17216
17219
  for (const [name2] of paramNameToIndex) {
17217
- const re = new RegExp(`\\b${name2}\\b`);
17220
+ const re = new RegExp(`\\b${escapeRegExp(name2)}\\b`);
17218
17221
  if (re.test(arg.expression))
17219
17222
  candidates.push(name2);
17220
17223
  }
@@ -17298,7 +17301,7 @@ class CrossFileResolver {
17298
17301
  }
17299
17302
  if (arg.expression) {
17300
17303
  for (const v of reachable.names) {
17301
- if (new RegExp(`\\b${v}\\b`).test(arg.expression)) {
17304
+ if (new RegExp(`\\b${escapeRegExp(v)}\\b`).test(arg.expression)) {
17302
17305
  matchedName = v;
17303
17306
  break;
17304
17307
  }
@@ -17729,7 +17732,7 @@ class CrossFileResolver {
17729
17732
  }
17730
17733
  if (arg.expression) {
17731
17734
  for (const [tv, origin] of tainted) {
17732
- const re = new RegExp(`\\b${tv}\\b`);
17735
+ const re = new RegExp(`\\b${escapeRegExp(tv)}\\b`);
17733
17736
  if (re.test(arg.expression))
17734
17737
  return { var: tv, origin };
17735
17738
  }
@@ -37658,7 +37661,7 @@ function detectExpressionScanFlows(calls, sources, sinks, sanitizers, unreachabl
37658
37661
  for (const other of taintedVars) {
37659
37662
  if (other === varName)
37660
37663
  continue;
37661
- const re = new RegExp(`\\b${other}\\b`);
37664
+ const re = new RegExp(`\\b${other.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`);
37662
37665
  if (!re.test(rhs))
37663
37666
  continue;
37664
37667
  anyReferenced = true;
@@ -37889,7 +37892,7 @@ function detectExpressionScanFlows(calls, sources, sinks, sanitizers, unreachabl
37889
37892
  }
37890
37893
  const assignMatch = sinkCode.match(/^\s*(?:[A-Za-z_][\w.<>[\]\s,?]*\s+)?[A-Za-z_]\w*\s*=(?!=)\s*/);
37891
37894
  const rhs = assignMatch ? sinkCode.slice(assignMatch[0].length) : sinkCode;
37892
- if (new RegExp(`\\b${sourceVar}\\b`).test(rhs)) {
37895
+ if (new RegExp(`\\b${sourceVar.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\b`).test(rhs)) {
37893
37896
  continue;
37894
37897
  }
37895
37898
  }
@@ -48608,6 +48611,20 @@ function computeProjectProfileSummary(fileAnalyses) {
48608
48611
  }
48609
48612
  return { byShape, byEnv, totalFiles: fileAnalyses.length };
48610
48613
  }
48614
+ function longestLineLength(code) {
48615
+ let max = 0, start2 = 0;
48616
+ for (let i2 = 0;i2 < code.length; i2++) {
48617
+ if (code.charCodeAt(i2) === 10) {
48618
+ if (i2 - start2 > max)
48619
+ max = i2 - start2;
48620
+ start2 = i2 + 1;
48621
+ }
48622
+ }
48623
+ if (code.length - start2 > max)
48624
+ max = code.length - start2;
48625
+ return max;
48626
+ }
48627
+ var MAX_ANALYZABLE_LINE_LENGTH = 1e4;
48611
48628
  async function analyze(code, filePath, language, options = {}) {
48612
48629
  if (!initialized) {
48613
48630
  await initAnalyzer(options);
@@ -48659,6 +48676,27 @@ async function analyze(code, filePath, language, options = {}) {
48659
48676
  meta.projectProfile = makeProfileResolver2(options.projectProfile)(filePath);
48660
48677
  }
48661
48678
  phaseEnd("extractMeta", tMeta);
48679
+ if (longestLineLength(code) > MAX_ANALYZABLE_LINE_LENGTH) {
48680
+ logger.warn("Skipping analysis of a minified / single-line file", {
48681
+ filePath,
48682
+ language,
48683
+ codeLength: code.length
48684
+ });
48685
+ return {
48686
+ meta,
48687
+ types: [],
48688
+ calls: [],
48689
+ cfg: { blocks: [], edges: [] },
48690
+ dfg: { defs: [], uses: [], chains: [] },
48691
+ taint: { sources: [], sinks: [], sanitizers: [] },
48692
+ imports: [],
48693
+ exports: [],
48694
+ unresolved: [],
48695
+ enriched: {},
48696
+ metrics: { file: filePath, metrics: [] },
48697
+ parse_status: parseStatus
48698
+ };
48699
+ }
48662
48700
  const tTypes = phaseStart();
48663
48701
  const types = extractTypes(tree, nodeCache, language);
48664
48702
  phaseEnd("extractTypes", tTypes);
@@ -50130,7 +50168,7 @@ var colors = {
50130
50168
  };
50131
50169
 
50132
50170
  // src/version.ts
50133
- var version = "4.9.23";
50171
+ var version = "4.9.24";
50134
50172
 
50135
50173
  // src/formatters.ts
50136
50174
  var LIBRARY_API_SURFACE_TAG2 = "library-api-surface:caller-responsibility";
@@ -50675,8 +50713,8 @@ function generateSarifResults(results, crossFileData) {
50675
50713
 
50676
50714
  // src/build-info.ts
50677
50715
  var buildInfo = {
50678
- gitSha: "e7e65f8",
50679
- builtAt: "2026-09-22T22:15:34.355Z"
50716
+ gitSha: "527cda0",
50717
+ builtAt: "2026-09-23T02:30:52.145Z"
50680
50718
  };
50681
50719
 
50682
50720
  // src/utils/args.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognium-dev",
3
- "version": "4.9.23",
3
+ "version": "4.9.24",
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",
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@cognium/project-profile-detect": "1.1.1",
70
- "circle-ir": "4.9.23"
70
+ "circle-ir": "4.9.24"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/node": "^26.6.1",