@contrast/agent 4.25.3 → 4.25.5
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.
|
@@ -20,7 +20,7 @@ const tracker = require('../../tracker');
|
|
|
20
20
|
const stackFactory = require('../../core/stacktrace').singleton;
|
|
21
21
|
const { PROXY_TARGET } = require('../../../lib/constants');
|
|
22
22
|
const TagRange = require('../models/tag-range');
|
|
23
|
-
const
|
|
23
|
+
const distringuish = require('@contrast/distringuish');
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Holds information about the call context of a function
|
|
@@ -126,7 +126,10 @@ function getDisplayRange(arg, orgArg = arg, iteration = 0) {
|
|
|
126
126
|
*/
|
|
127
127
|
function valueString(value) {
|
|
128
128
|
if (_.isString(value)) {
|
|
129
|
-
|
|
129
|
+
if (distringuish.isExternal(value.valueOf())) {
|
|
130
|
+
return distringuish.internalize(value.valueOf());
|
|
131
|
+
}
|
|
132
|
+
return value.valueOf();
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
if (_.isNumber(value)) {
|
package/lib/core/stacktrace.js
CHANGED
|
@@ -146,8 +146,11 @@ class Factory {
|
|
|
146
146
|
|
|
147
147
|
if (callsite.isEval()) {
|
|
148
148
|
evalOrigin = Factory.formatFileName(callsite.getEvalOrigin());
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
|
|
150
|
+
const match = evalOrigin.match(EVAL_ORIGIN_REGEX);
|
|
151
|
+
if (match) {
|
|
152
|
+
[, file, lineNumber, columnNumber] = match;
|
|
153
|
+
}
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
file = file || callsite.getFileName();
|
package/lib/tracker.js
CHANGED
|
@@ -132,6 +132,14 @@ class Tracker {
|
|
|
132
132
|
*/
|
|
133
133
|
untrack(str) {
|
|
134
134
|
if (typeof str === 'string') {
|
|
135
|
+
const props = distringuish.getProperties(str);
|
|
136
|
+
if (props) {
|
|
137
|
+
Object.assign(props, {
|
|
138
|
+
event: null,
|
|
139
|
+
tagRanges: [],
|
|
140
|
+
tracked: false,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
135
143
|
return distringuish.internalize(str);
|
|
136
144
|
}
|
|
137
145
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/agent",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.5",
|
|
4
4
|
"description": "Node.js security instrumentation by Contrast Security",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"security",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@babel/traverse": "^7.12.1",
|
|
78
78
|
"@babel/types": "^7.12.1",
|
|
79
79
|
"@contrast/agent-lib": "^4.3.0",
|
|
80
|
-
"@contrast/distringuish": "^4.
|
|
80
|
+
"@contrast/distringuish": "^4.2.1",
|
|
81
81
|
"@contrast/flat": "^4.1.1",
|
|
82
82
|
"@contrast/fn-inspect": "^3.1.0",
|
|
83
83
|
"@contrast/protobuf-api": "^3.2.5",
|