cognium-dev 3.156.0 → 3.158.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 +108 -6
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -11671,7 +11671,10 @@ var DEFAULT_SANITIZERS = [
|
|
|
11671
11671
|
{ method: "MustParse", class: "uuid", removes: ["sql_injection", "command_injection", "path_traversal", "code_injection"] },
|
|
11672
11672
|
{ method: "bool", removes: ["sql_injection", "command_injection", "xss", "code_injection"] },
|
|
11673
11673
|
{ method: "UUID", class: "uuid", removes: ["sql_injection", "command_injection", "path_traversal", "code_injection"] },
|
|
11674
|
-
{ method: "Decimal", class: "decimal", removes: ["sql_injection", "command_injection", "path_traversal", "code_injection"] }
|
|
11674
|
+
{ method: "Decimal", class: "decimal", removes: ["sql_injection", "command_injection", "path_traversal", "code_injection"] },
|
|
11675
|
+
{ method: "update", class: "Cipher", removes: ["xss", "sql_injection", "command_injection", "path_traversal", "code_injection", "crlf", "log_injection", "ldap_injection", "xpath_injection"] },
|
|
11676
|
+
{ method: "final", class: "Cipher", removes: ["xss", "sql_injection", "command_injection", "path_traversal", "code_injection", "crlf", "log_injection", "ldap_injection", "xpath_injection"] },
|
|
11677
|
+
{ method: "doFinal", class: "Cipher", removes: ["xss", "sql_injection", "command_injection", "path_traversal", "code_injection", "crlf", "log_injection", "ldap_injection", "xpath_injection"] }
|
|
11675
11678
|
];
|
|
11676
11679
|
var DEFAULT_SINK_SEMANTICS = [
|
|
11677
11680
|
{
|
|
@@ -18895,6 +18898,42 @@ function shouldGateInterproceduralParam(sourceType, enclosingMethod, enclosingTy
|
|
|
18895
18898
|
// ../circle-ir/dist/analysis/require-entry-path.js
|
|
18896
18899
|
var RULE_ID_REQUIRE_ENTRY_PATH = "require-entry-path";
|
|
18897
18900
|
var MAX_VISITED_METHODS = 2000;
|
|
18901
|
+
var TAINT_FLOW_RULE_IDS = new Set([
|
|
18902
|
+
"sql_injection",
|
|
18903
|
+
"nosql_injection",
|
|
18904
|
+
"command_injection",
|
|
18905
|
+
"path_traversal",
|
|
18906
|
+
"xss",
|
|
18907
|
+
"xxe",
|
|
18908
|
+
"deserialization",
|
|
18909
|
+
"insecure_deserialization",
|
|
18910
|
+
"ldap_injection",
|
|
18911
|
+
"xpath_injection",
|
|
18912
|
+
"ssrf",
|
|
18913
|
+
"open_redirect",
|
|
18914
|
+
"code_injection",
|
|
18915
|
+
"log_injection",
|
|
18916
|
+
"redos",
|
|
18917
|
+
"format_string",
|
|
18918
|
+
"crlf",
|
|
18919
|
+
"mass_assignment",
|
|
18920
|
+
"mybatis_mapper_call",
|
|
18921
|
+
"external_taint_escape",
|
|
18922
|
+
"template_injection",
|
|
18923
|
+
"sql-injection",
|
|
18924
|
+
"nosql-injection",
|
|
18925
|
+
"command-injection",
|
|
18926
|
+
"path-traversal",
|
|
18927
|
+
"ldap-injection",
|
|
18928
|
+
"xpath-injection",
|
|
18929
|
+
"open-redirect",
|
|
18930
|
+
"code-injection",
|
|
18931
|
+
"log-injection",
|
|
18932
|
+
"format-string",
|
|
18933
|
+
"mass-assignment",
|
|
18934
|
+
"template-injection",
|
|
18935
|
+
"insecure-deserialization"
|
|
18936
|
+
]);
|
|
18898
18937
|
function applyRequireEntryPath(fileAnalyses, options = {}) {
|
|
18899
18938
|
const disabledSet = normalizeDisabled(options.disabledPasses);
|
|
18900
18939
|
if (disabledSet.has(RULE_ID_REQUIRE_ENTRY_PATH))
|
|
@@ -19030,6 +19069,8 @@ function collectEntryPointKeys(graph) {
|
|
|
19030
19069
|
function classifyFinding(finding, ir, graph, entryPointKeys, profile) {
|
|
19031
19070
|
if (finding.category !== "security")
|
|
19032
19071
|
return { action: "keep" };
|
|
19072
|
+
if (!TAINT_FLOW_RULE_IDS.has(finding.rule_id))
|
|
19073
|
+
return { action: "keep" };
|
|
19033
19074
|
const isHighOrCritical = finding.severity === "high" || finding.severity === "critical";
|
|
19034
19075
|
const language = (ir.meta.language ?? "").toLowerCase();
|
|
19035
19076
|
if (language !== "java")
|
|
@@ -30412,6 +30453,30 @@ class SinkFilterPass {
|
|
|
30412
30453
|
}
|
|
30413
30454
|
if (language === "java") {
|
|
30414
30455
|
const sourceLines = ctx.code.split(`
|
|
30456
|
+
`);
|
|
30457
|
+
filtered = filtered.filter((sink) => {
|
|
30458
|
+
if (sink.type !== "xss")
|
|
30459
|
+
return true;
|
|
30460
|
+
const sinkLineText = sourceLines[sink.line - 1] ?? "";
|
|
30461
|
+
const receiverMatch = sinkLineText.match(/\b(\w+)\s*\.\s*(\w+)\s*\(/);
|
|
30462
|
+
const receiver = receiverMatch?.[1];
|
|
30463
|
+
const method = sink.method ?? receiverMatch?.[2];
|
|
30464
|
+
if ((method === "render" || method === "process" || method === "merge" || method === "renderTo" || method === "apply") && receiver) {
|
|
30465
|
+
const recvType = resolveJavaReceiverType(receiver, sink.line, sourceLines);
|
|
30466
|
+
if (recvType && COMPILED_TEMPLATE_TYPES.has(recvType))
|
|
30467
|
+
return false;
|
|
30468
|
+
if (recvType && TEMPLATE_ENGINE_LITERAL_TARGETS.has(recvType)) {
|
|
30469
|
+
const args2 = extractJavaCallArgs(method, sinkLineText);
|
|
30470
|
+
if (args2 !== null && args2.length >= 1 && isJavaLiteralOrAnnotationAccessor(args2[0])) {
|
|
30471
|
+
return false;
|
|
30472
|
+
}
|
|
30473
|
+
}
|
|
30474
|
+
}
|
|
30475
|
+
return true;
|
|
30476
|
+
});
|
|
30477
|
+
}
|
|
30478
|
+
if (language === "java") {
|
|
30479
|
+
const sourceLines = ctx.code.split(`
|
|
30415
30480
|
`);
|
|
30416
30481
|
filtered = filtered.filter((sink) => {
|
|
30417
30482
|
if (sink.type !== "command_injection")
|
|
@@ -31836,11 +31901,36 @@ class TaintPropagationPass {
|
|
|
31836
31901
|
return true;
|
|
31837
31902
|
}
|
|
31838
31903
|
const sansAtSink = sanitizersByLine.get(f.sink_line);
|
|
31839
|
-
if (
|
|
31904
|
+
if (sansAtSink && sansAtSink.length > 0) {
|
|
31905
|
+
for (const san of sansAtSink) {
|
|
31906
|
+
if (san.sanitizes.includes(f.sink_type)) {
|
|
31907
|
+
return false;
|
|
31908
|
+
}
|
|
31909
|
+
}
|
|
31910
|
+
}
|
|
31911
|
+
const usesAtSink = graph.usesByLine.get(f.sink_line);
|
|
31912
|
+
if (!usesAtSink || usesAtSink.length === 0)
|
|
31840
31913
|
return true;
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
|
|
31914
|
+
const sinkVar = f.path.length > 0 ? f.path[f.path.length - 1].variable : undefined;
|
|
31915
|
+
if (!sinkVar)
|
|
31916
|
+
return true;
|
|
31917
|
+
for (const use of usesAtSink) {
|
|
31918
|
+
if (use.variable !== sinkVar)
|
|
31919
|
+
continue;
|
|
31920
|
+
if (use.def_id === null || use.def_id === undefined)
|
|
31921
|
+
continue;
|
|
31922
|
+
const walk = walkBackwardDefs(use.def_id, graph.chainsByToDef, graph.defById, { maxHops: 32 });
|
|
31923
|
+
for (const line of walk.lines) {
|
|
31924
|
+
if (line === f.sink_line)
|
|
31925
|
+
continue;
|
|
31926
|
+
const sansAtLine = sanitizersByLine.get(line);
|
|
31927
|
+
if (!sansAtLine || sansAtLine.length === 0)
|
|
31928
|
+
continue;
|
|
31929
|
+
for (const san of sansAtLine) {
|
|
31930
|
+
if (san.sanitizes.includes(f.sink_type)) {
|
|
31931
|
+
return false;
|
|
31932
|
+
}
|
|
31933
|
+
}
|
|
31844
31934
|
}
|
|
31845
31935
|
}
|
|
31846
31936
|
return true;
|
|
@@ -38646,10 +38736,22 @@ var TEST_PATH_PATTERNS = [
|
|
|
38646
38736
|
/\.spec\.(?:tsx?|jsx?|mjs|cjs)$/i,
|
|
38647
38737
|
/\.test\.(?:java|kt)$/i
|
|
38648
38738
|
];
|
|
38739
|
+
var JVM_TEST_FILE_PATTERNS = [
|
|
38740
|
+
/(?:^|\/)[A-Za-z_]\w*(?:Test|Tests|Spec|IT|ITCase|TestCase)\.(?:java|kt|scala|groovy)$/,
|
|
38741
|
+
/(?:^|\/)[A-Za-z_]\w*\.(?:test|spec)\.(?:java|kt|scala|groovy)$/i
|
|
38742
|
+
];
|
|
38743
|
+
var JVM_SOURCE_FILE_RE = /\.(?:java|kt|scala|groovy)$/i;
|
|
38649
38744
|
function isTestPath(filepath) {
|
|
38650
38745
|
if (!filepath)
|
|
38651
38746
|
return false;
|
|
38652
38747
|
const normalized = filepath.replace(/\\/g, "/");
|
|
38748
|
+
if (JVM_SOURCE_FILE_RE.test(normalized)) {
|
|
38749
|
+
for (const pattern of JVM_TEST_FILE_PATTERNS) {
|
|
38750
|
+
if (pattern.test(normalized))
|
|
38751
|
+
return true;
|
|
38752
|
+
}
|
|
38753
|
+
return false;
|
|
38754
|
+
}
|
|
38653
38755
|
for (const pattern of TEST_PATH_PATTERNS) {
|
|
38654
38756
|
if (pattern.test(normalized))
|
|
38655
38757
|
return true;
|
|
@@ -43580,7 +43682,7 @@ var colors = {
|
|
|
43580
43682
|
};
|
|
43581
43683
|
|
|
43582
43684
|
// src/version.ts
|
|
43583
|
-
var version = "3.
|
|
43685
|
+
var version = "3.158.0";
|
|
43584
43686
|
|
|
43585
43687
|
// src/formatters.ts
|
|
43586
43688
|
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.158.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.158.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/node": "^25.5.0",
|