@contrast/assess 1.26.0 → 1.27.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.
|
@@ -25,7 +25,7 @@ module.exports = function(core) {
|
|
|
25
25
|
scopes: { sources, instrumentation },
|
|
26
26
|
patcher,
|
|
27
27
|
assess: {
|
|
28
|
-
eventFactory
|
|
28
|
+
eventFactory,
|
|
29
29
|
dataflow: { tracker }
|
|
30
30
|
}
|
|
31
31
|
} = core;
|
|
@@ -53,6 +53,40 @@ module.exports = function(core) {
|
|
|
53
53
|
const objInfo = tracker.getData(obj);
|
|
54
54
|
if (!objInfo || obj === result[0]) return;
|
|
55
55
|
|
|
56
|
+
const args = origArgs.map((arg) => {
|
|
57
|
+
const argInfo = tracker.getData(arg);
|
|
58
|
+
return {
|
|
59
|
+
value: argInfo ? argInfo.value : inspect(arg),
|
|
60
|
+
tracked: !!argInfo
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const event = eventFactory.createPropagationEvent({
|
|
65
|
+
name,
|
|
66
|
+
moduleName: 'String',
|
|
67
|
+
methodName: 'prototype.split',
|
|
68
|
+
context: `'${objInfo.value}'.split(${join(args.map(a => a.value), ', ')})`,
|
|
69
|
+
history: [objInfo],
|
|
70
|
+
object: {
|
|
71
|
+
value: obj,
|
|
72
|
+
tracked: true,
|
|
73
|
+
},
|
|
74
|
+
args,
|
|
75
|
+
tags: {},
|
|
76
|
+
result: {
|
|
77
|
+
value: join(result),
|
|
78
|
+
tracked: false
|
|
79
|
+
},
|
|
80
|
+
stacktraceOpts: {
|
|
81
|
+
constructorOpt: hooked,
|
|
82
|
+
prependFrames: [orig]
|
|
83
|
+
},
|
|
84
|
+
source: 'O',
|
|
85
|
+
target: 'R'
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (!event) return;
|
|
89
|
+
|
|
56
90
|
let idx = 0;
|
|
57
91
|
for (let i = 0; i < result.length; i++) {
|
|
58
92
|
const res = result[i];
|
|
@@ -64,40 +98,9 @@ module.exports = function(core) {
|
|
|
64
98
|
const tags = createSubsetTags(objInfo.tags, start, res.length);
|
|
65
99
|
if (!tags) continue;
|
|
66
100
|
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
value: argInfo ? argInfo.value : inspect(arg),
|
|
71
|
-
tracked: !!argInfo
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
const event = createPropagationEvent({
|
|
75
|
-
name,
|
|
76
|
-
moduleName: 'String',
|
|
77
|
-
methodName: 'prototype.split',
|
|
78
|
-
context: `'${objInfo.value}'.split(${join(args.map(a => a.value), ', ')})`,
|
|
79
|
-
history: [objInfo],
|
|
80
|
-
object: {
|
|
81
|
-
value: obj,
|
|
82
|
-
tracked: true,
|
|
83
|
-
},
|
|
84
|
-
args,
|
|
85
|
-
tags,
|
|
86
|
-
result: {
|
|
87
|
-
value: join(result),
|
|
88
|
-
tracked: false
|
|
89
|
-
},
|
|
90
|
-
stacktraceOpts: {
|
|
91
|
-
constructorOpt: hooked,
|
|
92
|
-
prependFrames: [orig]
|
|
93
|
-
},
|
|
94
|
-
source: 'O',
|
|
95
|
-
target: 'R'
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
if (!event) continue;
|
|
99
|
-
|
|
100
|
-
const { extern } = tracker.track(res, event);
|
|
101
|
+
const metadata = { ...event, tags };
|
|
102
|
+
eventFactory.createdEvents.add(metadata);
|
|
103
|
+
const { extern } = tracker.track(res, metadata);
|
|
101
104
|
|
|
102
105
|
if (extern) {
|
|
103
106
|
data.result[i] = extern;
|
|
@@ -57,7 +57,7 @@ module.exports = function(core) {
|
|
|
57
57
|
for (i; i < args.length; i++) {
|
|
58
58
|
let arg = args[i];
|
|
59
59
|
const formatChar = formatChars[i - 1];
|
|
60
|
-
if (typeof arg === 'object') {
|
|
60
|
+
if (formatChar && typeof arg === 'object') {
|
|
61
61
|
|
|
62
62
|
if (formatChar === 'j') {
|
|
63
63
|
arg = JSON.stringify(arg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/assess",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"description": "Contrast service providing framework-agnostic Assess support",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"test": "../scripts/test.sh"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@contrast/common": "1.
|
|
20
|
+
"@contrast/common": "1.20.0",
|
|
21
21
|
"@contrast/distringuish": "^4.4.0",
|
|
22
22
|
"@contrast/scopes": "1.4.0"
|
|
23
23
|
}
|