cognium-dev 3.206.0 → 3.208.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 +62 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -11222,8 +11222,6 @@ var DEFAULT_SINKS = [
|
|
|
11222
11222
|
{ method: "addObject", class: "ModelAndView", type: "xss", cwe: "CWE-79", severity: "high", arg_positions: [1] },
|
|
11223
11223
|
{ method: "println", type: "xss", cwe: "CWE-79", severity: "medium", arg_positions: [0] },
|
|
11224
11224
|
{ method: "print", type: "xss", cwe: "CWE-79", severity: "medium", arg_positions: [0] },
|
|
11225
|
-
{ method: "append", class: "StringBuilder", type: "xss", cwe: "CWE-79", severity: "medium", arg_positions: [0] },
|
|
11226
|
-
{ method: "append", class: "StringBuffer", type: "xss", cwe: "CWE-79", severity: "medium", arg_positions: [0] },
|
|
11227
11225
|
{ method: "handleHyperlinks", type: "xss", cwe: "CWE-79", severity: "high", arg_positions: [0] },
|
|
11228
11226
|
{ method: "handleDiv", type: "xss", cwe: "CWE-79", severity: "high", arg_positions: [0] },
|
|
11229
11227
|
{ method: "handleImage", type: "xss", cwe: "CWE-79", severity: "high", arg_positions: [0] },
|
|
@@ -40566,6 +40564,39 @@ function shannonEntropy(s) {
|
|
|
40566
40564
|
return h;
|
|
40567
40565
|
}
|
|
40568
40566
|
var CREDENTIAL_NAME_RE = /(?:key|secret|token|password|passwd|credential|api[_-]?key)/i;
|
|
40567
|
+
var CONNECTION_STRING_RE = /\b([a-z][a-z0-9+.-]{1,20}):\/\/([^\s:/@"'`]*):([^\s:/@"'`]{2,})@/i;
|
|
40568
|
+
var PASSWORD_INTERPOLATION_RE = /\$\{|\$\(|\{\{|%\([^)]*\)[sd]|%[sdvfeg]\b|[{}<>]/i;
|
|
40569
|
+
var PLACEHOLDER_PASSWORD_WORDS = new Set([
|
|
40570
|
+
"password",
|
|
40571
|
+
"passwd",
|
|
40572
|
+
"pass",
|
|
40573
|
+
"pwd",
|
|
40574
|
+
"secret",
|
|
40575
|
+
"user",
|
|
40576
|
+
"username",
|
|
40577
|
+
"changeme",
|
|
40578
|
+
"example",
|
|
40579
|
+
"yourpassword",
|
|
40580
|
+
"your_password",
|
|
40581
|
+
"test",
|
|
40582
|
+
"xxx",
|
|
40583
|
+
"xxxx"
|
|
40584
|
+
]);
|
|
40585
|
+
function matchConnectionStringCredential(lineText) {
|
|
40586
|
+
const m = CONNECTION_STRING_RE.exec(lineText);
|
|
40587
|
+
if (!m)
|
|
40588
|
+
return null;
|
|
40589
|
+
const password = m[3];
|
|
40590
|
+
if (/^\d+$/.test(password))
|
|
40591
|
+
return null;
|
|
40592
|
+
if (PLACEHOLDER_PASSWORD_WORDS.has(password.toLowerCase()))
|
|
40593
|
+
return null;
|
|
40594
|
+
if (PLACEHOLDER_RE.test(password))
|
|
40595
|
+
return null;
|
|
40596
|
+
if (PASSWORD_INTERPOLATION_RE.test(password))
|
|
40597
|
+
return null;
|
|
40598
|
+
return { scheme: m[1], match: m[0].substring(0, 60) };
|
|
40599
|
+
}
|
|
40569
40600
|
function findAnnotationLineRanges(code) {
|
|
40570
40601
|
const lines = code.split(`
|
|
40571
40602
|
`);
|
|
@@ -40777,6 +40808,34 @@ class ScanSecretsPass {
|
|
|
40777
40808
|
});
|
|
40778
40809
|
providerFindings += 1;
|
|
40779
40810
|
}
|
|
40811
|
+
for (let i2 = 0;i2 < lines.length; i2++) {
|
|
40812
|
+
const lineText = lines[i2];
|
|
40813
|
+
const lineNum = i2 + 1;
|
|
40814
|
+
const hit = matchConnectionStringCredential(lineText);
|
|
40815
|
+
if (!hit)
|
|
40816
|
+
continue;
|
|
40817
|
+
const key = `${lineNum}:hardcoded-credential`;
|
|
40818
|
+
if (seen.has(key))
|
|
40819
|
+
continue;
|
|
40820
|
+
seen.add(key);
|
|
40821
|
+
const dg = applyDemoDowngrade(demoPath, "high", "error");
|
|
40822
|
+
ctx.addFinding({
|
|
40823
|
+
id: `hardcoded-credential-${file}-${lineNum}`,
|
|
40824
|
+
pass: this.name,
|
|
40825
|
+
category: this.category,
|
|
40826
|
+
rule_id: "hardcoded-credential",
|
|
40827
|
+
cwe: "CWE-798",
|
|
40828
|
+
severity: dg.severity,
|
|
40829
|
+
level: dg.level,
|
|
40830
|
+
message: `Hardcoded credential: password embedded in a ${hit.scheme} connection string`,
|
|
40831
|
+
file,
|
|
40832
|
+
line: lineNum,
|
|
40833
|
+
snippet: lineText.trim().substring(0, 120),
|
|
40834
|
+
fix: "Move the credential out of the connection string into an environment variable or secrets manager, and rotate the exposed password.",
|
|
40835
|
+
evidence: { kind: "connection-string", scheme: hit.scheme, match: hit.match }
|
|
40836
|
+
});
|
|
40837
|
+
providerFindings += 1;
|
|
40838
|
+
}
|
|
40780
40839
|
if (hasEntropyCandidate)
|
|
40781
40840
|
for (let i2 = 0;i2 < lines.length; i2++) {
|
|
40782
40841
|
const lineText = lines[i2];
|
|
@@ -46956,7 +47015,7 @@ var colors = {
|
|
|
46956
47015
|
};
|
|
46957
47016
|
|
|
46958
47017
|
// src/version.ts
|
|
46959
|
-
var version = "3.
|
|
47018
|
+
var version = "3.208.0";
|
|
46960
47019
|
|
|
46961
47020
|
// src/formatters.ts
|
|
46962
47021
|
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.
|
|
3
|
+
"version": "3.208.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.
|
|
69
|
+
"circle-ir": "^3.208.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/node": "^25.5.0",
|