@contrast/protect 1.6.0 → 1.6.2
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.
|
@@ -40,7 +40,6 @@ module.exports = function (core) {
|
|
|
40
40
|
|
|
41
41
|
if (isSecurityException && sourceContext && err.output.statusCode !== 403) {
|
|
42
42
|
const [mode, ruleId] = sourceContext.findings.securityException;
|
|
43
|
-
sourceContext.block('block', 'cmd-injection');
|
|
44
43
|
|
|
45
44
|
err.output.statusCode = 403;
|
|
46
45
|
err.reformat();
|
|
@@ -71,9 +71,9 @@ module.exports = (core) => {
|
|
|
71
71
|
inputAnalysis.handleUrlParams(sourceContext, req.params);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
if (req.
|
|
75
|
-
sourceContext.parsedCookies = req.
|
|
76
|
-
inputAnalysis.handleCookies(sourceContext, req.
|
|
74
|
+
if (req.state && Object.keys(req.state).length) {
|
|
75
|
+
sourceContext.parsedCookies = req.state;
|
|
76
|
+
inputAnalysis.handleCookies(sourceContext, req.state);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
if (req.payload && Object.keys(req.payload).length) {
|
|
@@ -43,9 +43,13 @@ function buildVPEvaluators(virtualPatches, evaluatorsArray) {
|
|
|
43
43
|
let result;
|
|
44
44
|
for (const { evaluation, name, value } of headers) {
|
|
45
45
|
const evalCheck = buildEvaluationCheck(evaluation);
|
|
46
|
-
const
|
|
46
|
+
const headersArray = Array.isArray(reqHeaders) ? reqHeaders : Object.entries(reqHeaders).reduce((acc, entry) => {
|
|
47
|
+
acc.push(...entry);
|
|
48
|
+
return acc;
|
|
49
|
+
}, []);
|
|
50
|
+
const keyIndex = headersArray.indexOf(name.toLowerCase());
|
|
47
51
|
|
|
48
|
-
result = keyIndex !== -1 && evalCheck(
|
|
52
|
+
result = keyIndex !== -1 && evalCheck(headersArray[keyIndex + 1], value);
|
|
49
53
|
if (!result) break;
|
|
50
54
|
}
|
|
51
55
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/protect",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Contrast service providing framework-agnostic Protect support",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"@babel/types": "^7.16.8",
|
|
22
22
|
"@contrast/agent-lib": "^5.1.0",
|
|
23
23
|
"@contrast/common": "1.1.2",
|
|
24
|
-
"@contrast/core": "1.5.
|
|
25
|
-
"@contrast/esm-hooks": "1.1.
|
|
26
|
-
"@contrast/scopes": "1.1.
|
|
24
|
+
"@contrast/core": "1.5.2",
|
|
25
|
+
"@contrast/esm-hooks": "1.1.8",
|
|
26
|
+
"@contrast/scopes": "1.1.2",
|
|
27
27
|
"builtin-modules": "^3.2.0",
|
|
28
28
|
"ipaddr.js": "^2.0.1",
|
|
29
29
|
"semver": "^7.3.7"
|