@contrast/agent-bundle 5.45.1 → 5.46.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.
Files changed (56) hide show
  1. package/node_modules/@contrast/agent/package.json +10 -10
  2. package/node_modules/@contrast/agentify/package.json +14 -14
  3. package/node_modules/@contrast/architecture-components/package.json +4 -4
  4. package/node_modules/@contrast/assess/lib/dataflow/sources/handler.js +21 -24
  5. package/node_modules/@contrast/assess/lib/get-source-context.js +10 -21
  6. package/node_modules/@contrast/assess/lib/index.js +1 -1
  7. package/node_modules/@contrast/assess/lib/make-source-context.js +5 -10
  8. package/node_modules/@contrast/assess/lib/policy.js +400 -0
  9. package/node_modules/@contrast/assess/lib/response-scanning/handlers/index.js +10 -14
  10. package/node_modules/@contrast/assess/lib/session-configuration/handlers.js +1 -1
  11. package/node_modules/@contrast/assess/package.json +11 -11
  12. package/node_modules/@contrast/config/lib/options.js +8 -0
  13. package/node_modules/@contrast/config/package.json +2 -2
  14. package/node_modules/@contrast/core/package.json +4 -4
  15. package/node_modules/@contrast/deadzones/package.json +4 -4
  16. package/node_modules/@contrast/dep-hooks/package.json +3 -3
  17. package/node_modules/@contrast/esm-hooks/package.json +5 -5
  18. package/node_modules/@contrast/instrumentation/package.json +4 -4
  19. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +127 -127
  20. package/node_modules/@contrast/library-analysis/package.json +3 -3
  21. package/node_modules/@contrast/logger/package.json +2 -2
  22. package/node_modules/@contrast/metrics/package.json +5 -5
  23. package/node_modules/@contrast/patcher/package.json +2 -2
  24. package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +1 -12
  25. package/node_modules/@contrast/protect/package.json +10 -10
  26. package/node_modules/@contrast/reporter/package.json +5 -5
  27. package/node_modules/@contrast/rewriter/package.json +4 -4
  28. package/node_modules/@contrast/route-coverage/package.json +7 -7
  29. package/node_modules/@contrast/scopes/package.json +5 -5
  30. package/node_modules/@contrast/sec-obs/package.json +8 -8
  31. package/node_modules/@contrast/sources/package.json +2 -2
  32. package/node_modules/@contrast/telemetry/package.json +4 -4
  33. package/node_modules/@types/node/README.md +1 -1
  34. package/node_modules/@types/node/assert/strict.d.ts +105 -2
  35. package/node_modules/@types/node/assert.d.ts +119 -95
  36. package/node_modules/@types/node/crypto.d.ts +117 -7
  37. package/node_modules/@types/node/events.d.ts +79 -33
  38. package/node_modules/@types/node/fs.d.ts +224 -0
  39. package/node_modules/@types/node/http.d.ts +28 -3
  40. package/node_modules/@types/node/package.json +3 -3
  41. package/node_modules/@types/node/test.d.ts +2 -23
  42. package/node_modules/@types/node/url.d.ts +6 -1
  43. package/node_modules/@types/node/util.d.ts +5 -0
  44. package/node_modules/@types/node/web-globals/events.d.ts +3 -0
  45. package/node_modules/@types/node/worker_threads.d.ts +33 -47
  46. package/node_modules/@types/node/zlib.d.ts +6 -0
  47. package/node_modules/undici-types/agent.d.ts +0 -4
  48. package/node_modules/undici-types/client.d.ts +0 -2
  49. package/node_modules/undici-types/dispatcher.d.ts +0 -6
  50. package/node_modules/undici-types/h2c-client.d.ts +0 -2
  51. package/node_modules/undici-types/index.d.ts +3 -1
  52. package/node_modules/undici-types/mock-interceptor.d.ts +0 -1
  53. package/node_modules/undici-types/package.json +1 -1
  54. package/node_modules/undici-types/snapshot-agent.d.ts +107 -0
  55. package/package.json +2 -2
  56. package/node_modules/@contrast/assess/lib/get-policy.js +0 -336
