cognium-dev 3.151.0 → 3.152.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 +59 -1
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -30609,6 +30609,62 @@ class CliMainReflectionSuppressPass {
30609
30609
  }
30610
30610
  }
30611
30611
 
30612
+ // ../circle-ir/dist/analysis/passes/library-profile-sink-gate-pass.js
30613
+ var DROPPED_SINK_TYPES = new Set([
30614
+ "log_injection"
30615
+ ]);
30616
+ function isLibraryShape2(profile) {
30617
+ if (!profile || profile === "unknown")
30618
+ return false;
30619
+ return profile.startsWith("library/");
30620
+ }
30621
+
30622
+ class LibraryProfileSinkGatePass {
30623
+ name = "library-profile-sink-gate";
30624
+ category = "security";
30625
+ run(ctx) {
30626
+ const { graph } = ctx;
30627
+ const profile = graph.ir.meta.projectProfile;
30628
+ if (!isLibraryShape2(profile)) {
30629
+ return {
30630
+ profile,
30631
+ applied: false,
30632
+ dropped: 0,
30633
+ droppedByType: {}
30634
+ };
30635
+ }
30636
+ const sinks = ctx.hasResult("sink-filter") ? ctx.getResult("sink-filter").sinks : graph.ir.taint.sinks;
30637
+ if (sinks.length === 0) {
30638
+ return {
30639
+ profile,
30640
+ applied: true,
30641
+ dropped: 0,
30642
+ droppedByType: {}
30643
+ };
30644
+ }
30645
+ const droppedByType = {};
30646
+ const kept = [];
30647
+ for (const sink of sinks) {
30648
+ if (DROPPED_SINK_TYPES.has(sink.type)) {
30649
+ droppedByType[sink.type] = (droppedByType[sink.type] ?? 0) + 1;
30650
+ continue;
30651
+ }
30652
+ kept.push(sink);
30653
+ }
30654
+ const dropped = sinks.length - kept.length;
30655
+ if (dropped > 0) {
30656
+ sinks.length = 0;
30657
+ sinks.push(...kept);
30658
+ }
30659
+ return {
30660
+ profile,
30661
+ applied: true,
30662
+ dropped,
30663
+ droppedByType
30664
+ };
30665
+ }
30666
+ }
30667
+
30612
30668
  // ../circle-ir/dist/analysis/passes/taint-propagation-pass.js
30613
30669
  class TaintPropagationPass {
30614
30670
  name = "taint-propagation";
@@ -41725,6 +41781,8 @@ async function analyze(code, filePath, language, options = {}) {
41725
41781
  pipeline.add(new SinkSemanticsPass);
41726
41782
  if (!disabledPasses.has("cli-main-reflection-suppress"))
41727
41783
  pipeline.add(new CliMainReflectionSuppressPass);
41784
+ if (!disabledPasses.has("library-profile-sink-gate"))
41785
+ pipeline.add(new LibraryProfileSinkGatePass);
41728
41786
  pipeline.add(new TaintPropagationPass);
41729
41787
  pipeline.add(new InterproceduralPass({
41730
41788
  enableEntryPointGate: options.enableEntryPointGate ?? true
@@ -42655,7 +42713,7 @@ var colors = {
42655
42713
  };
42656
42714
 
42657
42715
  // src/version.ts
42658
- var version = "3.151.0";
42716
+ var version = "3.152.0";
42659
42717
 
42660
42718
  // src/formatters.ts
42661
42719
  var LIBRARY_API_SURFACE_TAG2 = "library-api-surface:caller-responsibility";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognium-dev",
3
- "version": "3.151.0",
3
+ "version": "3.152.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",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@cognium/project-profile-detect": "^1.1.0",
69
- "circle-ir": "^3.151.0"
69
+ "circle-ir": "^3.152.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/node": "^25.5.0",