cognium-dev 3.198.0 → 3.200.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 +102 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -3651,6 +3651,10 @@ function extractJavaScriptTypes(tree, cache) {
|
|
|
3651
3651
|
for (const cls of classes) {
|
|
3652
3652
|
types.push(extractJSClassInfo(cls));
|
|
3653
3653
|
}
|
|
3654
|
+
const interfaces = getNodesFromCache(tree.rootNode, "interface_declaration", cache);
|
|
3655
|
+
for (const iface of interfaces) {
|
|
3656
|
+
types.push(extractTSInterfaceInfo(iface));
|
|
3657
|
+
}
|
|
3654
3658
|
const functions = getNodesFromCache(tree.rootNode, "function_declaration", cache);
|
|
3655
3659
|
if (functions.length > 0) {
|
|
3656
3660
|
const moduleFunctions = [];
|
|
@@ -3997,6 +4001,76 @@ function extractSelfAssignments(body2, fields, fieldNames) {
|
|
|
3997
4001
|
}
|
|
3998
4002
|
}
|
|
3999
4003
|
}
|
|
4004
|
+
function extractTSInterfaceInfo(node) {
|
|
4005
|
+
const name2 = getIdentifier(node, "name") ?? "Anonymous";
|
|
4006
|
+
const parents = [];
|
|
4007
|
+
for (let i2 = 0;i2 < node.childCount; i2++) {
|
|
4008
|
+
const child = node.child(i2);
|
|
4009
|
+
if (!child || child.type !== "extends_type_clause")
|
|
4010
|
+
continue;
|
|
4011
|
+
for (let j = 0;j < child.childCount; j++) {
|
|
4012
|
+
const gc = child.child(j);
|
|
4013
|
+
if (!gc)
|
|
4014
|
+
continue;
|
|
4015
|
+
if (gc.type === "type_identifier" || gc.type === "generic_type" || gc.type === "nested_type_identifier") {
|
|
4016
|
+
parents.push(getNodeText(gc));
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
const body2 = node.childForFieldName("body");
|
|
4021
|
+
const methods = [];
|
|
4022
|
+
const fields = [];
|
|
4023
|
+
if (body2) {
|
|
4024
|
+
for (let i2 = 0;i2 < body2.childCount; i2++) {
|
|
4025
|
+
const member = body2.child(i2);
|
|
4026
|
+
if (!member)
|
|
4027
|
+
continue;
|
|
4028
|
+
if (member.type === "method_signature") {
|
|
4029
|
+
const methodName = getIdentifier(member, "name") ?? getNodeText(member.child(0) ?? member);
|
|
4030
|
+
const params = member.childForFieldName("parameters");
|
|
4031
|
+
const returnType = member.childForFieldName("return_type");
|
|
4032
|
+
methods.push({
|
|
4033
|
+
name: methodName,
|
|
4034
|
+
return_type: returnType ? getNodeText(returnType).replace(/^:\s*/, "") : null,
|
|
4035
|
+
parameters: params ? extractJSParameters(params) : [],
|
|
4036
|
+
annotations: [],
|
|
4037
|
+
modifiers: [],
|
|
4038
|
+
start_line: member.startPosition.row + 1,
|
|
4039
|
+
end_line: member.endPosition.row + 1
|
|
4040
|
+
});
|
|
4041
|
+
continue;
|
|
4042
|
+
}
|
|
4043
|
+
if (member.type === "property_signature") {
|
|
4044
|
+
const fieldName = getIdentifier(member, "name") ?? getNodeText(member.child(0) ?? member);
|
|
4045
|
+
const typeNode = member.childForFieldName("type");
|
|
4046
|
+
const modifiers = [];
|
|
4047
|
+
const text = getNodeText(member);
|
|
4048
|
+
if (/^\s*readonly\b/.test(text))
|
|
4049
|
+
modifiers.push("readonly");
|
|
4050
|
+
if (/\?\s*:/.test(text))
|
|
4051
|
+
modifiers.push("optional");
|
|
4052
|
+
fields.push({
|
|
4053
|
+
name: fieldName,
|
|
4054
|
+
type: typeNode ? getNodeText(typeNode).replace(/^:\s*/, "") : null,
|
|
4055
|
+
modifiers,
|
|
4056
|
+
annotations: []
|
|
4057
|
+
});
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
return {
|
|
4062
|
+
name: name2,
|
|
4063
|
+
kind: "interface",
|
|
4064
|
+
package: null,
|
|
4065
|
+
extends: parents[0] ?? null,
|
|
4066
|
+
implements: parents.slice(1),
|
|
4067
|
+
annotations: [],
|
|
4068
|
+
methods,
|
|
4069
|
+
fields,
|
|
4070
|
+
start_line: node.startPosition.row + 1,
|
|
4071
|
+
end_line: node.endPosition.row + 1
|
|
4072
|
+
};
|
|
4073
|
+
}
|
|
4000
4074
|
function extractJSClassInfo(node) {
|
|
4001
4075
|
const name2 = getIdentifier(node, "name") ?? "Anonymous";
|
|
4002
4076
|
let extendsType = null;
|
|
@@ -10465,6 +10539,18 @@ var DEFAULT_SOURCES = [
|
|
|
10465
10539
|
{ annotation: "FormParam", type: "http_param", severity: "high", param_tainted: true },
|
|
10466
10540
|
{ annotation: "PathParam", type: "http_path", severity: "medium", param_tainted: true },
|
|
10467
10541
|
{ annotation: "HeaderParam", type: "http_header", severity: "high", param_tainted: true },
|
|
10542
|
+
{ annotation: "CookieParam", type: "http_cookie", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10543
|
+
{ annotation: "MatrixParam", type: "http_param", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10544
|
+
{ annotation: "BeanParam", type: "http_body", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10545
|
+
{ annotation: "QueryValue", type: "http_param", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10546
|
+
{ annotation: "Part", type: "http_body", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10547
|
+
{ annotation: "RequestBean", type: "http_body", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10548
|
+
{ annotation: "RestQuery", type: "http_param", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10549
|
+
{ annotation: "RestPath", type: "http_path", severity: "medium", param_tainted: true, languages: ["java"] },
|
|
10550
|
+
{ annotation: "RestHeader", type: "http_header", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10551
|
+
{ annotation: "RestForm", type: "http_param", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10552
|
+
{ annotation: "RestCookie", type: "http_cookie", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10553
|
+
{ annotation: "RestMatrix", type: "http_param", severity: "high", param_tainted: true, languages: ["java"] },
|
|
10468
10554
|
{ method_annotation: "DataBoundConstructor", type: "http_param", severity: "high" },
|
|
10469
10555
|
{ method: "getenv", class: "System", type: "env_input", severity: "medium", return_tainted: true },
|
|
10470
10556
|
{ method: "getProperty", class: "System", type: "env_input", severity: "medium", return_tainted: true },
|
|
@@ -11534,6 +11620,10 @@ var DEFAULT_SINKS = [
|
|
|
11534
11620
|
{ method: "each", class: "Connection", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"], allow_unresolved_receiver: true },
|
|
11535
11621
|
{ method: "get", class: "Connection", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"], allow_unresolved_receiver: true },
|
|
11536
11622
|
{ method: "exec", class: "Connection", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"], allow_unresolved_receiver: true },
|
|
11623
|
+
{ method: "andWhere", type: "sql_injection", cwe: "CWE-89", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
11624
|
+
{ method: "orWhere", type: "sql_injection", cwe: "CWE-89", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
11625
|
+
{ method: "andHaving", type: "sql_injection", cwe: "CWE-89", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
11626
|
+
{ method: "orHaving", type: "sql_injection", cwe: "CWE-89", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
11537
11627
|
{ method: "setAttribute", type: "xss", cwe: "CWE-79", severity: "high", arg_positions: [1] },
|
|
11538
11628
|
{ method: "bypassSecurityTrustHtml", type: "xss", cwe: "CWE-79", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
11539
11629
|
{ method: "bypassSecurityTrustScript", type: "xss", cwe: "CWE-79", severity: "critical", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
@@ -11653,6 +11743,7 @@ var DEFAULT_SINKS = [
|
|
|
11653
11743
|
{ method: "executemany", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0], languages: ["python"] },
|
|
11654
11744
|
{ method: "raw", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0], languages: ["python"] },
|
|
11655
11745
|
{ method: "extra", type: "sql_injection", cwe: "CWE-89", severity: "high", arg_positions: [0], languages: ["python"] },
|
|
11746
|
+
{ method: "RawSQL", type: "sql_injection", cwe: "CWE-89", severity: "critical", arg_positions: [0], languages: ["python"] },
|
|
11656
11747
|
{ method: "open", type: "path_traversal", cwe: "CWE-22", severity: "high", arg_positions: [0], languages: ["python"] },
|
|
11657
11748
|
{ method: "remove", class: "os", type: "path_traversal", cwe: "CWE-22", severity: "high", arg_positions: [0] },
|
|
11658
11749
|
{ method: "unlink", class: "os", type: "path_traversal", cwe: "CWE-22", severity: "high", arg_positions: [0] },
|
|
@@ -46420,7 +46511,7 @@ var colors = {
|
|
|
46420
46511
|
};
|
|
46421
46512
|
|
|
46422
46513
|
// src/version.ts
|
|
46423
|
-
var version = "3.
|
|
46514
|
+
var version = "3.200.0";
|
|
46424
46515
|
|
|
46425
46516
|
// src/formatters.ts
|
|
46426
46517
|
var LIBRARY_API_SURFACE_TAG2 = "library-api-surface:caller-responsibility";
|
|
@@ -46456,7 +46547,11 @@ var SINK_SEVERITY = {
|
|
|
46456
46547
|
format_string: "high",
|
|
46457
46548
|
crlf: "medium",
|
|
46458
46549
|
mass_assignment: "high",
|
|
46459
|
-
prompt_injection: "high"
|
|
46550
|
+
prompt_injection: "high",
|
|
46551
|
+
insecure_storage: "medium",
|
|
46552
|
+
prototype_pollution: "high",
|
|
46553
|
+
regex_dos: "high",
|
|
46554
|
+
unsafe_memory: "high"
|
|
46460
46555
|
};
|
|
46461
46556
|
var SINK_CWE = {
|
|
46462
46557
|
sql_injection: "CWE-89",
|
|
@@ -46483,7 +46578,11 @@ var SINK_CWE = {
|
|
|
46483
46578
|
format_string: "CWE-134",
|
|
46484
46579
|
crlf: "CWE-113",
|
|
46485
46580
|
mass_assignment: "CWE-915",
|
|
46486
|
-
prompt_injection: "CWE-1427"
|
|
46581
|
+
prompt_injection: "CWE-1427",
|
|
46582
|
+
insecure_storage: "CWE-922",
|
|
46583
|
+
prototype_pollution: "CWE-1321",
|
|
46584
|
+
regex_dos: "CWE-1333",
|
|
46585
|
+
unsafe_memory: "CWE-119"
|
|
46487
46586
|
};
|
|
46488
46587
|
var VULNERABILITY_HELP = {
|
|
46489
46588
|
sql_injection: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cognium-dev",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.200.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.200.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/node": "^25.5.0",
|