@contrast/protect 1.76.0 → 1.77.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.
@@ -4,9 +4,9 @@
4
4
  * License: Commercial
5
5
 
6
6
  * NOTICE: This Software and the patented inventions embodied within may only be
7
- * used as part of Contrast Security's commercial offerings. Even though it is
7
+ * used as part of Contrast Securitys commercial offerings. Even though it is
8
8
  * made available through public repositories, use of this Software is subject to
9
- * the applicable End User License Agreement found at
9
+ * the applicable End User Licensing Agreement found at
10
10
  * https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
11
11
  * between Contrast Security and the End User. The Software may not be reverse
12
12
  * engineered, modified, repackaged, sold, redistributed or otherwise used in a
@@ -15,6 +15,7 @@
15
15
 
16
16
  'use strict';
17
17
 
18
+ const { traverseValues } = require('@contrast/common');
18
19
  const { patchType } = require('../constants');
19
20
 
20
21
  module.exports = function(core) {
@@ -38,8 +39,24 @@ module.exports = function(core) {
38
39
  if (!sourceContext || sourceContext.parsedCdsKeyParams) return;
39
40
  sourceContext.parsedCdsKeyParams = true;
40
41
 
41
- if (req?.params?.length) {
42
- inputAnalysis.handleUrlParams(sourceContext, req.params);
42
+ const params = req?.params?.length ? req.params : [];
43
+ const queries = Array.isArray(req?.query)
44
+ ? req.query
45
+ : req?.query ? [req.query] : [];
46
+
47
+ for (const cqn of queries) {
48
+ if (!cqn || typeof cqn !== 'object') continue;
49
+
50
+ traverseValues(cqn, (path, _type, value, parent) => {
51
+ const lastKey = path[path.length - 1];
52
+ if (!Array.isArray(parent) && (lastKey === 'val' || lastKey === 'ref')) {
53
+ params.push(value);
54
+ }
55
+ });
56
+ }
57
+
58
+ if (params.length) {
59
+ inputAnalysis.handleUrlParams(sourceContext, params);
43
60
  }
44
61
  }
45
62
  });
@@ -47,9 +64,9 @@ module.exports = function(core) {
47
64
  );
48
65
  }
49
66
 
50
- const sapInstrumentation = inputAnalysis.sapInstrumentation = {
51
- install
67
+ const sapInstrumentation = inputAnalysis.sapInstrumentation = {
68
+ install
52
69
  };
53
-
70
+
54
71
  return sapInstrumentation;
55
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/protect",
3
- "version": "1.76.0",
3
+ "version": "1.77.0",
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)",
@@ -31,7 +31,7 @@
31
31
  "@contrast/patcher": "1.35.2",
32
32
  "@contrast/rewriter": "1.40.3",
33
33
  "@contrast/scopes": "1.33.2",
34
- "@contrast/stack-trace-factory": "1.3.3",
34
+ "@contrast/stack-trace-factory": "1.4.0",
35
35
  "async-hook-domain": "4.0.1",
36
36
  "ipaddr.js": "2.0.1",
37
37
  "on-finished": "2.4.1",