cognium-dev 3.113.0 → 3.115.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 +61 -6
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -11697,7 +11697,8 @@ function analyzeTaint(calls, types, config = getDefaultConfig(), typeHierarchy,
|
|
|
11697
11697
|
const sourceLines = code !== undefined ? code.split(`
|
|
11698
11698
|
`) : undefined;
|
|
11699
11699
|
const sources = findSources(calls, types, config.sources, sourceLines, language);
|
|
11700
|
-
|
|
11700
|
+
let sinkPatterns = expandPromisifyAliases(config.sinks, sourceLines, language);
|
|
11701
|
+
sinkPatterns = expandIndirectEvalAliases(sinkPatterns, sourceLines, language);
|
|
11701
11702
|
const sinks = findSinks(calls, sinkPatterns, typeHierarchy, language, sourceLines);
|
|
11702
11703
|
const sanitizers = findSanitizers(calls, types, config.sanitizers, sourceLines);
|
|
11703
11704
|
return { sources, sinks, sanitizers };
|
|
@@ -11752,6 +11753,53 @@ function expandPromisifyAliases(patterns, sourceLines, language) {
|
|
|
11752
11753
|
}
|
|
11753
11754
|
return aliasPatterns.length === 0 ? patterns : patterns.concat(aliasPatterns);
|
|
11754
11755
|
}
|
|
11756
|
+
function expandIndirectEvalAliases(patterns, sourceLines, language) {
|
|
11757
|
+
if (!sourceLines || sourceLines.length === 0)
|
|
11758
|
+
return patterns;
|
|
11759
|
+
if (language !== "javascript" && language !== "typescript")
|
|
11760
|
+
return patterns;
|
|
11761
|
+
const INDIRECT_EVAL_RE = /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(eval|Function)\b(?!\s*\()/;
|
|
11762
|
+
const innerToPattern = new Map;
|
|
11763
|
+
for (const p of patterns) {
|
|
11764
|
+
if (p.languages && !p.languages.includes(language))
|
|
11765
|
+
continue;
|
|
11766
|
+
if (p.class !== undefined)
|
|
11767
|
+
continue;
|
|
11768
|
+
if (p.method !== "eval" && p.method !== "Function")
|
|
11769
|
+
continue;
|
|
11770
|
+
if (!innerToPattern.has(p.method))
|
|
11771
|
+
innerToPattern.set(p.method, p);
|
|
11772
|
+
}
|
|
11773
|
+
if (innerToPattern.size === 0)
|
|
11774
|
+
return patterns;
|
|
11775
|
+
const aliasPatterns = [];
|
|
11776
|
+
const seenAliases = new Set;
|
|
11777
|
+
for (const line of sourceLines) {
|
|
11778
|
+
const m = INDIRECT_EVAL_RE.exec(line);
|
|
11779
|
+
if (!m)
|
|
11780
|
+
continue;
|
|
11781
|
+
const aliasName = m[1];
|
|
11782
|
+
const innerName = m[2];
|
|
11783
|
+
if (!aliasName || !innerName)
|
|
11784
|
+
continue;
|
|
11785
|
+
if (seenAliases.has(aliasName))
|
|
11786
|
+
continue;
|
|
11787
|
+
const template = innerToPattern.get(innerName);
|
|
11788
|
+
if (!template)
|
|
11789
|
+
continue;
|
|
11790
|
+
seenAliases.add(aliasName);
|
|
11791
|
+
aliasPatterns.push({
|
|
11792
|
+
method: aliasName,
|
|
11793
|
+
type: template.type,
|
|
11794
|
+
cwe: template.cwe,
|
|
11795
|
+
severity: template.severity,
|
|
11796
|
+
arg_positions: template.arg_positions,
|
|
11797
|
+
languages: [language],
|
|
11798
|
+
note: `indirect ${innerName} alias — cognium-dev #188`
|
|
11799
|
+
});
|
|
11800
|
+
}
|
|
11801
|
+
return aliasPatterns.length === 0 ? patterns : patterns.concat(aliasPatterns);
|
|
11802
|
+
}
|
|
11755
11803
|
function attachSourceLineCode(sources, sinks, code) {
|
|
11756
11804
|
const lines = code.split(`
|
|
11757
11805
|
`);
|
|
@@ -13356,7 +13404,7 @@ function canSourceReachSink(sourceType, sinkType) {
|
|
|
13356
13404
|
http_cookie: ["sql_injection", "xss", "mybatis_mapper_call", "code_injection", "crlf"],
|
|
13357
13405
|
http_path: ["path_traversal", "sql_injection", "ssrf", "mybatis_mapper_call"],
|
|
13358
13406
|
http_query: ["sql_injection", "command_injection", "xss", "ssrf", "mybatis_mapper_call", "code_injection", "crlf", "mass_assignment"],
|
|
13359
|
-
io_input: ["command_injection", "path_traversal", "deserialization", "xxe", "code_injection", "xss"],
|
|
13407
|
+
io_input: ["command_injection", "path_traversal", "deserialization", "xxe", "code_injection", "xss", "ssrf"],
|
|
13360
13408
|
env_input: ["command_injection", "path_traversal"],
|
|
13361
13409
|
db_input: ["xss", "sql_injection"],
|
|
13362
13410
|
file_input: ["deserialization", "xxe", "path_traversal", "command_injection", "code_injection"],
|
|
@@ -20494,14 +20542,14 @@ class BashPlugin extends BaseLanguagePlugin {
|
|
|
20494
20542
|
type: "ssrf",
|
|
20495
20543
|
cwe: "CWE-918",
|
|
20496
20544
|
severity: "high",
|
|
20497
|
-
argPositions: [
|
|
20545
|
+
argPositions: []
|
|
20498
20546
|
},
|
|
20499
20547
|
{
|
|
20500
20548
|
method: "wget",
|
|
20501
20549
|
type: "ssrf",
|
|
20502
20550
|
cwe: "CWE-918",
|
|
20503
20551
|
severity: "high",
|
|
20504
|
-
argPositions: [
|
|
20552
|
+
argPositions: []
|
|
20505
20553
|
},
|
|
20506
20554
|
{
|
|
20507
20555
|
method: "source",
|
|
@@ -23091,7 +23139,14 @@ var BASH_UNTRUSTED_ENV_PATTERNS = [
|
|
|
23091
23139
|
/^CONTENT_LENGTH$/i,
|
|
23092
23140
|
/^PATH_INFO$/i,
|
|
23093
23141
|
/^SCRIPT_NAME$/i,
|
|
23094
|
-
/^SERVER_NAME$/i
|
|
23142
|
+
/^SERVER_NAME$/i,
|
|
23143
|
+
/^RPC_/i,
|
|
23144
|
+
/^XMLRPC/i,
|
|
23145
|
+
/^JSONRPC/i,
|
|
23146
|
+
/^CMD_/i,
|
|
23147
|
+
/^EXEC_/i,
|
|
23148
|
+
/^EVAL_/i,
|
|
23149
|
+
/^SHELL_/i
|
|
23095
23150
|
];
|
|
23096
23151
|
var BASH_NETWORK_COMMANDS = new Set(["curl", "wget", "nc", "ncat"]);
|
|
23097
23152
|
var BASH_FILE_COMMANDS = new Set(["cat", "head", "tail", "less", "more", "awk", "sed", "cut", "grep"]);
|
|
@@ -36773,7 +36828,7 @@ var colors = {
|
|
|
36773
36828
|
};
|
|
36774
36829
|
|
|
36775
36830
|
// src/version.ts
|
|
36776
|
-
var version = "3.
|
|
36831
|
+
var version = "3.115.0";
|
|
36777
36832
|
|
|
36778
36833
|
// src/formatters.ts
|
|
36779
36834
|
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.115.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.115.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/node": "^25.5.0",
|