cognium-dev 3.85.1 → 3.86.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.
- package/dist/cli.js +52 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -12112,6 +12112,19 @@ function argIsClassLiteral(call, position) {
|
|
|
12112
12112
|
return false;
|
|
12113
12113
|
return CLASS_LITERAL_RE.test(expr);
|
|
12114
12114
|
}
|
|
12115
|
+
var CWE_78_RECEIVER_ALLOWLIST = new Set([
|
|
12116
|
+
"Runtime",
|
|
12117
|
+
"ProcessBuilder",
|
|
12118
|
+
"Process",
|
|
12119
|
+
"CommandLine",
|
|
12120
|
+
"DefaultExecutor",
|
|
12121
|
+
"Executor",
|
|
12122
|
+
"Exec",
|
|
12123
|
+
"Launcher",
|
|
12124
|
+
"ProcStarter",
|
|
12125
|
+
"ProcessExecutor",
|
|
12126
|
+
"RuntimeUtil"
|
|
12127
|
+
]);
|
|
12115
12128
|
function findSinks(calls, patterns, typeHierarchy, language, sourceLines) {
|
|
12116
12129
|
const sinkMap = new Map;
|
|
12117
12130
|
for (const call of calls) {
|
|
@@ -12132,6 +12145,18 @@ function findSinks(calls, patterns, typeHierarchy, language, sourceLines) {
|
|
|
12132
12145
|
if (pattern.safe_if_class_literal_at !== undefined && argIsClassLiteral(call, pattern.safe_if_class_literal_at)) {
|
|
12133
12146
|
continue;
|
|
12134
12147
|
}
|
|
12148
|
+
if (pattern.type === "command_injection") {
|
|
12149
|
+
if (call.is_constructor) {
|
|
12150
|
+
if (!CWE_78_RECEIVER_ALLOWLIST.has(call.method_name)) {
|
|
12151
|
+
continue;
|
|
12152
|
+
}
|
|
12153
|
+
} else {
|
|
12154
|
+
const receiverClass = call.receiver_type;
|
|
12155
|
+
if (receiverClass && !CWE_78_RECEIVER_ALLOWLIST.has(receiverClass)) {
|
|
12156
|
+
continue;
|
|
12157
|
+
}
|
|
12158
|
+
}
|
|
12159
|
+
}
|
|
12135
12160
|
const location = formatCallLocation(call);
|
|
12136
12161
|
const key = `${location}:${call.location.line}:${pattern.cwe}`;
|
|
12137
12162
|
const confidence = calculateSinkConfidence(call, pattern);
|
|
@@ -29073,6 +29098,20 @@ var CRED_KEYWORD_RE = /\b([A-Za-z_$][\w$]*?(?:password|passwd|secret|api[_-]?key
|
|
|
29073
29098
|
var CRED_DYNAMIC_VALUE_RE = /\$\{|process\.env|os\.environ|os\.Getenv|System\.getenv/;
|
|
29074
29099
|
var CRED_FUNCTION_DECL_RE = /\b(?:function|func|def|fn)\s+\w+\s*\(/;
|
|
29075
29100
|
var CRED_COMPARISON_RE = /(?:===?|!==?|>=|<=|<>)\s*["'`]/;
|
|
29101
|
+
var PROPERTY_KEY_RE = /^[a-z][a-zA-Z0-9_-]*\.[a-zA-Z][a-zA-Z0-9_.-]*$/;
|
|
29102
|
+
var PLAIN_IDENTIFIER_RE = /^[a-z][a-zA-Z_]*$/;
|
|
29103
|
+
function charClassDiversity(s) {
|
|
29104
|
+
let n = 0;
|
|
29105
|
+
if (/[a-z]/.test(s))
|
|
29106
|
+
n++;
|
|
29107
|
+
if (/[A-Z]/.test(s))
|
|
29108
|
+
n++;
|
|
29109
|
+
if (/[0-9]/.test(s))
|
|
29110
|
+
n++;
|
|
29111
|
+
if (/[^a-zA-Z0-9]/.test(s))
|
|
29112
|
+
n++;
|
|
29113
|
+
return n;
|
|
29114
|
+
}
|
|
29076
29115
|
function isLikelyCredentialAssignment(line) {
|
|
29077
29116
|
if (CRED_FUNCTION_DECL_RE.test(line))
|
|
29078
29117
|
return null;
|
|
@@ -29091,6 +29130,18 @@ function isLikelyCredentialAssignment(line) {
|
|
|
29091
29130
|
return null;
|
|
29092
29131
|
if (isAllSameChar(value))
|
|
29093
29132
|
return null;
|
|
29133
|
+
if (value.length < 12)
|
|
29134
|
+
return null;
|
|
29135
|
+
if (shannonEntropy(value) < 3.5)
|
|
29136
|
+
return null;
|
|
29137
|
+
if (charClassDiversity(value) < 2)
|
|
29138
|
+
return null;
|
|
29139
|
+
if (PROPERTY_KEY_RE.test(value))
|
|
29140
|
+
return null;
|
|
29141
|
+
if (PLAIN_IDENTIFIER_RE.test(value))
|
|
29142
|
+
return null;
|
|
29143
|
+
if (/^[0-9]+$/.test(value) && value.length < 16)
|
|
29144
|
+
return null;
|
|
29094
29145
|
return { name: name2, value };
|
|
29095
29146
|
}
|
|
29096
29147
|
var STRING_LITERAL_RE = /(["'`])((?:\\.|(?!\1).){8,200})\1/g;
|
|
@@ -33993,7 +34044,7 @@ var colors = {
|
|
|
33993
34044
|
};
|
|
33994
34045
|
|
|
33995
34046
|
// src/version.ts
|
|
33996
|
-
var version = "3.
|
|
34047
|
+
var version = "3.86.0";
|
|
33997
34048
|
|
|
33998
34049
|
// src/formatters.ts
|
|
33999
34050
|
var SINK_SEVERITY = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cognium-dev",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.86.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.
|
|
68
|
+
"circle-ir": "^3.86.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^25.5.0",
|