cognium-dev 3.139.0 → 3.141.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 +86 -8
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -5678,8 +5678,86 @@ function resolveReceiverType(receiver, context) {
|
|
|
5678
5678
|
return resolveFqn(simple, context);
|
|
5679
5679
|
}
|
|
5680
5680
|
}
|
|
5681
|
+
const chain = splitChainedReceiver(receiver);
|
|
5682
|
+
if (chain) {
|
|
5683
|
+
const prefixType = resolveReceiverType(chain.prefix, context);
|
|
5684
|
+
if (prefixType.simpleName) {
|
|
5685
|
+
const returnType = JAVA_CHAINED_FACTORY_RETURN_TYPES[prefixType.simpleName]?.[chain.methodName];
|
|
5686
|
+
if (returnType)
|
|
5687
|
+
return resolveFqn(returnType, context);
|
|
5688
|
+
}
|
|
5689
|
+
}
|
|
5681
5690
|
return { simpleName: null, fqn: null };
|
|
5682
5691
|
}
|
|
5692
|
+
function splitChainedReceiver(receiver) {
|
|
5693
|
+
if (!receiver.endsWith(")"))
|
|
5694
|
+
return null;
|
|
5695
|
+
let depth = 0;
|
|
5696
|
+
let openIdx = -1;
|
|
5697
|
+
for (let i2 = receiver.length - 1;i2 >= 0; i2--) {
|
|
5698
|
+
const c = receiver[i2];
|
|
5699
|
+
if (c === ")")
|
|
5700
|
+
depth++;
|
|
5701
|
+
else if (c === "(") {
|
|
5702
|
+
depth--;
|
|
5703
|
+
if (depth === 0) {
|
|
5704
|
+
openIdx = i2;
|
|
5705
|
+
break;
|
|
5706
|
+
}
|
|
5707
|
+
}
|
|
5708
|
+
}
|
|
5709
|
+
if (openIdx <= 0)
|
|
5710
|
+
return null;
|
|
5711
|
+
const beforeParen = receiver.substring(0, openIdx);
|
|
5712
|
+
const dotIdx = beforeParen.lastIndexOf(".");
|
|
5713
|
+
if (dotIdx <= 0)
|
|
5714
|
+
return null;
|
|
5715
|
+
const methodName = beforeParen.substring(dotIdx + 1).trim();
|
|
5716
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(methodName))
|
|
5717
|
+
return null;
|
|
5718
|
+
const prefix = beforeParen.substring(0, dotIdx).trim();
|
|
5719
|
+
if (!prefix)
|
|
5720
|
+
return null;
|
|
5721
|
+
return { prefix, methodName };
|
|
5722
|
+
}
|
|
5723
|
+
var JAVA_CHAINED_FACTORY_RETURN_TYPES = {
|
|
5724
|
+
HttpServletRequest: {
|
|
5725
|
+
getSession: "HttpSession",
|
|
5726
|
+
getServletContext: "ServletContext",
|
|
5727
|
+
getRequestDispatcher: "RequestDispatcher"
|
|
5728
|
+
},
|
|
5729
|
+
HttpSession: {
|
|
5730
|
+
getServletContext: "ServletContext"
|
|
5731
|
+
},
|
|
5732
|
+
ServletContext: {
|
|
5733
|
+
getRequestDispatcher: "RequestDispatcher"
|
|
5734
|
+
},
|
|
5735
|
+
DocumentBuilderFactory: {
|
|
5736
|
+
newInstance: "DocumentBuilderFactory",
|
|
5737
|
+
newDocumentBuilder: "DocumentBuilder"
|
|
5738
|
+
},
|
|
5739
|
+
SAXParserFactory: {
|
|
5740
|
+
newInstance: "SAXParserFactory",
|
|
5741
|
+
newSAXParser: "SAXParser"
|
|
5742
|
+
},
|
|
5743
|
+
SAXParser: {
|
|
5744
|
+
getXMLReader: "XMLReader"
|
|
5745
|
+
},
|
|
5746
|
+
XPathFactory: {
|
|
5747
|
+
newInstance: "XPathFactory",
|
|
5748
|
+
newXPath: "XPath"
|
|
5749
|
+
},
|
|
5750
|
+
TransformerFactory: {
|
|
5751
|
+
newInstance: "TransformerFactory",
|
|
5752
|
+
newTransformer: "Transformer"
|
|
5753
|
+
},
|
|
5754
|
+
XMLInputFactory: {
|
|
5755
|
+
newInstance: "XMLInputFactory",
|
|
5756
|
+
newFactory: "XMLInputFactory",
|
|
5757
|
+
createXMLStreamReader: "XMLStreamReader",
|
|
5758
|
+
createXMLEventReader: "XMLEventReader"
|
|
5759
|
+
}
|
|
5760
|
+
};
|
|
5683
5761
|
function resolveFqn(simpleName, context) {
|
|
5684
5762
|
if (!simpleName)
|
|
5685
5763
|
return { simpleName: null, fqn: null };
|
|
@@ -13400,19 +13478,19 @@ function formatCallCode(call) {
|
|
|
13400
13478
|
// ../circle-ir/dist/analysis/findings.js
|
|
13401
13479
|
function canSourceReachSink(sourceType, sinkType) {
|
|
13402
13480
|
const sourceToSinkMapping = {
|
|
13403
|
-
http_param: ["sql_injection", "command_injection", "path_traversal", "xss", "xpath_injection", "ldap_injection", "ssrf", "mybatis_mapper_call", "code_injection", "crlf", "mass_assignment", "open_redirect"],
|
|
13404
|
-
http_body: ["sql_injection", "command_injection", "deserialization", "xxe", "xss", "code_injection", "mybatis_mapper_call", "crlf", "mass_assignment", "open_redirect"],
|
|
13405
|
-
http_header: ["sql_injection", "xss", "ssrf", "mybatis_mapper_call", "code_injection", "crlf", "open_redirect"],
|
|
13406
|
-
http_cookie: ["sql_injection", "xss", "mybatis_mapper_call", "code_injection", "crlf", "open_redirect"],
|
|
13407
|
-
http_path: ["path_traversal", "sql_injection", "ssrf", "mybatis_mapper_call", "open_redirect"],
|
|
13408
|
-
http_query: ["sql_injection", "command_injection", "xss", "ssrf", "mybatis_mapper_call", "code_injection", "crlf", "mass_assignment", "open_redirect"],
|
|
13481
|
+
http_param: ["sql_injection", "command_injection", "path_traversal", "xss", "xpath_injection", "ldap_injection", "ssrf", "mybatis_mapper_call", "code_injection", "crlf", "mass_assignment", "open_redirect", "trust_boundary"],
|
|
13482
|
+
http_body: ["sql_injection", "command_injection", "deserialization", "xxe", "xss", "code_injection", "mybatis_mapper_call", "crlf", "mass_assignment", "open_redirect", "trust_boundary"],
|
|
13483
|
+
http_header: ["sql_injection", "xss", "ssrf", "mybatis_mapper_call", "code_injection", "crlf", "open_redirect", "trust_boundary"],
|
|
13484
|
+
http_cookie: ["sql_injection", "xss", "mybatis_mapper_call", "code_injection", "crlf", "open_redirect", "trust_boundary"],
|
|
13485
|
+
http_path: ["path_traversal", "sql_injection", "ssrf", "mybatis_mapper_call", "open_redirect", "trust_boundary"],
|
|
13486
|
+
http_query: ["sql_injection", "command_injection", "xss", "ssrf", "mybatis_mapper_call", "code_injection", "crlf", "mass_assignment", "open_redirect", "trust_boundary"],
|
|
13409
13487
|
io_input: ["command_injection", "path_traversal", "deserialization", "xxe", "code_injection", "xss", "ssrf"],
|
|
13410
13488
|
env_input: ["command_injection", "path_traversal"],
|
|
13411
13489
|
db_input: ["xss", "sql_injection"],
|
|
13412
13490
|
file_input: ["deserialization", "xxe", "path_traversal", "command_injection", "code_injection"],
|
|
13413
13491
|
network_input: ["sql_injection", "command_injection", "xss", "ssrf"],
|
|
13414
13492
|
config_param: ["sql_injection", "command_injection", "path_traversal", "xss", "ssrf"],
|
|
13415
|
-
interprocedural_param: ["sql_injection", "command_injection", "path_traversal", "xss", "xpath_injection", "ldap_injection", "ssrf", "code_injection", "mybatis_mapper_call", "crlf", "mass_assignment", "open_redirect"],
|
|
13493
|
+
interprocedural_param: ["sql_injection", "command_injection", "path_traversal", "xss", "xpath_injection", "ldap_injection", "ssrf", "code_injection", "mybatis_mapper_call", "crlf", "mass_assignment", "open_redirect", "trust_boundary"],
|
|
13416
13494
|
plugin_param: ["sql_injection", "command_injection", "path_traversal", "xss", "code_injection"]
|
|
13417
13495
|
};
|
|
13418
13496
|
const validSinks = sourceToSinkMapping[sourceType];
|
|
@@ -41641,7 +41719,7 @@ var colors = {
|
|
|
41641
41719
|
};
|
|
41642
41720
|
|
|
41643
41721
|
// src/version.ts
|
|
41644
|
-
var version = "3.
|
|
41722
|
+
var version = "3.141.0";
|
|
41645
41723
|
|
|
41646
41724
|
// src/formatters.ts
|
|
41647
41725
|
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.141.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.141.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/node": "^25.5.0",
|