cognium-dev 3.160.0 → 3.162.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 +56 -10
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -10226,6 +10226,7 @@ var DEFAULT_SOURCES = [
10226
10226
  { method: "getPathWithinApplication", class: "WebUtils", type: "http_path", severity: "high", return_tainted: true },
10227
10227
  { method: "getRequestUri", class: "WebUtils", type: "http_path", severity: "high", return_tainted: true },
10228
10228
  { method: "decodeRequestString", class: "WebUtils", type: "http_path", severity: "high", return_tainted: true },
10229
+ { method: "decode", class: "URLDecoder", type: "http_path", severity: "high", return_tainted: true },
10229
10230
  { method: "getProtocol", class: "HttpServletRequest", type: "http_header", severity: "medium", return_tainted: true },
10230
10231
  { method: "getScheme", class: "HttpServletRequest", type: "http_header", severity: "medium", return_tainted: true },
10231
10232
  { method: "getAuthType", class: "HttpServletRequest", type: "http_header", severity: "medium", return_tainted: true },
@@ -11520,7 +11521,24 @@ var DEFAULT_SINKS = [
11520
11521
  { method: "outerHTML", type: "xss", cwe: "CWE-79", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"] },
11521
11522
  { method: "unserialize", class: "serialize", type: "deserialization", cwe: "CWE-502", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"] },
11522
11523
  { method: "unserialize", class: "node-serialize", type: "deserialization", cwe: "CWE-502", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"] },
11523
- { method: "unserialize", type: "deserialization", cwe: "CWE-502", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"] }
11524
+ { method: "unserialize", type: "deserialization", cwe: "CWE-502", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"] },
11525
+ { method: "get", class: "httpx", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
11526
+ { method: "post", class: "httpx", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
11527
+ { method: "request", class: "httpx", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [1] },
11528
+ { method: "stream", class: "httpx", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [1] },
11529
+ { method: "delete", class: "httpx", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
11530
+ { method: "put", class: "httpx", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
11531
+ { method: "patch", class: "httpx", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
11532
+ { method: "head", class: "httpx", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
11533
+ { method: "execute", class: "Connection", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0] },
11534
+ { method: "fetch", class: "Connection", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0] },
11535
+ { method: "fetchrow", class: "Connection", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0] },
11536
+ { method: "fetchval", class: "Connection", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0] },
11537
+ { method: "fetchrow", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0], languages: ["python"] },
11538
+ { method: "fetchval", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0], languages: ["python"] },
11539
+ { method: "Redirect", class: "http", type: "open_redirect", cwe: "CWE-601", severity: "medium", arg_positions: [2], languages: ["go"] },
11540
+ { method: "Do", class: "Client", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0], languages: ["go"] },
11541
+ { method: "DoTimeout", class: "Client", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0], languages: ["go"] }
11524
11542
  ];
11525
11543
  var DEFAULT_SANITIZERS = [
11526
11544
  { method: "setString", class: "PreparedStatement", removes: ["sql_injection"] },
@@ -11544,11 +11562,11 @@ var DEFAULT_SANITIZERS = [
11544
11562
  { method: "render", class: "Template", removes: ["xss"] },
11545
11563
  { method: "encodeForJavaScript", removes: ["xss"] },
11546
11564
  { method: "encodeForCSS", removes: ["xss"] },
11547
- { method: "encodeForURL", removes: ["xss", "ssrf"] },
11548
- { method: "encodeURL", removes: ["xss", "ssrf"] },
11549
- { method: "urlEncode", removes: ["xss", "ssrf"] },
11550
- { method: "escapeUrl", removes: ["xss", "ssrf"] },
11551
- { method: "escapeURL", removes: ["xss", "ssrf"] },
11565
+ { method: "encodeForURL", removes: ["xss", "ssrf", "open_redirect"] },
11566
+ { method: "encodeURL", removes: ["xss", "ssrf", "open_redirect"] },
11567
+ { method: "urlEncode", removes: ["xss", "ssrf", "open_redirect"] },
11568
+ { method: "escapeUrl", removes: ["xss", "ssrf", "open_redirect"] },
11569
+ { method: "escapeURL", removes: ["xss", "ssrf", "open_redirect"] },
11552
11570
  { method: "normalize", class: "Path", removes: ["path_traversal"] },
11553
11571
  { method: "getCanonicalPath", class: "File", removes: ["path_traversal"] },
11554
11572
  { method: "toRealPath", class: "Path", removes: ["path_traversal"] },
@@ -11574,7 +11592,7 @@ var DEFAULT_SANITIZERS = [
11574
11592
  { method: "setFeature", class: "SAXParserFactory", removes: ["xxe"] },
11575
11593
  { method: "setFeature", class: "XMLReader", removes: ["xxe"] },
11576
11594
  { method: "setProperty", class: "XMLReader", removes: ["xxe"] },
11577
- { method: "encode", class: "URLEncoder", removes: ["ssrf", "xss", "path_traversal"] },
11595
+ { method: "encode", class: "URLEncoder", removes: ["ssrf", "xss", "path_traversal", "open_redirect"] },
11578
11596
  { method: "validateURL", removes: ["ssrf"] },
11579
11597
  { method: "isAllowedHost", removes: ["ssrf"] },
11580
11598
  { method: "isInternalHost", removes: ["ssrf"] },
@@ -13058,7 +13076,7 @@ function receiverMightBeClass(receiver, className) {
13058
13076
  }
13059
13077
  const lowerReceiver = receiver.toLowerCase();
13060
13078
  const lowerClass = className.toLowerCase();
13061
- if (lowerReceiver.endsWith(lowerClass) || lowerReceiver.endsWith("." + lowerClass)) {
13079
+ if (lowerReceiver === lowerClass || lowerReceiver.endsWith("." + lowerClass)) {
13062
13080
  return true;
13063
13081
  }
13064
13082
  if (receiver.includes(".") && !receiver.endsWith(")")) {
@@ -16071,7 +16089,7 @@ var KNOWN_SINK_TYPES = new Set([
16071
16089
  "crlf",
16072
16090
  "mass_assignment"
16073
16091
  ]);
16074
- function checkSanitized(_fromLine, toLine, sinkType, sanitizersByLine, ctx) {
16092
+ function checkSanitized(fromLine, toLine, sinkType, sanitizersByLine, ctx) {
16075
16093
  const isKnownSinkType = KNOWN_SINK_TYPES.has(sinkType);
16076
16094
  const sanitizersAtTarget = sanitizersByLine.get(toLine);
16077
16095
  if (sanitizersAtTarget && sanitizersAtTarget.length > 0) {
@@ -16090,6 +16108,8 @@ function checkSanitized(_fromLine, toLine, sinkType, sanitizersByLine, ctx) {
16090
16108
  for (const line of walk.lines) {
16091
16109
  if (line === toLine)
16092
16110
  continue;
16111
+ if (line < fromLine)
16112
+ continue;
16093
16113
  const sansAtLine = sanitizersByLine.get(line);
16094
16114
  if (!sansAtLine || sansAtLine.length === 0)
16095
16115
  continue;
@@ -21979,6 +21999,30 @@ class GoPlugin extends BaseLanguagePlugin {
21979
21999
  severity: "high",
21980
22000
  argPositions: [0, 2]
21981
22001
  },
22002
+ {
22003
+ method: "Get",
22004
+ class: "fasthttp",
22005
+ type: "ssrf",
22006
+ cwe: "CWE-918",
22007
+ severity: "high",
22008
+ argPositions: [1]
22009
+ },
22010
+ {
22011
+ method: "Post",
22012
+ class: "fasthttp",
22013
+ type: "ssrf",
22014
+ cwe: "CWE-918",
22015
+ severity: "high",
22016
+ argPositions: [1]
22017
+ },
22018
+ {
22019
+ method: "GetTimeout",
22020
+ class: "fasthttp",
22021
+ type: "ssrf",
22022
+ cwe: "CWE-918",
22023
+ severity: "high",
22024
+ argPositions: [1]
22025
+ },
21982
22026
  {
21983
22027
  method: "Unmarshal",
21984
22028
  class: "json",
@@ -32041,6 +32085,8 @@ class TaintPropagationPass {
32041
32085
  for (const line of walk.lines) {
32042
32086
  if (line === f.sink_line)
32043
32087
  continue;
32088
+ if (line < f.source_line)
32089
+ continue;
32044
32090
  const sansAtLine = sanitizersByLine.get(line);
32045
32091
  if (!sansAtLine || sansAtLine.length === 0)
32046
32092
  continue;
@@ -43800,7 +43846,7 @@ var colors = {
43800
43846
  };
43801
43847
 
43802
43848
  // src/version.ts
43803
- var version = "3.160.0";
43849
+ var version = "3.162.0";
43804
43850
 
43805
43851
  // src/formatters.ts
43806
43852
  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.160.0",
3
+ "version": "3.162.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.160.0"
69
+ "circle-ir": "^3.162.0"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@types/node": "^25.5.0",