@@ -60,7 +60,7 @@ module.exports = function(core) {
60
60
 
61
61
  responseScanning.handleAutoCompleteMissing = function(sourceContext, resHeaders, resBody) {
62
62
  if (
63
- !isEnabled(AUTOCOMPLETE_MISSING, sourceContext) ||
63
+ !sourceContext.policy?.isRuleEnabled(AUTOCOMPLETE_MISSING) ||
64
64
  !isHtmlContent(resHeaders)
65
65
  ) {
66
66
  return;
@@ -91,7 +91,7 @@ module.exports = function(core) {
91
91
 
92
92
  // de-dupe; this will be re-emitted for parseableBody handlers anyway
93
93
  if (
94
- !isEnabled(CACHE_CONTROLS_MISSING, sourceContext) ||
94
+ !sourceContext.policy?.isRuleEnabled(CACHE_CONTROLS_MISSING) ||
95
95
  (isParseableResponse(resHeaders) && !resBody)
96
96
  ) {
97
97
  return;
@@ -139,7 +139,7 @@ module.exports = function(core) {
139
139
  };
140
140
 
141
141
  responseScanning.handleClickJackingControlsMissing = function(sourceContext, resHeaders) {
142
- if (!isEnabled(CLICKJACKING_CONTROL_MISSING, sourceContext)) return;
142
+ if (!sourceContext.policy?.isRuleEnabled(CLICKJACKING_CONTROL_MISSING)) return;
143
143
 
144
144
  // look for x-frame-options headers with deny or sameorigin
145
145
  const xFrameHeaders = resHeaders['x-frame-options'];
@@ -158,7 +158,7 @@ module.exports = function(core) {
158
158
  };
159
159
 
160
160
  responseScanning.handleParameterPollution = function(sourceContext, resBody) {
161
- if (!isEnabled(PARAMETER_POLLUTION, sourceContext)) return;
161
+ if (!sourceContext.policy?.isRuleEnabled(PARAMETER_POLLUTION)) return;
162
162
 
163
163
  // look for form tag with missing action attribute.
164
164
  // ex: <form method="post">..
@@ -189,12 +189,12 @@ module.exports = function(core) {
189
189
  const cspHeaders = getCspHeaders(resHeaders);
190
190
 
191
191
  // Don't report if not set; this report belongs to 'csp-header-missing'
192
- if (!cspHeaders && isEnabled(CSP_HEADER_MISSING, sourceContext)) {
192
+ if (!cspHeaders && sourceContext.policy?.isRuleEnabled(CSP_HEADER_MISSING)) {
193
193
  reportFindings(sourceContext, { ruleId: ResponseScanningRule.CSP_HEADER_MISSING });
194
194
  return;
195
195
  }
196
196
 
197
- if (!isEnabled(CSP_HEADER_INSECURE, sourceContext)) return;
197
+ if (!sourceContext.policy?.isRuleEnabled(CSP_HEADER_INSECURE)) return;
198
198
 
199
199
  const vulnerabilityMetadata = checkCspSources(cspHeaders);
200
200
 
@@ -209,7 +209,7 @@ module.exports = function(core) {
209
209
  };
210
210
 
211
211
  responseScanning.handleHstsHeaderMissing = function(sourceContext, resHeaders) {
212
- if (!isEnabled(HSTS_HEADER_MISSING, sourceContext)) return;
212
+ if (!sourceContext?.policy?.isRuleEnabled(HSTS_HEADER_MISSING)) return;
213
213
 
214
214
  let header = resHeaders['strict-transport-security'];
215
215
  let maxAge;
@@ -241,7 +241,7 @@ module.exports = function(core) {
241
241
  };
242
242
 
243
243
  responseScanning.handleXContentTypeHeaderMissing = function(sourceContext, resHeaders) {
244
- if (!isEnabled(XCONTENTTYPE_HEADER_MISSING, sourceContext)) return;
244
+ if (!sourceContext.policy?.isRuleEnabled(XCONTENTTYPE_HEADER_MISSING)) return;
245
245
 
246
246
  const headerName = 'x-content-type-options';
247
247
  let header = resHeaders[headerName];
@@ -262,7 +262,7 @@ module.exports = function(core) {
262
262
  };
263
263
 
264
264
  responseScanning.handleXPoweredByHeader = function(sourceContext, resHeaders) {
265
- if (!isEnabled(X_POWERED_BY_HEADER, sourceContext)) return;
265
+ if (!sourceContext.policy?.isRuleEnabled(X_POWERED_BY_HEADER)) return;
266
266
 
267
267
  const headerName = 'x-powered-by';
268
268
  let header = resHeaders[headerName];
@@ -280,7 +280,7 @@ module.exports = function(core) {
280
280
  };
281
281
 
282
282
  responseScanning.handleXxsProtectionHeaderDisabled = function(sourceContext, responseHeaders) {
283
- if (!isEnabled(XXSPROTECTION_HEADER_DISABLED, sourceContext)) return;
283
+ if (!sourceContext?.policy?.isRuleEnabled(XXSPROTECTION_HEADER_DISABLED)) return;
284
284
 
285
285
  const header = responseHeaders['x-xss-protection'];
286
286
 
@@ -294,9 +294,5 @@ module.exports = function(core) {
294
294
  }
295
295
  };
296
296
 
297
- function isEnabled(ruleId, sourceContext) {
298
- return !!sourceContext?.policy?.enabledRules?.has?.(ruleId);
299
- }
300
-
301
297
  return responseScanning;
302
298
  };
@@ -67,7 +67,7 @@ module.exports = function (core) {
67
67
  function handle(ruleId, sourceContext, cookie, sessionEvent) {
68
68
  const state = ensureState(ruleId, sourceContext);
69
69
 
70
- if (!sourceContext?.policy?.enabledRules?.has?.(ruleId) || state.reported) return;
70
+ if (sourceContext?.policy?.disabledRules?.has?.(ruleId) || state.reported) return;
71
71
 
72
72
  for (const value of ensureIterable(cookie)) {
73
73
  if (state.valuesAnalyzed.has(value)) continue;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/assess",
3
- "version": "1.63.0",
3
+ "version": "1.64.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)",
@@ -21,17 +21,17 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/common": "1.37.0",
24
- "@contrast/config": "1.52.1",
25
- "@contrast/core": "1.57.1",
26
- "@contrast/dep-hooks": "1.26.1",
24
+ "@contrast/config": "1.53.0",
25
+ "@contrast/core": "1.58.0",
26
+ "@contrast/dep-hooks": "1.27.0",
27
27
  "@contrast/distringuish": "^6.0.2",
28
- "@contrast/instrumentation": "1.36.1",
29
- "@contrast/logger": "1.30.1",
30
- "@contrast/patcher": "1.29.1",
31
- "@contrast/rewriter": "1.34.0",
32
- "@contrast/route-coverage": "1.49.1",
33
- "@contrast/scopes": "1.27.1",
34
- "@contrast/sources": "1.3.1",
28
+ "@contrast/instrumentation": "1.37.0",
29
+ "@contrast/logger": "1.31.0",
30
+ "@contrast/patcher": "1.30.0",
31
+ "@contrast/rewriter": "1.35.0",
32
+ "@contrast/route-coverage": "1.50.0",
33
+ "@contrast/scopes": "1.28.0",
34
+ "@contrast/sources": "1.4.0",
35
35
  "semver": "^7.6.0"
36
36
  }
37
37
  }
@@ -692,6 +692,14 @@ Example - \`label1, label2, label3\``,
692
692
  fn: parseNum,
693
693
  desc: 'Set the maximum number of untrusted data flow propagations to observe per request.',
694
694
  },
695
+ {
696
+ name: 'assess.rules.disabled_rules',
697
+ arg: '<list,of,rules>',
698
+ default: '',
699
+ fn: split,
700
+ desc: 'Define a list of Protect rules to disable in the agent. The rules must be formatted as a comma-delimited list.',
701
+ },
702
+
695
703
  {
696
704
  name: 'assess.safe_positives.enable',
697
705
  arg: '[false]',
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/config",
3
- "version": "1.52.1",
3
+ "version": "1.53.0",
4
4
  "description": "An API for discovering Contrast agent configuration data",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/common": "1.37.0",
24
- "@contrast/core": "1.57.1",
24
+ "@contrast/core": "1.58.0",
25
25
  "deepmerge": "^4.3.1",
26
26
  "yaml": "^2.2.2"
27
27
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/core",
3
- "version": "1.57.1",
3
+ "version": "1.58.0",
4
4
  "description": "Preconfigured Contrast agent core services and models",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -20,11 +20,11 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@contrast/common": "1.37.0",
23
- "@contrast/config": "1.52.1",
23
+ "@contrast/config": "1.53.0",
24
24
  "@contrast/find-package-json": "^1.1.0",
25
25
  "@contrast/fn-inspect": "^5.0.2",
26
- "@contrast/logger": "1.30.1",
27
- "@contrast/patcher": "1.29.1",
26
+ "@contrast/logger": "1.31.0",
27
+ "@contrast/patcher": "1.30.0",
28
28
  "@contrast/perf": "1.4.0",
29
29
  "@tsxper/crc32": "^2.1.3",
30
30
  "axios": "^1.12.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/deadzones",
3
- "version": "1.29.1",
3
+ "version": "1.30.0",
4
4
  "description": "Configures Contrast agent services and instrumentation within an application",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/common": "1.37.0",
24
- "@contrast/dep-hooks": "1.26.1",
25
- "@contrast/patcher": "1.29.1",
26
- "@contrast/scopes": "1.27.1"
24
+ "@contrast/dep-hooks": "1.27.0",
25
+ "@contrast/patcher": "1.30.0",
26
+ "@contrast/scopes": "1.28.0"
27
27
  }
28
28
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/dep-hooks",
3
- "version": "1.26.1",
3
+ "version": "1.27.0",
4
4
  "description": "Post hooks for Module.prototype.require",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -22,9 +22,9 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@contrast/common": "1.37.0",
25
- "@contrast/core": "1.57.1",
25
+ "@contrast/core": "1.58.0",
26
26
  "@contrast/find-package-json": "^1.1.0",
27
- "@contrast/logger": "1.30.1",
27
+ "@contrast/logger": "1.31.0",
28
28
  "semver": "^7.6.3"
29
29
  }
30
30
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/esm-hooks",
3
- "version": "2.32.0",
3
+ "version": "2.33.0",
4
4
  "type": "module",
5
5
  "description": "Support for loading and instrumenting ECMAScript modules",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -23,10 +23,10 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@contrast/common": "1.37.0",
26
- "@contrast/config": "1.52.1",
27
- "@contrast/core": "1.57.1",
26
+ "@contrast/config": "1.53.0",
27
+ "@contrast/core": "1.58.0",
28
28
  "@contrast/find-package-json": "^1.1.0",
29
- "@contrast/logger": "1.30.1",
30
- "@contrast/rewriter": "1.34.0"
29
+ "@contrast/logger": "1.31.0",
30
+ "@contrast/rewriter": "1.35.0"
31
31
  }
32
32
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/instrumentation",
3
- "version": "1.36.1",
3
+ "version": "1.37.0",
4
4
  "description": "Shared hooks and patches between Protect and Assess components",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/common": "1.37.0",
24
- "@contrast/dep-hooks": "1.26.1",
25
- "@contrast/logger": "1.30.1",
26
- "@contrast/patcher": "1.29.1"
24
+ "@contrast/dep-hooks": "1.27.0",
25
+ "@contrast/logger": "1.31.0",
26
+ "@contrast/patcher": "1.30.0"
27
27
  }
28
28
  }