@contrast/assess 1.47.0 → 1.48.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.
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
'use strict';
|
|
17
17
|
|
|
18
|
+
const { isString } = require('@contrast/common');
|
|
18
19
|
const { createAppendTags } = require('../../../tag-utils');
|
|
19
20
|
|
|
20
21
|
module.exports = function(core) {
|
|
@@ -40,7 +41,11 @@ module.exports = function(core) {
|
|
|
40
41
|
// first get result, then following logic acts as post-hook in patcher speak
|
|
41
42
|
const result = add(...args);
|
|
42
43
|
|
|
43
|
-
if (
|
|
44
|
+
if (
|
|
45
|
+
!result ||
|
|
46
|
+
!isString(result) ||
|
|
47
|
+
!getPropagatorContext()
|
|
48
|
+
) return result;
|
|
44
49
|
|
|
45
50
|
const rInfo = tracker.getData(result);
|
|
46
51
|
if (rInfo) {
|
|
@@ -26,8 +26,8 @@ module.exports = function (core) {
|
|
|
26
26
|
|
|
27
27
|
return core.assess.dataflow.propagation.fastifySend = {
|
|
28
28
|
install() {
|
|
29
|
-
depHooks.resolve({ name: '@fastify/send', version: '<
|
|
30
|
-
patcher.patch(
|
|
29
|
+
depHooks.resolve({ name: '@fastify/send', version: '<3', file: 'lib/SendStream.js' }, (SendStream) => {
|
|
30
|
+
patcher.patch(SendStream.prototype, 'sendFile', {
|
|
31
31
|
name: '@fastify/send/lib/SendStream.js',
|
|
32
32
|
patchType,
|
|
33
33
|
usePerf: 'sync',
|
|
@@ -41,6 +41,22 @@ module.exports = function (core) {
|
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
|
+
|
|
45
|
+
depHooks.resolve({ name: '@fastify/send', version: '>=3 <5', file: 'lib/send.js' }, (send) => {
|
|
46
|
+
patcher.patch(send, 'send', {
|
|
47
|
+
name: '@fastify/send/lib/send.js',
|
|
48
|
+
patchType,
|
|
49
|
+
usePerf: 'sync',
|
|
50
|
+
pre(data) {
|
|
51
|
+
const { args } = data;
|
|
52
|
+
|
|
53
|
+
if (!getPropagatorContext()) return;
|
|
54
|
+
|
|
55
|
+
const untrackedPath = StringPrototypeSlice.call(` ${args[1]}`, 1);
|
|
56
|
+
args[1] = untrackedPath;
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
});
|
|
44
60
|
}
|
|
45
61
|
};
|
|
46
62
|
};
|
|
@@ -31,7 +31,7 @@ module.exports = function (core) {
|
|
|
31
31
|
|
|
32
32
|
const source = sources.hapiInstrumentation.hapi = {
|
|
33
33
|
install() {
|
|
34
|
-
|
|
34
|
+
depHooks.resolve({ name: '@hapi/hapi', version: '>=18 <22' }, (hapi) => {
|
|
35
35
|
['server', 'Server'].forEach((server) => {
|
|
36
36
|
patcher.patch(hapi, server, {
|
|
37
37
|
name: `hapi.${server}`,
|
|
@@ -40,7 +40,7 @@ module.exports = function (core) {
|
|
|
40
40
|
|
|
41
41
|
server.ext('onRequest', (req, h) => {
|
|
42
42
|
const sourceContext = getSourceContext();
|
|
43
|
-
if (!sourceContext) return;
|
|
43
|
+
if (!sourceContext) return h.continue;
|
|
44
44
|
|
|
45
45
|
[
|
|
46
46
|
{ key: 'query', inputType: InputType.QUERYSTRING, trackedFlag: 'parsedQuery' },
|
|
@@ -70,9 +70,10 @@ module.exports = function (core) {
|
|
|
70
70
|
});
|
|
71
71
|
return h.continue;
|
|
72
72
|
});
|
|
73
|
+
|
|
73
74
|
server.ext('onPostAuth', (req, h) => {
|
|
74
75
|
const sourceContext = core.scopes.sources.getStore()?.assess;
|
|
75
|
-
if (!sourceContext) return;
|
|
76
|
+
if (!sourceContext) return h.continue;
|
|
76
77
|
|
|
77
78
|
[
|
|
78
79
|
{ key: 'state', inputType: InputType.COOKIE_VALUE, trackedFlag: 'parsedCookies' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/assess",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.48.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)",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"test": "../scripts/test.sh"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@contrast/common": "1.
|
|
24
|
-
"@contrast/config": "1.
|
|
25
|
-
"@contrast/core": "1.
|
|
26
|
-
"@contrast/dep-hooks": "1.
|
|
23
|
+
"@contrast/common": "1.30.0",
|
|
24
|
+
"@contrast/config": "1.41.0",
|
|
25
|
+
"@contrast/core": "1.46.0",
|
|
26
|
+
"@contrast/dep-hooks": "1.15.0",
|
|
27
27
|
"@contrast/distringuish": "^5.1.0",
|
|
28
|
-
"@contrast/instrumentation": "1.
|
|
29
|
-
"@contrast/logger": "1.
|
|
30
|
-
"@contrast/patcher": "1.
|
|
31
|
-
"@contrast/rewriter": "1.
|
|
32
|
-
"@contrast/route-coverage": "1.
|
|
33
|
-
"@contrast/scopes": "1.
|
|
28
|
+
"@contrast/instrumentation": "1.25.0",
|
|
29
|
+
"@contrast/logger": "1.19.0",
|
|
30
|
+
"@contrast/patcher": "1.18.0",
|
|
31
|
+
"@contrast/rewriter": "1.22.0",
|
|
32
|
+
"@contrast/route-coverage": "1.36.0",
|
|
33
|
+
"@contrast/scopes": "1.16.0",
|
|
34
34
|
"semver": "^7.6.0"
|
|
35
35
|
}
|
|
36
36
|
}
|