cognium-dev 3.48.0 → 3.50.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 +428 -30
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -4035,15 +4035,54 @@ function extractJSClassInfo(node) {
|
|
|
4035
4035
|
end_line: node.endPosition.row + 1
|
|
4036
4036
|
};
|
|
4037
4037
|
}
|
|
4038
|
+
function extractDecoratorName(node) {
|
|
4039
|
+
const child = node.namedChildCount > 0 ? node.namedChild(0) : null;
|
|
4040
|
+
if (!child)
|
|
4041
|
+
return null;
|
|
4042
|
+
if (child.type === "identifier")
|
|
4043
|
+
return getNodeText(child);
|
|
4044
|
+
if (child.type === "call_expression") {
|
|
4045
|
+
const fn = child.childForFieldName("function");
|
|
4046
|
+
if (fn) {
|
|
4047
|
+
if (fn.type === "identifier")
|
|
4048
|
+
return getNodeText(fn);
|
|
4049
|
+
if (fn.type === "member_expression") {
|
|
4050
|
+
const propNode = fn.childForFieldName("property");
|
|
4051
|
+
if (propNode)
|
|
4052
|
+
return getNodeText(propNode);
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
}
|
|
4056
|
+
if (child.type === "member_expression") {
|
|
4057
|
+
const propNode = child.childForFieldName("property");
|
|
4058
|
+
if (propNode)
|
|
4059
|
+
return getNodeText(propNode);
|
|
4060
|
+
}
|
|
4061
|
+
return null;
|
|
4062
|
+
}
|
|
4038
4063
|
function extractJSMethods(body2) {
|
|
4039
4064
|
const methods = [];
|
|
4065
|
+
let pendingDecorators = [];
|
|
4040
4066
|
for (let i2 = 0;i2 < body2.childCount; i2++) {
|
|
4041
4067
|
const child = body2.child(i2);
|
|
4042
4068
|
if (!child)
|
|
4043
4069
|
continue;
|
|
4070
|
+
if (child.type === "decorator") {
|
|
4071
|
+
const name2 = extractDecoratorName(child);
|
|
4072
|
+
if (name2)
|
|
4073
|
+
pendingDecorators.push(name2);
|
|
4074
|
+
continue;
|
|
4075
|
+
}
|
|
4076
|
+
if (child.type === "comment")
|
|
4077
|
+
continue;
|
|
4044
4078
|
if (child.type === "method_definition") {
|
|
4045
|
-
|
|
4079
|
+
const m = extractJSMethodInfo(child);
|
|
4080
|
+
if (pendingDecorators.length > 0) {
|
|
4081
|
+
m.annotations = pendingDecorators;
|
|
4082
|
+
}
|
|
4083
|
+
methods.push(m);
|
|
4046
4084
|
}
|
|
4085
|
+
pendingDecorators = [];
|
|
4047
4086
|
}
|
|
4048
4087
|
return methods;
|
|
4049
4088
|
}
|
|
@@ -4214,10 +4253,19 @@ function extractJSParameters(params) {
|
|
|
4214
4253
|
if (typeNode) {
|
|
4215
4254
|
paramType = getNodeText(typeNode).replace(/^:\s*/, "");
|
|
4216
4255
|
}
|
|
4256
|
+
const decorators = [];
|
|
4257
|
+
for (let j = 0;j < child.childCount; j++) {
|
|
4258
|
+
const c = child.child(j);
|
|
4259
|
+
if (c && c.type === "decorator") {
|
|
4260
|
+
const name2 = extractDecoratorName(c);
|
|
4261
|
+
if (name2)
|
|
4262
|
+
decorators.push(name2);
|
|
4263
|
+
}
|
|
4264
|
+
}
|
|
4217
4265
|
parameters.push({
|
|
4218
4266
|
name: paramName,
|
|
4219
4267
|
type: paramType,
|
|
4220
|
-
annotations:
|
|
4268
|
+
annotations: decorators,
|
|
4221
4269
|
line: child.startPosition.row + 1
|
|
4222
4270
|
});
|
|
4223
4271
|
}
|
|
@@ -10798,6 +10846,18 @@ var DEFAULT_SINKS = [
|
|
|
10798
10846
|
{ method: "getExecutionPreamble", class: "Shell", type: "command_injection", cwe: "CWE-78", severity: "critical", arg_positions: [] },
|
|
10799
10847
|
{ method: "setQuotedArgumentsEnabled", class: "Shell", type: "command_injection", cwe: "CWE-78", severity: "high", arg_positions: [0] },
|
|
10800
10848
|
{ method: "onNewInstance", class: "SandboxInterceptor", type: "command_injection", cwe: "CWE-78", severity: "critical", arg_positions: [0] },
|
|
10849
|
+
{ method: "info", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["java"] },
|
|
10850
|
+
{ method: "warn", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["java"] },
|
|
10851
|
+
{ method: "error", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["java"] },
|
|
10852
|
+
{ method: "debug", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["java"] },
|
|
10853
|
+
{ method: "trace", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["java"] },
|
|
10854
|
+
{ method: "severe", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0], languages: ["java"] },
|
|
10855
|
+
{ method: "warning", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0], languages: ["java"] },
|
|
10856
|
+
{ method: "config", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0], languages: ["java"] },
|
|
10857
|
+
{ method: "fine", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0], languages: ["java"] },
|
|
10858
|
+
{ method: "finer", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0], languages: ["java"] },
|
|
10859
|
+
{ method: "finest", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0], languages: ["java"] },
|
|
10860
|
+
{ method: "log", class: "Logger", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [1, 2, 3], languages: ["java"] },
|
|
10801
10861
|
{ method: "exec", class: "child_process", type: "command_injection", cwe: "CWE-78", severity: "critical", arg_positions: [0] },
|
|
10802
10862
|
{ method: "execSync", class: "child_process", type: "command_injection", cwe: "CWE-78", severity: "critical", arg_positions: [0] },
|
|
10803
10863
|
{ method: "spawn", class: "child_process", type: "command_injection", cwe: "CWE-78", severity: "critical", arg_positions: [0] },
|
|
@@ -10838,6 +10898,29 @@ var DEFAULT_SINKS = [
|
|
|
10838
10898
|
{ method: "updateMany", class: "Collection", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0] },
|
|
10839
10899
|
{ method: "deleteOne", class: "Collection", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0] },
|
|
10840
10900
|
{ method: "deleteMany", class: "Collection", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0] },
|
|
10901
|
+
{ method: "find", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10902
|
+
{ method: "findOne", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10903
|
+
{ method: "findById", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10904
|
+
{ method: "findOneAndUpdate", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0, 1], languages: ["javascript", "typescript"] },
|
|
10905
|
+
{ method: "findOneAndDelete", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10906
|
+
{ method: "findOneAndReplace", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0, 1], languages: ["javascript", "typescript"] },
|
|
10907
|
+
{ method: "updateOne", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0, 1], languages: ["javascript", "typescript"] },
|
|
10908
|
+
{ method: "updateMany", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0, 1], languages: ["javascript", "typescript"] },
|
|
10909
|
+
{ method: "deleteOne", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10910
|
+
{ method: "deleteMany", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10911
|
+
{ method: "countDocuments", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10912
|
+
{ method: "aggregate", class: "Model", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10913
|
+
{ method: "where", class: "Query", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10914
|
+
{ method: "equals", class: "Query", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10915
|
+
{ method: "findOne", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10916
|
+
{ method: "findOneAndUpdate", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0, 1], languages: ["javascript", "typescript"] },
|
|
10917
|
+
{ method: "findOneAndDelete", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10918
|
+
{ method: "findOneAndReplace", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0, 1], languages: ["javascript", "typescript"] },
|
|
10919
|
+
{ method: "updateOne", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0, 1], languages: ["javascript", "typescript"] },
|
|
10920
|
+
{ method: "updateMany", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0, 1], languages: ["javascript", "typescript"] },
|
|
10921
|
+
{ method: "deleteOne", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10922
|
+
{ method: "deleteMany", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10923
|
+
{ method: "aggregate", type: "nosql_injection", cwe: "CWE-943", severity: "high", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10841
10924
|
{ method: "get", class: "axios", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
|
|
10842
10925
|
{ method: "post", class: "axios", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
|
|
10843
10926
|
{ method: "request", class: "axios", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
|
|
@@ -10854,6 +10937,13 @@ var DEFAULT_SINKS = [
|
|
|
10854
10937
|
{ method: "get", class: "superagent", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
|
|
10855
10938
|
{ method: "post", class: "superagent", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
|
|
10856
10939
|
{ method: "default", class: "node-fetch", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
|
|
10940
|
+
{ method: "log", class: "console", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["javascript", "typescript"] },
|
|
10941
|
+
{ method: "warn", class: "console", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["javascript", "typescript"] },
|
|
10942
|
+
{ method: "error", class: "console", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["javascript", "typescript"] },
|
|
10943
|
+
{ method: "info", class: "console", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["javascript", "typescript"] },
|
|
10944
|
+
{ method: "debug", class: "console", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["javascript", "typescript"] },
|
|
10945
|
+
{ method: "trace", class: "console", type: "log_injection", cwe: "CWE-117", severity: "low", arg_positions: [0, 1, 2, 3], languages: ["javascript", "typescript"] },
|
|
10946
|
+
{ method: "redirect", type: "open_redirect", cwe: "CWE-601", severity: "medium", arg_positions: [0], languages: ["javascript", "typescript"] },
|
|
10857
10947
|
{ method: "system", class: "os", type: "command_injection", cwe: "CWE-78", severity: "critical", arg_positions: [0] },
|
|
10858
10948
|
{ method: "popen", class: "os", type: "command_injection", cwe: "CWE-78", severity: "critical", arg_positions: [0] },
|
|
10859
10949
|
{ method: "run", class: "subprocess", type: "command_injection", cwe: "CWE-78", severity: "critical", arg_positions: [0] },
|
|
@@ -10880,7 +10970,7 @@ var DEFAULT_SINKS = [
|
|
|
10880
10970
|
{ method: "rmdir", class: "os", type: "path_traversal", cwe: "CWE-22", severity: "high", arg_positions: [0] },
|
|
10881
10971
|
{ method: "rmtree", class: "shutil", type: "path_traversal", cwe: "CWE-22", severity: "critical", arg_positions: [0] },
|
|
10882
10972
|
{ method: "send_file", type: "path_traversal", cwe: "CWE-22", severity: "high", arg_positions: [0], languages: ["python"] },
|
|
10883
|
-
{ method: "render_template_string", type: "
|
|
10973
|
+
{ method: "render_template_string", type: "code_injection", cwe: "CWE-94", severity: "critical", arg_positions: [0], languages: ["python"] },
|
|
10884
10974
|
{ method: "Markup", type: "xss", cwe: "CWE-79", severity: "high", arg_positions: [0], languages: ["python"] },
|
|
10885
10975
|
{ method: "mark_safe", type: "xss", cwe: "CWE-79", severity: "high", arg_positions: [0], languages: ["python"] },
|
|
10886
10976
|
{ method: "get", class: "requests", type: "ssrf", cwe: "CWE-918", severity: "high", arg_positions: [0] },
|
|
@@ -11142,6 +11232,10 @@ var DEFAULT_SANITIZERS = [
|
|
|
11142
11232
|
{ method: "secure_filename", class: "werkzeug.utils", removes: ["path_traversal"] },
|
|
11143
11233
|
{ method: "basename", class: "os.path", removes: ["path_traversal"] },
|
|
11144
11234
|
{ method: "normpath", class: "os.path", removes: ["path_traversal"] },
|
|
11235
|
+
{ method: "realpath", class: "os.path", removes: ["path_traversal"] },
|
|
11236
|
+
{ method: "abspath", class: "os.path", removes: ["path_traversal"] },
|
|
11237
|
+
{ method: "realpath", class: "path", removes: ["path_traversal"] },
|
|
11238
|
+
{ method: "abspath", class: "path", removes: ["path_traversal"] },
|
|
11145
11239
|
{ method: "int", removes: ["sql_injection", "command_injection", "xss"] },
|
|
11146
11240
|
{ method: "float", removes: ["sql_injection", "command_injection"] },
|
|
11147
11241
|
{ method: "query!", removes: ["sql_injection"] },
|
|
@@ -11270,7 +11364,7 @@ var PYTHON_TAINTED_PATTERNS = [
|
|
|
11270
11364
|
function analyzeTaint(calls, types, config = getDefaultConfig(), typeHierarchy, language, code) {
|
|
11271
11365
|
const sourceLines = code !== undefined ? code.split(`
|
|
11272
11366
|
`) : undefined;
|
|
11273
|
-
const sources = findSources(calls, types, config.sources, sourceLines);
|
|
11367
|
+
const sources = findSources(calls, types, config.sources, sourceLines, language);
|
|
11274
11368
|
const sinks = findSinks(calls, config.sinks, typeHierarchy, language, sourceLines);
|
|
11275
11369
|
const sanitizers = findSanitizers(calls, types, config.sanitizers);
|
|
11276
11370
|
return { sources, sinks, sanitizers };
|
|
@@ -11289,7 +11383,7 @@ function attachSourceLineCode(sources, sinks, code) {
|
|
|
11289
11383
|
}
|
|
11290
11384
|
}
|
|
11291
11385
|
}
|
|
11292
|
-
function findSources(calls, types, patterns, sourceLines) {
|
|
11386
|
+
function findSources(calls, types, patterns, sourceLines, language) {
|
|
11293
11387
|
const sources = [];
|
|
11294
11388
|
for (const call of calls) {
|
|
11295
11389
|
for (const pattern of patterns) {
|
|
@@ -11344,23 +11438,31 @@ function findSources(calls, types, patterns, sourceLines) {
|
|
|
11344
11438
|
}
|
|
11345
11439
|
}
|
|
11346
11440
|
}
|
|
11347
|
-
const
|
|
11441
|
+
const RUST_EXTRACTOR_KIND = /(?:^|::)(Json|Form|Query|Path|Extension|Multipart|Body|Bytes)(?:<|$)/;
|
|
11348
11442
|
for (const type of types) {
|
|
11349
11443
|
for (const method of type.methods) {
|
|
11350
11444
|
for (const param of method.parameters) {
|
|
11351
|
-
if (param.type
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11445
|
+
if (!param.type)
|
|
11446
|
+
continue;
|
|
11447
|
+
const kindMatch = RUST_EXTRACTOR_KIND.exec(param.type);
|
|
11448
|
+
if (!kindMatch)
|
|
11449
|
+
continue;
|
|
11450
|
+
const kind = kindMatch[1];
|
|
11451
|
+
if (kind === "Extension")
|
|
11452
|
+
continue;
|
|
11453
|
+
const sourceType = kind === "Form" || kind === "Query" || kind === "Path" ? "http_param" : "http_body";
|
|
11454
|
+
const paramLine = param.line ?? method.start_line;
|
|
11455
|
+
const alreadyExists = sources.some((s) => s.line === paramLine && s.variable === param.name);
|
|
11456
|
+
if (alreadyExists)
|
|
11457
|
+
continue;
|
|
11458
|
+
sources.push({
|
|
11459
|
+
type: sourceType,
|
|
11460
|
+
location: `${param.type} ${param.name} in ${method.name}`,
|
|
11461
|
+
severity: "high",
|
|
11462
|
+
line: paramLine,
|
|
11463
|
+
confidence: 1,
|
|
11464
|
+
variable: param.name
|
|
11465
|
+
});
|
|
11364
11466
|
}
|
|
11365
11467
|
}
|
|
11366
11468
|
}
|
|
@@ -11442,6 +11544,17 @@ function findSources(calls, types, patterns, sourceLines) {
|
|
|
11442
11544
|
s.code = sourceLines[s.line - 1]?.trim();
|
|
11443
11545
|
}
|
|
11444
11546
|
}
|
|
11547
|
+
if (language === "rust" && sourceLines) {
|
|
11548
|
+
const LET_BINDING = /^\s*let\s+(?:mut\s+)?([A-Za-z_]\w*)\s*(?::\s*[^=]+)?=/;
|
|
11549
|
+
for (const s of result) {
|
|
11550
|
+
if (s.variable && s.variable.length > 0)
|
|
11551
|
+
continue;
|
|
11552
|
+
const lineText = sourceLines[s.line - 1] ?? "";
|
|
11553
|
+
const m = LET_BINDING.exec(lineText);
|
|
11554
|
+
if (m)
|
|
11555
|
+
s.variable = m[1];
|
|
11556
|
+
}
|
|
11557
|
+
}
|
|
11445
11558
|
return result;
|
|
11446
11559
|
}
|
|
11447
11560
|
function isInterproceduralTaintableType(typeName) {
|
|
@@ -11538,6 +11651,26 @@ function isParameterizedQueryCall(call, pattern) {
|
|
|
11538
11651
|
}
|
|
11539
11652
|
return false;
|
|
11540
11653
|
}
|
|
11654
|
+
function isSafePythonSubprocessCall(call, pattern, language) {
|
|
11655
|
+
if (language !== "python")
|
|
11656
|
+
return false;
|
|
11657
|
+
if (pattern.type !== "command_injection")
|
|
11658
|
+
return false;
|
|
11659
|
+
if (pattern.class !== "subprocess")
|
|
11660
|
+
return false;
|
|
11661
|
+
const arg0 = call.arguments.find((a) => a.position === 0);
|
|
11662
|
+
if (!arg0)
|
|
11663
|
+
return false;
|
|
11664
|
+
const expr0 = (arg0.literal ?? arg0.expression ?? "").trim();
|
|
11665
|
+
if (!expr0.startsWith("["))
|
|
11666
|
+
return false;
|
|
11667
|
+
for (const a of call.arguments) {
|
|
11668
|
+
const e = (a.expression ?? "").trim();
|
|
11669
|
+
if (/^shell\s*=\s*True\b/.test(e))
|
|
11670
|
+
return false;
|
|
11671
|
+
}
|
|
11672
|
+
return true;
|
|
11673
|
+
}
|
|
11541
11674
|
var CLASS_LITERAL_RE = /^(?:[A-Za-z_][\w]*\.)*[A-Z][\w]*(?:\[\])*\.class$/;
|
|
11542
11675
|
function argIsClassLiteral(call, position) {
|
|
11543
11676
|
const arg = call.arguments.find((a) => a.position === position);
|
|
@@ -11556,6 +11689,9 @@ function findSinks(calls, patterns, typeHierarchy, language, sourceLines) {
|
|
|
11556
11689
|
if (isParameterizedQueryCall(call, pattern)) {
|
|
11557
11690
|
continue;
|
|
11558
11691
|
}
|
|
11692
|
+
if (isSafePythonSubprocessCall(call, pattern, language)) {
|
|
11693
|
+
continue;
|
|
11694
|
+
}
|
|
11559
11695
|
if (pattern.safe_if_class_literal_at !== undefined && argIsClassLiteral(call, pattern.safe_if_class_literal_at)) {
|
|
11560
11696
|
continue;
|
|
11561
11697
|
}
|
|
@@ -11950,7 +12086,8 @@ function receiverMightBeClass(receiver, className) {
|
|
|
11950
12086
|
"controller",
|
|
11951
12087
|
"task",
|
|
11952
12088
|
"thread",
|
|
11953
|
-
"job"
|
|
12089
|
+
"job",
|
|
12090
|
+
"cur"
|
|
11954
12091
|
]);
|
|
11955
12092
|
const isAmbiguous = ambiguousIdentifiers.has(lowerReceiver);
|
|
11956
12093
|
if (!isAmbiguous && lowerReceiver.length >= 3 && lowerClass.includes(lowerReceiver)) {
|
|
@@ -11960,7 +12097,9 @@ function receiverMightBeClass(receiver, className) {
|
|
|
11960
12097
|
}
|
|
11961
12098
|
if (!isAmbiguous && lowerReceiver.length >= 2) {
|
|
11962
12099
|
if (lowerClass.startsWith(lowerReceiver) || lowerClass.endsWith(lowerReceiver)) {
|
|
11963
|
-
|
|
12100
|
+
if (lowerReceiver.length / lowerClass.length >= 0.4) {
|
|
12101
|
+
return true;
|
|
12102
|
+
}
|
|
11964
12103
|
}
|
|
11965
12104
|
}
|
|
11966
12105
|
if (!isAmbiguous && lowerReceiver.length >= 3) {
|
|
@@ -11981,6 +12120,8 @@ function receiverMightBeClass(receiver, className) {
|
|
|
11981
12120
|
ps: ["PreparedStatement"],
|
|
11982
12121
|
rs: ["ResultSet"],
|
|
11983
12122
|
template: ["JdbcTemplate"],
|
|
12123
|
+
cur: ["Cursor"],
|
|
12124
|
+
cursor: ["Cursor"],
|
|
11984
12125
|
writer: ["PrintWriter"],
|
|
11985
12126
|
out: ["PrintWriter", "OutputStream"],
|
|
11986
12127
|
reader: ["BufferedReader"],
|
|
@@ -14468,7 +14609,7 @@ function isFalsePositive(result, sinkLine, taintedVar) {
|
|
|
14468
14609
|
if (varValue && varValue.type !== "unknown" && !result.tainted.has(taintedVar)) {
|
|
14469
14610
|
return { isFalsePositive: true, reason: `variable_is_constant: ${varValue.value}` };
|
|
14470
14611
|
}
|
|
14471
|
-
if (result.symbols.
|
|
14612
|
+
if (result.symbols.has(taintedVar) && !result.tainted.has(taintedVar)) {
|
|
14472
14613
|
return { isFalsePositive: true, reason: "variable_not_tainted" };
|
|
14473
14614
|
}
|
|
14474
14615
|
return { isFalsePositive: false, reason: null };
|
|
@@ -20540,6 +20681,40 @@ function buildJavaScriptTaintedVars(sourceCode, language) {
|
|
|
20540
20681
|
}
|
|
20541
20682
|
return tainted;
|
|
20542
20683
|
}
|
|
20684
|
+
function buildRustTaintedVars(sourceCode, seedVars) {
|
|
20685
|
+
const derived = new Map;
|
|
20686
|
+
const knownTainted = new Set(seedVars);
|
|
20687
|
+
const lines = sourceCode.split(`
|
|
20688
|
+
`);
|
|
20689
|
+
let changed = true;
|
|
20690
|
+
while (changed) {
|
|
20691
|
+
changed = false;
|
|
20692
|
+
for (let i2 = 0;i2 < lines.length; i2++) {
|
|
20693
|
+
const line = lines[i2];
|
|
20694
|
+
const trimmed = line.trimStart();
|
|
20695
|
+
if (trimmed.startsWith("//"))
|
|
20696
|
+
continue;
|
|
20697
|
+
const letMatch = line.match(/^\s*let\s+(?:mut\s+)?([A-Za-z_]\w*)\s*(?::\s*[^=]+)?=\s*(.+?)(?:;|$)/);
|
|
20698
|
+
const assignMatch = !letMatch ? line.match(/^\s*([A-Za-z_]\w*)\s*=\s*(.+?)(?:;|$)/) : null;
|
|
20699
|
+
const m = letMatch ?? assignMatch;
|
|
20700
|
+
if (!m)
|
|
20701
|
+
continue;
|
|
20702
|
+
const lhs = m[1];
|
|
20703
|
+
const rhs = m[2];
|
|
20704
|
+
if (lhs === "if" || lhs === "while" || lhs === "for" || lhs === "match" || lhs === "return")
|
|
20705
|
+
continue;
|
|
20706
|
+
if (knownTainted.has(lhs))
|
|
20707
|
+
continue;
|
|
20708
|
+
const ref = [...knownTainted].some((v) => new RegExp(`\\b${v}\\b`).test(rhs));
|
|
20709
|
+
if (ref) {
|
|
20710
|
+
derived.set(lhs, i2 + 1);
|
|
20711
|
+
knownTainted.add(lhs);
|
|
20712
|
+
changed = true;
|
|
20713
|
+
}
|
|
20714
|
+
}
|
|
20715
|
+
}
|
|
20716
|
+
return derived;
|
|
20717
|
+
}
|
|
20543
20718
|
var BASH_POSITIONAL_PARAMS = new Set(["1", "2", "3", "4", "5", "6", "7", "8", "9", "@", "*"]);
|
|
20544
20719
|
var BASH_UNTRUSTED_ENV_PATTERNS = [
|
|
20545
20720
|
/^USER_INPUT$/i,
|
|
@@ -20962,7 +21137,23 @@ function evaluateSimpleExpression(expr, symbols) {
|
|
|
20962
21137
|
}
|
|
20963
21138
|
function isStringLiteralExpression(expr) {
|
|
20964
21139
|
const trimmed = expr.trim();
|
|
20965
|
-
|
|
21140
|
+
if (trimmed.length < 2)
|
|
21141
|
+
return false;
|
|
21142
|
+
const quote = trimmed[0];
|
|
21143
|
+
if (quote !== '"' && quote !== "'")
|
|
21144
|
+
return false;
|
|
21145
|
+
let i2 = 1;
|
|
21146
|
+
while (i2 < trimmed.length) {
|
|
21147
|
+
const c = trimmed[i2];
|
|
21148
|
+
if (c === "\\") {
|
|
21149
|
+
i2 += 2;
|
|
21150
|
+
continue;
|
|
21151
|
+
}
|
|
21152
|
+
if (c === quote)
|
|
21153
|
+
return i2 === trimmed.length - 1;
|
|
21154
|
+
i2++;
|
|
21155
|
+
}
|
|
21156
|
+
return false;
|
|
20966
21157
|
}
|
|
20967
21158
|
function filterCleanArraySinks(sinks, calls, taintedArrayElements, symbols) {
|
|
20968
21159
|
const callsByLine = new Map;
|
|
@@ -21320,6 +21511,28 @@ function buildTaintFlow(source, sink, taintInfo) {
|
|
|
21320
21511
|
};
|
|
21321
21512
|
}
|
|
21322
21513
|
|
|
21514
|
+
// ../circle-ir/dist/analysis/findings.js
|
|
21515
|
+
function canSourceReachSink(sourceType, sinkType) {
|
|
21516
|
+
const sourceToSinkMapping = {
|
|
21517
|
+
http_param: ["sql_injection", "command_injection", "path_traversal", "xss", "xpath_injection", "ldap_injection", "ssrf", "mybatis_mapper_call", "code_injection"],
|
|
21518
|
+
http_body: ["sql_injection", "command_injection", "deserialization", "xxe", "xss", "code_injection", "mybatis_mapper_call"],
|
|
21519
|
+
http_header: ["sql_injection", "xss", "ssrf", "mybatis_mapper_call", "code_injection"],
|
|
21520
|
+
http_cookie: ["sql_injection", "xss", "mybatis_mapper_call", "code_injection"],
|
|
21521
|
+
http_path: ["path_traversal", "sql_injection", "ssrf", "mybatis_mapper_call"],
|
|
21522
|
+
http_query: ["sql_injection", "command_injection", "xss", "ssrf", "mybatis_mapper_call", "code_injection"],
|
|
21523
|
+
io_input: ["command_injection", "path_traversal", "deserialization", "xxe", "code_injection", "xss"],
|
|
21524
|
+
env_input: ["command_injection", "path_traversal"],
|
|
21525
|
+
db_input: ["xss", "sql_injection"],
|
|
21526
|
+
file_input: ["deserialization", "xxe", "path_traversal", "command_injection", "code_injection"],
|
|
21527
|
+
network_input: ["sql_injection", "command_injection", "xss", "ssrf"],
|
|
21528
|
+
config_param: ["sql_injection", "command_injection", "path_traversal", "xss", "ssrf"],
|
|
21529
|
+
interprocedural_param: ["sql_injection", "command_injection", "path_traversal", "xss", "xpath_injection", "ldap_injection", "ssrf", "code_injection", "mybatis_mapper_call"],
|
|
21530
|
+
plugin_param: ["sql_injection", "command_injection", "path_traversal", "xss", "code_injection"]
|
|
21531
|
+
};
|
|
21532
|
+
const validSinks = sourceToSinkMapping[sourceType];
|
|
21533
|
+
return validSinks ? validSinks.includes(sinkType) : false;
|
|
21534
|
+
}
|
|
21535
|
+
|
|
21323
21536
|
// ../circle-ir/dist/analysis/passes/taint-propagation-pass.js
|
|
21324
21537
|
class TaintPropagationPass {
|
|
21325
21538
|
name = "taint-propagation";
|
|
@@ -21330,7 +21543,11 @@ class TaintPropagationPass {
|
|
|
21330
21543
|
const constProp = ctx.getResult("constant-propagation");
|
|
21331
21544
|
const sinkFilter = ctx.getResult("sink-filter");
|
|
21332
21545
|
const { sources, sinks, sanitizers } = sinkFilter;
|
|
21333
|
-
if (
|
|
21546
|
+
if (sinks.length === 0) {
|
|
21547
|
+
return { flows: [] };
|
|
21548
|
+
}
|
|
21549
|
+
const canSynthesize = ctx.language === "python" && typeof ctx.code === "string";
|
|
21550
|
+
if (sources.length === 0 && !canSynthesize) {
|
|
21334
21551
|
return { flows: [] };
|
|
21335
21552
|
}
|
|
21336
21553
|
const propagationResult = propagateTaint2(graph, sources, sinks, sanitizers);
|
|
@@ -21393,7 +21610,7 @@ class TaintPropagationPass {
|
|
|
21393
21610
|
flows.push(f);
|
|
21394
21611
|
}
|
|
21395
21612
|
}
|
|
21396
|
-
const exprScanFlows = detectExpressionScanFlows(calls, sources, sinks, constProp.unreachableLines, ctx.code, ctx.language) ?? [];
|
|
21613
|
+
const exprScanFlows = detectExpressionScanFlows(calls, sources, sinks, sanitizers, constProp.unreachableLines, ctx.code, ctx.language) ?? [];
|
|
21397
21614
|
for (const f of exprScanFlows) {
|
|
21398
21615
|
if (flows.some((x) => x.source_line === f.source_line && x.sink_line === f.sink_line && x.sink_type === f.sink_type))
|
|
21399
21616
|
continue;
|
|
@@ -21611,13 +21828,82 @@ function detectParameterSinkFlows(types, calls, sources, sinks, unreachableLines
|
|
|
21611
21828
|
}
|
|
21612
21829
|
return flows;
|
|
21613
21830
|
}
|
|
21614
|
-
function detectExpressionScanFlows(calls, sources, sinks, unreachableLines, code, language) {
|
|
21831
|
+
function detectExpressionScanFlows(calls, sources, sinks, sanitizers, unreachableLines, code, language) {
|
|
21615
21832
|
const flows = [];
|
|
21616
21833
|
const sourcesWithVar = sources.filter((s) => typeof s.variable === "string" && s.variable.length > 0);
|
|
21617
|
-
|
|
21618
|
-
return flows;
|
|
21834
|
+
const aliasSanitizedFor = new Map;
|
|
21619
21835
|
if (language === "python" && typeof code === "string") {
|
|
21620
21836
|
const derived = buildPythonTaintedVars(code);
|
|
21837
|
+
if (derived.size > 0) {
|
|
21838
|
+
const existingVars = new Set(sourcesWithVar.map((s) => s.variable));
|
|
21839
|
+
const hasRealSource = sourcesWithVar.length > 0;
|
|
21840
|
+
let anchor = sourcesWithVar[0];
|
|
21841
|
+
if (anchor) {
|
|
21842
|
+
for (const s of sourcesWithVar) {
|
|
21843
|
+
if (s.line < anchor.line)
|
|
21844
|
+
anchor = s;
|
|
21845
|
+
}
|
|
21846
|
+
}
|
|
21847
|
+
for (const [varName, originLine] of derived) {
|
|
21848
|
+
if (!varName || existingVars.has(varName))
|
|
21849
|
+
continue;
|
|
21850
|
+
if (hasRealSource && anchor) {
|
|
21851
|
+
sourcesWithVar.push({
|
|
21852
|
+
...anchor,
|
|
21853
|
+
variable: varName
|
|
21854
|
+
});
|
|
21855
|
+
} else {
|
|
21856
|
+
sourcesWithVar.push({
|
|
21857
|
+
type: "http_param",
|
|
21858
|
+
location: `<derived> ${varName}`,
|
|
21859
|
+
severity: "high",
|
|
21860
|
+
line: originLine,
|
|
21861
|
+
confidence: 0.9,
|
|
21862
|
+
variable: varName
|
|
21863
|
+
});
|
|
21864
|
+
}
|
|
21865
|
+
existingVars.add(varName);
|
|
21866
|
+
}
|
|
21867
|
+
if (sanitizers && sanitizers.length > 0) {
|
|
21868
|
+
const sanitizersByLine = new Map;
|
|
21869
|
+
for (const s of sanitizers) {
|
|
21870
|
+
const arr = sanitizersByLine.get(s.line) ?? [];
|
|
21871
|
+
arr.push(s);
|
|
21872
|
+
sanitizersByLine.set(s.line, arr);
|
|
21873
|
+
}
|
|
21874
|
+
const codeLines = code.split(`
|
|
21875
|
+
`);
|
|
21876
|
+
for (const [varName, originLine] of derived) {
|
|
21877
|
+
const lineSans = sanitizersByLine.get(originLine);
|
|
21878
|
+
if (!lineSans || lineSans.length === 0)
|
|
21879
|
+
continue;
|
|
21880
|
+
const lineText = codeLines[originLine - 1] ?? "";
|
|
21881
|
+
const rhsMatch = lineText.match(/^\s*\w+\s*=\s*(.+)$/);
|
|
21882
|
+
if (!rhsMatch)
|
|
21883
|
+
continue;
|
|
21884
|
+
const rhs = rhsMatch[1];
|
|
21885
|
+
for (const san of lineSans) {
|
|
21886
|
+
const sanMatch = san.method.match(/^(?:(\w+)\.)?(\w+)\(\)$/);
|
|
21887
|
+
if (!sanMatch)
|
|
21888
|
+
continue;
|
|
21889
|
+
const sanName = sanMatch[1] ? `${sanMatch[1]}.${sanMatch[2]}` : sanMatch[2];
|
|
21890
|
+
if (!rhs.includes(`${sanName}(`))
|
|
21891
|
+
continue;
|
|
21892
|
+
let set = aliasSanitizedFor.get(varName);
|
|
21893
|
+
if (!set) {
|
|
21894
|
+
set = new Set;
|
|
21895
|
+
aliasSanitizedFor.set(varName, set);
|
|
21896
|
+
}
|
|
21897
|
+
for (const t of san.sanitizes)
|
|
21898
|
+
set.add(t);
|
|
21899
|
+
}
|
|
21900
|
+
}
|
|
21901
|
+
}
|
|
21902
|
+
}
|
|
21903
|
+
}
|
|
21904
|
+
if (language === "rust" && typeof code === "string" && sourcesWithVar.length > 0) {
|
|
21905
|
+
const seedVars = new Set(sourcesWithVar.map((s) => s.variable));
|
|
21906
|
+
const derived = buildRustTaintedVars(code, seedVars);
|
|
21621
21907
|
if (derived.size > 0) {
|
|
21622
21908
|
let anchor = sourcesWithVar[0];
|
|
21623
21909
|
for (const s of sourcesWithVar) {
|
|
@@ -21669,6 +21955,9 @@ function detectExpressionScanFlows(calls, sources, sinks, unreachableLines, code
|
|
|
21669
21955
|
continue;
|
|
21670
21956
|
if (flows.some((f) => f.source_line === source.line && f.sink_line === sink.line && f.sink_type === sink.type))
|
|
21671
21957
|
continue;
|
|
21958
|
+
if (aliasSanitizedFor.get(source.variable)?.has(sink.type)) {
|
|
21959
|
+
break;
|
|
21960
|
+
}
|
|
21672
21961
|
flows.push({
|
|
21673
21962
|
source_line: source.line,
|
|
21674
21963
|
sink_line: sink.line,
|
|
@@ -21686,6 +21975,39 @@ function detectExpressionScanFlows(calls, sources, sinks, unreachableLines, code
|
|
|
21686
21975
|
}
|
|
21687
21976
|
}
|
|
21688
21977
|
}
|
|
21978
|
+
const sourcesByLine = new Map;
|
|
21979
|
+
for (const s of sources) {
|
|
21980
|
+
if (s.variable && s.variable.length > 0)
|
|
21981
|
+
continue;
|
|
21982
|
+
const arr = sourcesByLine.get(s.line) ?? [];
|
|
21983
|
+
arr.push(s);
|
|
21984
|
+
sourcesByLine.set(s.line, arr);
|
|
21985
|
+
}
|
|
21986
|
+
for (const sink of sinks) {
|
|
21987
|
+
if (unreachableLines.has(sink.line))
|
|
21988
|
+
continue;
|
|
21989
|
+
const colocSources = sourcesByLine.get(sink.line);
|
|
21990
|
+
if (!colocSources || colocSources.length === 0)
|
|
21991
|
+
continue;
|
|
21992
|
+
for (const source of colocSources) {
|
|
21993
|
+
if (!canSourceReachSink(source.type, sink.type))
|
|
21994
|
+
continue;
|
|
21995
|
+
if (flows.some((f) => f.source_line === source.line && f.sink_line === sink.line && f.sink_type === sink.type))
|
|
21996
|
+
continue;
|
|
21997
|
+
flows.push({
|
|
21998
|
+
source_line: source.line,
|
|
21999
|
+
sink_line: sink.line,
|
|
22000
|
+
source_type: source.type,
|
|
22001
|
+
sink_type: sink.type,
|
|
22002
|
+
path: [
|
|
22003
|
+
{ variable: "<inline>", line: source.line, type: "source" },
|
|
22004
|
+
{ variable: "<inline>", line: sink.line, type: "sink" }
|
|
22005
|
+
],
|
|
22006
|
+
confidence: source.confidence * sink.confidence * 0.85,
|
|
22007
|
+
sanitized: false
|
|
22008
|
+
});
|
|
22009
|
+
}
|
|
22010
|
+
}
|
|
21689
22011
|
return flows;
|
|
21690
22012
|
}
|
|
21691
22013
|
|
|
@@ -22122,7 +22444,7 @@ class InterproceduralPass {
|
|
|
22122
22444
|
const taintProp = ctx.getResult("taint-propagation");
|
|
22123
22445
|
const { sources, sinks, sanitizers } = sinkFilter;
|
|
22124
22446
|
if (sources.length === 0) {
|
|
22125
|
-
return { additionalSinks: [], additionalFlows: [] };
|
|
22447
|
+
return { additionalSinks: [], additionalFlows: [...taintProp.flows] };
|
|
22126
22448
|
}
|
|
22127
22449
|
const additionalSinks = [];
|
|
22128
22450
|
const additionalFlows = [...taintProp.flows];
|
|
@@ -22242,6 +22564,9 @@ class InterproceduralPass {
|
|
|
22242
22564
|
}
|
|
22243
22565
|
}
|
|
22244
22566
|
}
|
|
22567
|
+
if (additionalSinks.length > 0) {
|
|
22568
|
+
attachSourceLineCode([], additionalSinks, ctx.code);
|
|
22569
|
+
}
|
|
22245
22570
|
return { additionalSinks, additionalFlows, interprocedural };
|
|
22246
22571
|
}
|
|
22247
22572
|
}
|
|
@@ -26781,6 +27106,77 @@ function isPotentialPojo(type) {
|
|
|
26781
27106
|
return first >= 65 && first <= 90;
|
|
26782
27107
|
}
|
|
26783
27108
|
|
|
27109
|
+
// ../circle-ir/dist/analysis/passes/insecure-cookie-pass.js
|
|
27110
|
+
var COOKIE_RESPONSE_RECEIVERS = new Set([
|
|
27111
|
+
"res",
|
|
27112
|
+
"response",
|
|
27113
|
+
"reply"
|
|
27114
|
+
]);
|
|
27115
|
+
var SECURE_TRUE_RE = /\bsecure\s*:\s*true\b/;
|
|
27116
|
+
var HTTPONLY_TRUE_RE = /\bhttpOnly\s*:\s*true\b/i;
|
|
27117
|
+
|
|
27118
|
+
class InsecureCookiePass {
|
|
27119
|
+
name = "insecure-cookie";
|
|
27120
|
+
category = "security";
|
|
27121
|
+
run(ctx) {
|
|
27122
|
+
const { graph, language } = ctx;
|
|
27123
|
+
if (language !== "javascript" && language !== "typescript") {
|
|
27124
|
+
return { insecureCookies: [] };
|
|
27125
|
+
}
|
|
27126
|
+
const file = graph.ir.meta.file;
|
|
27127
|
+
const insecureCookies = [];
|
|
27128
|
+
for (const call of graph.ir.calls) {
|
|
27129
|
+
if (call.method_name !== "cookie")
|
|
27130
|
+
continue;
|
|
27131
|
+
const receiver = call.receiver ?? "";
|
|
27132
|
+
if (!COOKIE_RESPONSE_RECEIVERS.has(receiver))
|
|
27133
|
+
continue;
|
|
27134
|
+
if (call.arguments.length < 2)
|
|
27135
|
+
continue;
|
|
27136
|
+
const opts = call.arguments.find((a) => a.position === 2);
|
|
27137
|
+
const optsExpr = (opts?.expression ?? "").trim();
|
|
27138
|
+
const optionsPresent = optsExpr.length > 0;
|
|
27139
|
+
const missingSecure = !SECURE_TRUE_RE.test(optsExpr);
|
|
27140
|
+
const missingHttpOnly = !HTTPONLY_TRUE_RE.test(optsExpr);
|
|
27141
|
+
if (!missingSecure && !missingHttpOnly)
|
|
27142
|
+
continue;
|
|
27143
|
+
const line = call.location.line;
|
|
27144
|
+
insecureCookies.push({
|
|
27145
|
+
line,
|
|
27146
|
+
receiver,
|
|
27147
|
+
missingSecure,
|
|
27148
|
+
missingHttpOnly,
|
|
27149
|
+
optionsPresent
|
|
27150
|
+
});
|
|
27151
|
+
const missing = [];
|
|
27152
|
+
if (missingSecure)
|
|
27153
|
+
missing.push("`secure: true`");
|
|
27154
|
+
if (missingHttpOnly)
|
|
27155
|
+
missing.push("`httpOnly: true`");
|
|
27156
|
+
ctx.addFinding({
|
|
27157
|
+
id: `${this.name}-${file}-${line}`,
|
|
27158
|
+
pass: this.name,
|
|
27159
|
+
category: this.category,
|
|
27160
|
+
rule_id: this.name,
|
|
27161
|
+
cwe: "CWE-614",
|
|
27162
|
+
severity: "medium",
|
|
27163
|
+
level: "warning",
|
|
27164
|
+
message: `Cookie set without ${missing.join(" and ")} — vulnerable to ` + `cleartext transmission (CWE-614) and client-side JS access ` + `(CWE-1004).`,
|
|
27165
|
+
file,
|
|
27166
|
+
line,
|
|
27167
|
+
fix: 'Pass `{ secure: true, httpOnly: true, sameSite: "lax" }` as the ' + "third argument to `res.cookie()`.",
|
|
27168
|
+
evidence: {
|
|
27169
|
+
receiver,
|
|
27170
|
+
options_present: optionsPresent,
|
|
27171
|
+
missing_secure: missingSecure,
|
|
27172
|
+
missing_http_only: missingHttpOnly
|
|
27173
|
+
}
|
|
27174
|
+
});
|
|
27175
|
+
}
|
|
27176
|
+
return { insecureCookies };
|
|
27177
|
+
}
|
|
27178
|
+
}
|
|
27179
|
+
|
|
26784
27180
|
// ../circle-ir/dist/graph/import-graph.js
|
|
26785
27181
|
function dirname(filePath) {
|
|
26786
27182
|
const idx = filePath.lastIndexOf("/");
|
|
@@ -27891,6 +28287,8 @@ async function analyze(code, filePath, language, options = {}) {
|
|
|
27891
28287
|
pipeline.add(new SecurityHeadersPass(passOpts.securityHeaders));
|
|
27892
28288
|
if (!disabledPasses.has("spring4shell"))
|
|
27893
28289
|
pipeline.add(new Spring4ShellPass);
|
|
28290
|
+
if (!disabledPasses.has("insecure-cookie"))
|
|
28291
|
+
pipeline.add(new InsecureCookiePass);
|
|
27894
28292
|
const { results, findings } = pipeline.run(graph, code, language, config);
|
|
27895
28293
|
const sinkFilter = results.get("sink-filter");
|
|
27896
28294
|
const interProc = results.get("interprocedural");
|
|
@@ -28084,7 +28482,7 @@ var colors = {
|
|
|
28084
28482
|
};
|
|
28085
28483
|
|
|
28086
28484
|
// src/version.ts
|
|
28087
|
-
var version = "3.
|
|
28485
|
+
var version = "3.50.0";
|
|
28088
28486
|
|
|
28089
28487
|
// src/formatters.ts
|
|
28090
28488
|
var SINK_SEVERITY = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cognium-dev",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.50.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.50.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^25.5.0",
|