cognium-dev 4.5.0 → 4.6.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 +46 -1
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -43906,6 +43906,49 @@ function methodAcceptsHtmlShapedParam(method) {
43906
43906
  return false;
43907
43907
  }
43908
43908
 
43909
+ // ../circle-ir/dist/analysis/passes/insecure-deserialization-config-pass.js
43910
+ var ANY_TYPE_PERMISSION_RE = /\bAnyTypePermission\b/;
43911
+
43912
+ class InsecureDeserializationConfigPass {
43913
+ name = "insecure-deserialization-config";
43914
+ category = "security";
43915
+ run(ctx) {
43916
+ const { graph, language } = ctx;
43917
+ if (language !== "java")
43918
+ return { findings: [] };
43919
+ const file = graph.ir.meta.file;
43920
+ const findings = [];
43921
+ for (const call of graph.ir.calls) {
43922
+ if (!this.isPermissiveXStreamConfig(call))
43923
+ continue;
43924
+ const line = call.location.line;
43925
+ const api = `addPermission(${call.arguments[0]?.expression ?? "AnyTypePermission"})`;
43926
+ findings.push({ line, api });
43927
+ ctx.addFinding({
43928
+ id: `${this.name}-${file}-${line}`,
43929
+ pass: this.name,
43930
+ category: this.category,
43931
+ rule_id: this.name,
43932
+ cwe: "CWE-502",
43933
+ severity: "high",
43934
+ level: "error",
43935
+ message: "XStream configured with AnyTypePermission (grant-all): untrusted XML " + "passed to fromXML/unmarshal can instantiate arbitrary types (deserialization RCE)",
43936
+ file,
43937
+ line,
43938
+ fix: "Replace AnyTypePermission with an explicit type allow-list: xstream.addPermission(NoTypePermission.NONE) then allowTypes/allowTypesByWildcard for the classes you deserialize.",
43939
+ evidence: { api, language }
43940
+ });
43941
+ }
43942
+ return { findings };
43943
+ }
43944
+ isPermissiveXStreamConfig(call) {
43945
+ if (call.method_name !== "addPermission")
43946
+ return false;
43947
+ const arg0 = call.arguments[0]?.expression;
43948
+ return typeof arg0 === "string" && ANY_TYPE_PERMISSION_RE.test(arg0);
43949
+ }
43950
+ }
43951
+
43909
43952
  // ../circle-ir/dist/analysis/passes/plaintext-password-storage-pass.js
43910
43953
  function isWriteStorageCall(call, language) {
43911
43954
  const method = call.method_name ?? "";
@@ -46591,6 +46634,8 @@ async function analyze(code, filePath, language, options = {}) {
46591
46634
  pipeline.add(new UnrestrictedFileUploadPass);
46592
46635
  if (!disabledPasses.has("missing-sanitizer-gate"))
46593
46636
  pipeline.add(new MissingSanitizerGatePass);
46637
+ if (!disabledPasses.has("insecure-deserialization-config"))
46638
+ pipeline.add(new InsecureDeserializationConfigPass);
46594
46639
  const { results, findings } = pipeline.run(graph, code, language, config);
46595
46640
  const sinkFilter = results.get("sink-filter");
46596
46641
  const interProc = results.get("interprocedural");
@@ -47855,7 +47900,7 @@ var colors = {
47855
47900
  };
47856
47901
 
47857
47902
  // src/version.ts
47858
- var version = "4.5.0";
47903
+ var version = "4.6.0";
47859
47904
 
47860
47905
  // src/formatters.ts
47861
47906
  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": "4.5.0",
3
+ "version": "4.6.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": "^4.5.0"
69
+ "circle-ir": "^4.6.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/node": "^25.5.0",