@contrast/agent-bundle 5.40.0 → 5.42.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 (290) hide show
  1. package/node_modules/@contrast/agent/package.json +12 -11
  2. package/node_modules/@contrast/agent-swc-plugin/index.js +9 -3
  3. package/node_modules/@contrast/agent-swc-plugin/methods.js +15 -1
  4. package/node_modules/@contrast/agent-swc-plugin/package.json +5 -8
  5. package/node_modules/@contrast/agent-swc-plugin/rewriter.wasm +0 -0
  6. package/node_modules/@contrast/agentify/lib/index.js +2 -2
  7. package/node_modules/@contrast/agentify/package.json +15 -14
  8. package/node_modules/@contrast/architecture-components/package.json +5 -5
  9. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/util-format.js +44 -21
  10. package/node_modules/@contrast/assess/lib/dataflow/sources/install/body-parser.js +1 -1
  11. package/node_modules/@contrast/assess/lib/dataflow/sources/install/koa/koa-bodyparsers.js +3 -1
  12. package/node_modules/@contrast/assess/lib/dataflow/sources/install/qs6.js +5 -5
  13. package/node_modules/@contrast/assess/lib/dataflow/sources/install/querystring.js +2 -1
  14. package/node_modules/@contrast/assess/lib/index.d.ts +0 -1
  15. package/node_modules/@contrast/assess/lib/make-source-context.js +7 -37
  16. package/node_modules/@contrast/assess/lib/sampler/common.js +7 -11
  17. package/node_modules/@contrast/assess/package.json +12 -11
  18. package/node_modules/@contrast/common/lib/types.d.ts +7 -1
  19. package/node_modules/@contrast/common/package.json +1 -1
  20. package/node_modules/@contrast/config/lib/common.js +1 -1
  21. package/node_modules/@contrast/config/lib/config.js +49 -27
  22. package/node_modules/@contrast/config/lib/index.d.ts +2 -2
  23. package/node_modules/@contrast/config/lib/options.js +4 -4
  24. package/node_modules/@contrast/config/package.json +4 -3
  25. package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +15 -15
  26. package/node_modules/@contrast/core/package.json +6 -6
  27. package/node_modules/@contrast/deadzones/package.json +5 -5
  28. package/node_modules/@contrast/dep-hooks/package.json +3 -3
  29. package/node_modules/@contrast/esm-hooks/package.json +6 -6
  30. package/node_modules/@contrast/instrumentation/lib/index.js +0 -1
  31. package/node_modules/@contrast/instrumentation/package.json +5 -5
  32. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +298 -148
  33. package/node_modules/@contrast/library-analysis/package.json +4 -4
  34. package/node_modules/@contrast/logger/lib/serializers.js +2 -2
  35. package/node_modules/@contrast/logger/package.json +3 -3
  36. package/node_modules/@contrast/metrics/package.json +6 -6
  37. package/node_modules/@contrast/patcher/package.json +2 -2
  38. package/node_modules/@contrast/protect/lib/get-source-context.js +3 -1
  39. package/node_modules/@contrast/protect/lib/index.js +6 -1
  40. package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +7 -9
  41. package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +18 -19
  42. package/node_modules/@contrast/protect/lib/input-analysis/install/qs6.js +18 -17
  43. package/node_modules/@contrast/protect/lib/input-analysis/install/universal-cookie4.js +2 -3
  44. package/node_modules/@contrast/protect/lib/make-source-context.js +22 -66
  45. package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +73 -72
  46. package/node_modules/@contrast/protect/package.json +11 -11
  47. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +7 -7
  48. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +3 -3
  49. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +24 -21
  50. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.d.ts +11 -11
  51. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +76 -86
  52. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.d.ts +1 -2
  53. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +8 -2
  54. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -2
  55. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +22 -20
  56. package/node_modules/@contrast/reporter/package.json +7 -7
  57. package/node_modules/@contrast/rewriter/lib/index.js +2 -2
  58. package/node_modules/@contrast/rewriter/package.json +6 -6
  59. package/node_modules/@contrast/route-coverage/lib/index.js +1 -9
  60. package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +17 -19
  61. package/node_modules/@contrast/route-coverage/lib/install/hapi.js +9 -2
  62. package/node_modules/@contrast/route-coverage/package.json +8 -8
  63. package/node_modules/@contrast/scopes/package.json +5 -5
  64. package/node_modules/@contrast/sec-obs/lib/traces/http.js +2 -2
  65. package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +17 -0
  66. package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.js +2 -2
  67. package/node_modules/@contrast/sec-obs/lib/traces/outbound-service-call.test.js +17 -0
  68. package/node_modules/@contrast/sec-obs/package.json +9 -9
  69. package/node_modules/@contrast/sources/lib/index.js +109 -0
  70. package/node_modules/@contrast/sources/lib/index.test.js +120 -0
  71. package/node_modules/@contrast/{route-coverage/lib/normalized-url-mapper.js → sources/lib/normalized-uri-mapper.js} +10 -3
  72. package/node_modules/@contrast/sources/lib/normalized-uri-mapper.test.js +59 -0
  73. package/node_modules/@contrast/{sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/constants.js → sources/lib/req-data.js} +0 -6
  74. package/node_modules/@contrast/sources/lib/source-info.js +183 -0
  75. package/node_modules/@contrast/sources/lib/source-info.test.js +68 -0
  76. package/node_modules/@contrast/sources/package.json +16 -0
  77. package/node_modules/@contrast/telemetry/package.json +6 -6
  78. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +2831 -77
  79. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +2831 -77
  80. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
  81. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +415 -98
  82. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +415 -98
  83. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
  84. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +106 -0
  85. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +106 -0
  86. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
  87. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
  88. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
  89. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
  90. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +2831 -77
  91. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +2831 -77
  92. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
  93. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +415 -98
  94. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +415 -98
  95. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
  96. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +106 -0
  97. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +106 -0
  98. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
  99. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
  100. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
  101. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
  102. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +2831 -77
  103. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +2858 -103
  104. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
  105. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +415 -98
  106. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +420 -102
  107. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
  108. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +106 -0
  109. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +106 -0
  110. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
  111. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
  112. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
  113. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
  114. package/node_modules/@opentelemetry/semantic-conventions/package.json +3 -3
  115. package/node_modules/@swc/types/index.d.ts +3 -2
  116. package/node_modules/@swc/types/package.json +1 -1
  117. package/node_modules/@types/node/README.md +2 -2
  118. package/node_modules/@types/node/crypto.d.ts +17 -1
  119. package/node_modules/@types/node/fs/promises.d.ts +7 -3
  120. package/node_modules/@types/node/fs.d.ts +11 -1
  121. package/node_modules/@types/node/http.d.ts +4 -19
  122. package/node_modules/@types/node/http2.d.ts +13 -11
  123. package/node_modules/@types/node/inspector.d.ts +163 -6
  124. package/node_modules/@types/node/module.d.ts +24 -0
  125. package/node_modules/@types/node/package.json +4 -89
  126. package/node_modules/@types/node/perf_hooks.d.ts +14 -0
  127. package/node_modules/@types/node/repl.d.ts +11 -1
  128. package/node_modules/@types/node/sqlite.d.ts +0 -1
  129. package/node_modules/@types/node/stream/web.d.ts +4 -0
  130. package/node_modules/@types/node/stream.d.ts +17 -6
  131. package/node_modules/@types/node/test.d.ts +16 -1
  132. package/node_modules/@types/node/timers.d.ts +0 -2
  133. package/node_modules/@types/node/url.d.ts +1 -1
  134. package/node_modules/@types/node/util.d.ts +6 -2
  135. package/node_modules/@types/node/worker_threads.d.ts +12 -0
  136. package/node_modules/@types/node/zlib.d.ts +8 -2
  137. package/node_modules/axios/CHANGELOG.md +17 -0
  138. package/node_modules/axios/README.md +1 -4
  139. package/node_modules/axios/dist/axios.js +39 -5
  140. package/node_modules/axios/dist/axios.js.map +1 -1
  141. package/node_modules/axios/dist/axios.min.js +2 -2
  142. package/node_modules/axios/dist/axios.min.js.map +1 -1
  143. package/node_modules/axios/dist/browser/axios.cjs +46 -9
  144. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  145. package/node_modules/axios/dist/esm/axios.js +46 -9
  146. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  147. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  148. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  149. package/node_modules/axios/dist/node/axios.cjs +46 -9
  150. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  151. package/node_modules/axios/index.d.cts +13 -2
  152. package/node_modules/axios/lib/core/Axios.js +2 -2
  153. package/node_modules/axios/lib/core/mergeConfig.js +1 -1
  154. package/node_modules/axios/lib/env/data.js +1 -1
  155. package/node_modules/axios/lib/helpers/throttle.js +1 -1
  156. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
  157. package/node_modules/axios/lib/utils.js +36 -0
  158. package/node_modules/axios/package.json +5 -5
  159. package/node_modules/deepmerge/.editorconfig +7 -0
  160. package/node_modules/deepmerge/.eslintcache +1 -0
  161. package/node_modules/deepmerge/changelog.md +167 -0
  162. package/node_modules/deepmerge/dist/cjs.js +133 -0
  163. package/node_modules/deepmerge/dist/umd.js +139 -0
  164. package/node_modules/deepmerge/index.d.ts +20 -0
  165. package/node_modules/deepmerge/index.js +106 -0
  166. package/node_modules/deepmerge/license.txt +21 -0
  167. package/node_modules/deepmerge/package.json +42 -0
  168. package/node_modules/deepmerge/readme.md +264 -0
  169. package/node_modules/deepmerge/rollup.config.js +22 -0
  170. package/node_modules/follow-redirects/package.json +1 -1
  171. package/node_modules/form-data/CHANGELOG.md +601 -0
  172. package/node_modules/form-data/{Readme.md → README.md} +4 -4
  173. package/node_modules/form-data/lib/form_data.js +2 -6
  174. package/node_modules/form-data/package.json +22 -6
  175. package/node_modules/nan/.github/workflows/ci.yml +8 -10
  176. package/node_modules/nan/.pre-commit-config.yaml +8 -0
  177. package/node_modules/nan/CHANGELOG.md +5 -1
  178. package/node_modules/nan/README.md +4 -4
  179. package/node_modules/nan/nan.h +16 -12
  180. package/node_modules/nan/nan_callbacks.h +13 -0
  181. package/node_modules/nan/nan_callbacks_12_inl.h +16 -2
  182. package/node_modules/nan/nan_callbacks_pre_12_inl.h +6 -2
  183. package/node_modules/nan/nan_maybe_43_inl.h +1 -1
  184. package/node_modules/nan/nan_maybe_pre_43_inl.h +1 -1
  185. package/node_modules/nan/nan_scriptorigin.h +11 -9
  186. package/node_modules/nan/nan_typedarray_contents.h +1 -1
  187. package/node_modules/nan/package.json +2 -2
  188. package/node_modules/undici-types/agent.d.ts +4 -0
  189. package/node_modules/undici-types/client-stats.d.ts +15 -0
  190. package/node_modules/undici-types/client.d.ts +6 -3
  191. package/node_modules/undici-types/mock-agent.d.ts +3 -0
  192. package/node_modules/undici-types/package.json +1 -1
  193. package/node_modules/undici-types/pool.d.ts +2 -0
  194. package/node_modules/undici-types/proxy-agent.d.ts +1 -0
  195. package/node_modules/yaml/README.md +2 -20
  196. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +1 -1
  197. package/node_modules/yaml/dist/stringify/stringifyString.js +1 -1
  198. package/node_modules/yaml/package.json +2 -1
  199. package/package.json +3 -2
  200. package/node_modules/@contrast/agentify/lib/sources.js +0 -95
  201. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/LICENSE +0 -12
  202. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.d.ts +0 -385
  203. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/constants.js +0 -270
  204. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.d.ts +0 -40
  205. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/index.js +0 -228
  206. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.d.ts +0 -65
  207. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/primordials.js +0 -66
  208. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.d.ts +0 -383
  209. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/lib/types.js +0 -30
  210. package/node_modules/@contrast/sec-obs/node_modules/@contrast/common/package.json +0 -23
  211. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/LICENSE +0 -12
  212. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/README.md +0 -44
  213. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/common.js +0 -131
  214. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/config.js +0 -290
  215. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.d.ts +0 -328
  216. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/index.js +0 -29
  217. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/options.js +0 -836
  218. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/lib/validators.js +0 -23
  219. package/node_modules/@contrast/sec-obs/node_modules/@contrast/config/package.json +0 -27
  220. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/LICENSE +0 -12
  221. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/README.md +0 -98
  222. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/agent-info.js +0 -36
  223. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/app-info.js +0 -233
  224. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/build-id.js +0 -51
  225. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/capture-stacktrace.js +0 -256
  226. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/contrast-methods.js +0 -155
  227. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/index.d.ts +0 -52
  228. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/ioc/core.js +0 -95
  229. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/is-agent-path.js +0 -37
  230. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/messages.js +0 -28
  231. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +0 -63
  232. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
  233. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/sensitive-data-masking/server-settings-listener.js +0 -44
  234. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/cloud-provider-metadata.js +0 -146
  235. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/index.js +0 -225
  236. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/linux-os-info.js +0 -137
  237. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/lib/system-info/utils.js +0 -35
  238. package/node_modules/@contrast/sec-obs/node_modules/@contrast/core/package.json +0 -33
  239. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/LICENSE +0 -12
  240. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/README.md +0 -94
  241. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +0 -121
  242. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +0 -206
  243. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +0 -72
  244. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +0 -88
  245. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +0 -46
  246. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -106
  247. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -28
  248. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/helpers.js +0 -66
  249. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.d.ts +0 -115
  250. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/index.js +0 -208
  251. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +0 -43
  252. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/lib/package-finder.js +0 -79
  253. package/node_modules/@contrast/sec-obs/node_modules/@contrast/dep-hooks/package.json +0 -29
  254. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/LICENSE +0 -12
  255. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/README.md +0 -270
  256. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.d.ts +0 -16
  257. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/index.js +0 -132
  258. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.d.ts +0 -33
  259. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/serializers.js +0 -75
  260. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.d.ts +0 -15
  261. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/lib/utils.js +0 -34
  262. package/node_modules/@contrast/sec-obs/node_modules/@contrast/logger/package.json +0 -28
  263. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/LICENSE +0 -12
  264. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/README.md +0 -51
  265. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.d.ts +0 -101
  266. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/lib/index.js +0 -544
  267. package/node_modules/@contrast/sec-obs/node_modules/@contrast/patcher/package.json +0 -25
  268. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/LICENSE +0 -12
  269. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/README.md +0 -6
  270. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/cache.js +0 -318
  271. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/index.js +0 -216
  272. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/lib/rewrite-is-deadzoned.js +0 -143
  273. package/node_modules/@contrast/sec-obs/node_modules/@contrast/rewriter/package.json +0 -30
  274. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/LICENSE +0 -12
  275. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/constants.js +0 -26
  276. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.d.ts +0 -46
  277. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/index.js +0 -70
  278. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/bluebird.js +0 -128
  279. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/index.js +0 -34
  280. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb-core.js +0 -83
  281. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb3.js +0 -89
  282. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb4.js +0 -80
  283. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mongodb6.js +0 -46
  284. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/mysql.js +0 -151
  285. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/install/redis.js +0 -79
  286. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/lib/utils.js +0 -35
  287. package/node_modules/@contrast/sec-obs/node_modules/@contrast/scopes/package.json +0 -28
  288. package/node_modules/@types/node/ts5.1/compatibility/disposable.d.ts +0 -12
  289. package/node_modules/@types/node/ts5.1/index.d.ts +0 -98
  290. package/node_modules/form-data/README.md.bak +0 -355
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/library-analysis",
3
- "version": "1.44.2",
3
+ "version": "1.45.0",
4
4
  "description": "Handles library reporting and library usage analysis",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -21,10 +21,10 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/code-events": "^3.1.0",
24
- "@contrast/common": "1.34.2",
25
- "@contrast/config": "1.49.2",
24
+ "@contrast/common": "1.35.0",
25
+ "@contrast/config": "1.50.0",
26
26
  "@contrast/find-package-json": "^1.1.0",
27
- "@contrast/logger": "1.27.2",
27
+ "@contrast/logger": "1.28.0",
28
28
  "semver": "^7.6.0"
29
29
  }
30
30
  }
@@ -26,8 +26,8 @@ function config(config) {
26
26
  // log as-is if not a Config instance
27
27
  if (typeof config?.getReport !== 'function')
28
28
  return config;
29
- const safeCopy = { _errors: [...config._errors] };
30
- const { config: { effective_config } } = config.getReport({ redact: true });
29
+ const safeCopy = { _errors: [...config._errors], _filepaths: [...config._filepaths] };
30
+ const { config: { effective_config } } = config.getReport({ redact: true, stringify: false });
31
31
  for (const info of effective_config) {
32
32
  const { canonical_name, value } = info;
33
33
  (0, common_1.set)(safeCopy, canonical_name, value);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/logger",
3
- "version": "1.27.2",
3
+ "version": "1.28.0",
4
4
  "description": "Centralized logging for Contrast agent services",
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
  "test": "bash ../scripts/test.sh"
22
22
  },
23
23
  "dependencies": {
24
- "@contrast/common": "1.34.2",
25
- "@contrast/config": "1.49.2",
24
+ "@contrast/common": "1.35.0",
25
+ "@contrast/config": "1.50.0",
26
26
  "pino": "^8.15.0"
27
27
  }
28
28
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/metrics",
3
- "version": "1.31.2",
3
+ "version": "1.32.0",
4
4
  "description": "Records and logs route latency",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -21,10 +21,10 @@
21
21
  "test": "bash ../scripts/test.sh"
22
22
  },
23
23
  "dependencies": {
24
- "@contrast/common": "1.34.2",
25
- "@contrast/config": "1.49.2",
26
- "@contrast/dep-hooks": "1.23.2",
27
- "@contrast/logger": "1.27.2",
28
- "@contrast/patcher": "1.26.2"
24
+ "@contrast/common": "1.35.0",
25
+ "@contrast/config": "1.50.0",
26
+ "@contrast/dep-hooks": "1.24.0",
27
+ "@contrast/logger": "1.28.0",
28
+ "@contrast/patcher": "1.27.0"
29
29
  }
30
30
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/patcher",
3
- "version": "1.26.2",
3
+ "version": "1.27.0",
4
4
  "description": "Advanced monkey patching--registers hooks to run in and around functions",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -20,6 +20,6 @@
20
20
  "test": "bash ../scripts/test.sh"
21
21
  },
22
22
  "dependencies": {
23
- "@contrast/logger": "1.27.2"
23
+ "@contrast/logger": "1.28.0"
24
24
  }
25
25
  }
@@ -22,7 +22,9 @@ module.exports = function init(core) {
22
22
  if (!core.config.getEffectiveValue('protect.enable')) return null;
23
23
 
24
24
  const sourceContext = sources.getStore()?.protect;
25
- return sourceContext?.allowed ? null : sourceContext;
25
+ if (!sourceContext) return null;
26
+
27
+ return sourceContext.allowed ? null : sourceContext;
26
28
  }
27
29
 
28
30
  core.protect.getSourceContext = getSourceContext;
@@ -20,7 +20,7 @@ const { callChildComponentMethodsSync } = require('@contrast/common');
20
20
  const { ConfigSource } = require('@contrast/config');
21
21
 
22
22
  module.exports = function(core) {
23
- const { config } = core;
23
+ const { config, sources } = core;
24
24
 
25
25
  const protect = core.protect = {
26
26
  agentLib: module.exports.instantiateAgentLib(),
@@ -55,6 +55,11 @@ module.exports = function(core) {
55
55
  callChildComponentMethodsSync(protect, 'install');
56
56
  };
57
57
 
58
+ // append async state to store when request-scope sources are created
59
+ sources.addHook('onSource', (ctx) => {
60
+ ctx.store.protect = protect.makeSourceContext(ctx);
61
+ });
62
+
58
63
  return protect;
59
64
  };
60
65
 
@@ -117,7 +117,6 @@ module.exports = Core.makeComponent({
117
117
 
118
118
  // all handlers will be invoked with two arguments:
119
119
  // 1) sourceContext object containing:
120
- // - reqData, the abstract request object containing only what is needed
121
120
  // - protect, the protect context
122
121
  // - rules, exclusions, virtual patches (TS data). what was in effect for this
123
122
  // url *at the time the request was started*. these will not change.
@@ -162,7 +161,7 @@ module.exports = Core.makeComponent({
162
161
  * 'connectInputs' makes sense; a flag similar to 'contentType' can be set and it can be
163
162
  * used later to avoid calling 'handleQueryParams()'
164
163
  *
165
- * @param {Object} sourceContext { reqData, protect } that will be supplied to
164
+ * @param {Object} sourceContext { protect } that will be supplied to
166
165
  * all handlers and sinks for this request. It will always be supplied by the caller
167
166
  * to a handler; the handler is not aware of the implementation.
168
167
  * @param {Object} connectInputs each property is an input to be evaluated by this
@@ -343,7 +342,8 @@ module.exports = Core.makeComponent({
343
342
 
344
343
  let bodyType;
345
344
  let inputTypes;
346
- if (sourceContext.reqData.contentType.includes('/json')) {
345
+ const { sourceInfo } = core.scopes.sources.getStore();
346
+ if (sourceInfo?.contentType?.includes?.('/json')) {
347
347
  bodyType = 'json';
348
348
  inputTypes = jsonInputTypes;
349
349
  } else {
@@ -438,9 +438,8 @@ module.exports = Core.makeComponent({
438
438
  inputAnalysis.handleIpAllowlist = function(sourceContext, ipAllowlist) {
439
439
  if (!sourceContext || !ipAllowlist.length) return;
440
440
 
441
- const { ip: reqIp, headers: reqHeaders } = sourceContext.reqData;
442
-
443
- const match = ipListAnalysis(reqIp, reqHeaders, ipAllowlist);
441
+ const { sourceInfo } = core.scopes.sources.getStore();
442
+ const match = ipListAnalysis(sourceInfo.ip, sourceInfo.rawHeaders, ipAllowlist);
444
443
 
445
444
  if (match) {
446
445
  logger.info(match, 'Found a matching IP to an entry in ipAllow list');
@@ -453,9 +452,8 @@ module.exports = Core.makeComponent({
453
452
 
454
453
  if (!sourceContext || !ipDenylist.length) return;
455
454
 
456
- const { ip: reqIp, headers: reqHeaders } = sourceContext.reqData;
457
-
458
- const match = ipListAnalysis(reqIp, reqHeaders, ipDenylist);
455
+ const { sourceInfo } = core.scopes.sources.getStore();
456
+ const match = ipListAnalysis(sourceInfo.Ip, sourceInfo.rawHeaders, ipDenylist);
459
457
 
460
458
  if (match) {
461
459
  logger.info(match, 'Found a matching IP to an entry in ipDeny list');
@@ -31,24 +31,19 @@ module.exports = function (core) {
31
31
  },
32
32
  } = core;
33
33
 
34
- const instr = inputAnalysis.httpInstrumentation = {
35
- install,
36
- around
37
- };
38
-
39
- function removeCookies(headers) {
40
- for (let i = 0; i < headers.length; i += 2) {
41
- if (headers[i] === 'cookies') {
42
- headers = ArrayPrototypeSlice.call(headers);
43
- headers.splice(i, 2);
34
+ function removeCookies(rawHeaders) {
35
+ for (let i = 0; i < rawHeaders.length; i += 2) {
36
+ if (rawHeaders[i] === 'cookies') {
37
+ rawHeaders = ArrayPrototypeSlice.call(rawHeaders);
38
+ rawHeaders.splice(i, 2);
44
39
  }
45
40
  }
46
- return headers;
41
+ return rawHeaders;
47
42
  }
48
43
 
49
44
  function around(next, data) {
50
45
  let store, block;
51
- const { args: [type, req, res] } = data;
46
+ const { args: [type,, res] } = data;
52
47
 
53
48
  function callNext() {
54
49
  setImmediate(() => {
@@ -63,21 +58,20 @@ module.exports = function (core) {
63
58
 
64
59
  try {
65
60
  store = sources.getStore();
66
- if (!store) {
61
+ if (!store?.protect) {
67
62
  logger.debug({ funcKey: data.funcKey }, 'request store not available during http input-analysis');
63
+ callNext();
68
64
  return;
69
65
  }
70
-
71
- store.protect = core.protect.makeSourceContext(req, res);
72
66
  if (store.protect.allowed) {
73
67
  callNext();
74
68
  return;
75
69
  }
76
70
 
77
71
  const {
78
- reqData: { headers, uriPath, method },
79
- resData,
80
- } = store.protect;
72
+ sourceInfo: { method, rawHeaders, uriPath },
73
+ protect: { resData }
74
+ } = store;
81
75
 
82
76
  onFinished(res, (/* err, req */) => {
83
77
  resData.statusCode = res.statusCode;
@@ -86,7 +80,7 @@ module.exports = function (core) {
86
80
  });
87
81
 
88
82
  const connectInputs = {
89
- headers: removeCookies(headers),
83
+ headers: removeCookies(rawHeaders),
90
84
  uriPath,
91
85
  method: StringPrototypeToLowerCase.call(method),
92
86
  };
@@ -131,5 +125,10 @@ module.exports = function (core) {
131
125
  });
132
126
  }
133
127
 
128
+ const instr = inputAnalysis.httpInstrumentation = {
129
+ install,
130
+ around
131
+ };
132
+
134
133
  return instr;
135
134
  };
@@ -22,34 +22,35 @@ module.exports = (core) => {
22
22
  depHooks,
23
23
  patcher,
24
24
  protect,
25
- protect: { inputAnalysis },
25
+ scopes,
26
26
  } = core;
27
27
 
28
28
  // Patch `qs`
29
29
  function install() {
30
- depHooks.resolve({ name: 'qs', version: '<7' },
31
- (qs) => patcher.patch(qs, 'parse', {
32
- name: 'qs',
33
- patchType,
34
- post({ args, result }) {
35
- if (result && Object.keys(result).length) {
36
- const sourceContext = protect.getSourceContext();
37
-
38
- // We need to run analysis for the `qs` result only when it's used as a query parser.
39
- // `qs` is used also for parsing bodies, but these cases we handle individually with
40
- // the respective library that's using it (e.g. `formidable`, `co-body`) because in
41
- // some cases its use is optional and we cannot rely on it.
42
- if (sourceContext && sourceContext.reqData?.queries === args[0]) {
30
+ depHooks.resolve({ name: 'qs', version: '<7' }, (qs) => patcher.patch(qs, 'parse', {
31
+ name: 'qs',
32
+ patchType,
33
+ post({ args, result }) {
34
+ if (result && Object.keys(result).length) {
35
+ const sourceContext = protect.getSourceContext();
36
+ // We need to run analysis for the `qs` result only when it's used as a query parser.
37
+ // `qs` is used also for parsing bodies, but these cases we handle individually with
38
+ // the respective library that's using it (e.g. `formidable`, `co-body`) because in
39
+ // some cases its use is optional and we cannot rely on it.
40
+ if (sourceContext) {
41
+ const { sourceInfo } = scopes.sources.getStore();
42
+ if (sourceInfo.queries === args[0]) {
43
43
  sourceContext.parsedQuery = result;
44
- inputAnalysis.handleQueryParams(sourceContext, result);
44
+ protect.inputAnalysis.handleQueryParams(sourceContext, result);
45
45
  }
46
46
  }
47
47
  }
48
- })
48
+ }
49
+ })
49
50
  );
50
51
  }
51
52
 
52
- const qs6Instrumentation = inputAnalysis.qs6Instrumentation = {
53
+ const qs6Instrumentation = protect.inputAnalysis.qs6Instrumentation = {
53
54
  install
54
55
  };
55
56
 
@@ -22,7 +22,6 @@ module.exports = (core) => {
22
22
  depHooks,
23
23
  patcher,
24
24
  protect,
25
- protect: { inputAnalysis },
26
25
  } = core;
27
26
 
28
27
  // Patch `universal-cookie` package
@@ -36,7 +35,7 @@ module.exports = (core) => {
36
35
 
37
36
  if (sourceContext) {
38
37
  sourceContext.parsedCookies = result;
39
- inputAnalysis.handleCookies(sourceContext, result);
38
+ protect.inputAnalysis.handleCookies(sourceContext, result);
40
39
  }
41
40
  }
42
41
  }
@@ -44,7 +43,7 @@ module.exports = (core) => {
44
43
  );
45
44
  }
46
45
 
47
- const universalCookie4Instrumentation = inputAnalysis.universalCookie4Instrumentation = {
46
+ const universalCookie4Instrumentation = protect.inputAnalysis.universalCookie4Instrumentation = {
48
47
  install
49
48
  };
50
49
 
@@ -15,80 +15,36 @@
15
15
 
16
16
  'use strict';
17
17
 
18
- const { primordials: { StringPrototypeToLowerCase, StringPrototypeSlice } } = require('@contrast/common');
19
-
20
18
  module.exports = function(core) {
21
- const {
22
- protect: { getPolicy }
23
- } = core;
24
-
25
- const disabledPolicy = { allowed: true };
26
-
27
- function makeSourceContext(req, res) {
28
- if (!core.config.getEffectiveValue('protect.enable')) {
29
- return disabledPolicy;
30
- }
31
-
32
- // make the abstract request. it is an abstraction of a request that
33
- // contains only the pieces of the request required by handlers. this
34
- // is done to make an explicit contract for data that is required by
35
- // the handlers. additional data that is discovered to be required by
36
- // handlers should be added here. the goal is not to pass the raw req
37
- // or res objects so that all data coupling is all defined here.
38
-
39
- // separate path and search params
40
-
41
- let uriPath, queries;
42
- const ix = req.url.indexOf('?');
43
-
44
- if (ix >= 0) {
45
- uriPath = StringPrototypeSlice.call(req.url, 0, ix);
46
- queries = StringPrototypeSlice.call(req.url, ix + 1);
47
- } else {
48
- uriPath = req.url;
49
- queries = '';
50
- }
51
-
52
- const policy = getPolicy({ uriPath });
53
-
19
+ const { protect } = core;
20
+
21
+ const DISABLED_POLICY = { allowed: true };
22
+
23
+ /**
24
+ * @param {object} param
25
+ * @param {object} param.store
26
+ * @param {import('@contrast/common').SourceInfo} param.store.sourceInfo
27
+ * @param {import('node:http').IncomingMessage} param.incomingMessage
28
+ * @param {import('node:http').ServerResponse} param.serverResponse
29
+ *
30
+ */
31
+ function makeSourceContext({
32
+ store: { sourceInfo },
33
+ // incomingMessage,
34
+ serverResponse,
35
+ }) {
36
+ if (!core.config.getEffectiveValue('protect.enable')) return DISABLED_POLICY;
37
+
38
+ const policy = protect.getPolicy({ uriPath: sourceInfo.uriPath });
54
39
  // URL exclusions can disable all rules
55
- if (!policy || policy.rulesMask === 0) {
56
- return disabledPolicy;
57
- }
58
-
59
- // lowercase header keys and capture content-type
60
- let contentType = '';
61
- const headers = Array(req.rawHeaders.length);
62
-
63
- for (let i = 0; i < req.rawHeaders.length; i += 2) {
64
- headers[i] = StringPrototypeToLowerCase.call(req.rawHeaders[i]);
65
- headers[i + 1] = req.rawHeaders[i + 1];
66
- if (headers[i] === 'content-type') {
67
- contentType = StringPrototypeToLowerCase.call(headers[i + 1]);
68
- }
69
- }
70
-
71
- // contains request data and information derived from request data. it's
72
- // possible for any derived information to be derived later, but doing
73
- // so here is typically better; it makes clear what information is used to
74
- // make decisions by different handlers.
75
- const reqData = {
76
- ip: req.socket.remoteAddress,
77
- httpVersion: req.httpVersion,
78
- method: req.method,
79
- headers,
80
- uriPath,
81
- queries,
82
- contentType,
83
- };
40
+ if (!policy || policy.rulesMask === 0) return DISABLED_POLICY;
84
41
 
85
42
  const protectStore = {
86
- reqData,
87
43
  resData: {
88
44
  statusCode: null,
89
45
  },
90
46
  // block closure captures res so it isn't exposed to beyond here
91
- blocker: new core.protect.Blocker(res),
47
+ blocker: new core.protect.Blocker(serverResponse),
92
48
  policy,
93
49
  exclusions: [],
94
50
  virtualPatchesEvaluators: [],
@@ -75,6 +75,79 @@ module.exports = function(core) {
75
75
  }
76
76
  }
77
77
 
78
+ /**
79
+ * Backdoor detection logic:
80
+ * - command is >= 2 chars
81
+ * - iterates over every piece of request and checks
82
+ * - the full value is the param to sink
83
+ * - the value matches a regex and ends the param to the sink
84
+ */
85
+ function findBackdoorInjection(sourceContext, command) {
86
+ if (command?.length < 2) {
87
+ return null;
88
+ }
89
+
90
+ const { sourceInfo } = core.scopes.sources.getStore();
91
+ const valuesOfInterest = {
92
+ [InputType.QUERYSTRING]: sourceContext.parsedQuery,
93
+ [InputType.PARAMETER_VALUE]: sourceContext.parsedParams,
94
+ [InputType.BODY]: sourceContext.parsedBody,
95
+ [InputType.COOKIE_VALUE]: sourceContext.parsedCookies,
96
+ [InputType.HEADER]: sourceInfo.rawHeaders,
97
+ };
98
+
99
+ let found;
100
+ for (const inputType in valuesOfInterest) {
101
+ if (found) break;
102
+
103
+ const values = valuesOfInterest[inputType];
104
+
105
+ if (values && Object.keys(values).length) {
106
+ traverseValues(values, (path, type, value, obj) => {
107
+ if (isBackdoorDetected(value, command)) {
108
+ let key;
109
+ if (inputType === InputType.HEADER) {
110
+ key = obj[path[0] - 1];
111
+ } else {
112
+ key = path[path.length - 1];
113
+ }
114
+
115
+ found = {
116
+ key,
117
+ inputType: path.length > 1 ? InputType.JSON_VALUE : inputType,
118
+ path: ArrayPrototypeSlice.call(path, 0, -1),
119
+ value: command
120
+ };
121
+
122
+ // halt traversal
123
+ return true;
124
+ }
125
+ });
126
+ }
127
+ }
128
+
129
+ return found;
130
+ }
131
+
132
+ /**
133
+ * strips the whitespace of the request value and the command,
134
+ * checks if the command equals the request value
135
+ * or if the command looks like the start of a shell execution
136
+ * and ends with the request value passed to the sink
137
+ *
138
+ * @param {string} value from request key
139
+ */
140
+ function isBackdoorDetected(requestValue, command) {
141
+ const normalizedValue = stripWhiteSpace(requestValue);
142
+ const normalizedCommand = stripWhiteSpace(command);
143
+
144
+ return (
145
+ normalizedValue === normalizedCommand ||
146
+ (normalizedCommand.endsWith(normalizedValue) &&
147
+ RegExpPrototypeTest.call(SINK_EXPLOIT_PATTERN_START, normalizedCommand))
148
+ );
149
+ }
150
+
78
151
  semanticAnalysis.handleCmdInjectionSemanticDangerous = function(sourceContext, sinkContext) {
79
152
  const mode = sourceContext.policy[Rule.CMD_INJECTION_SEMANTIC_DANGEROUS_PATHS];
80
153
 
@@ -137,75 +210,3 @@ module.exports = function(core) {
137
210
 
138
211
  return semanticAnalysis;
139
212
  };
140
-
141
- /**
142
- * Backdoor detection logic:
143
- * - command is >= 2 chars
144
- * - iterates over every piece of request and checks
145
- * - the full value is the param to sink
146
- * - the value matches a regex and ends the param to the sink
147
- */
148
- function findBackdoorInjection(sourceContext, command) {
149
- if (command?.length < 2) {
150
- return null;
151
- }
152
-
153
- const valuesOfInterest = {
154
- [InputType.QUERYSTRING]: sourceContext.parsedQuery,
155
- [InputType.PARAMETER_VALUE]: sourceContext.parsedParams,
156
- [InputType.BODY]: sourceContext.parsedBody,
157
- [InputType.COOKIE_VALUE]: sourceContext.parsedCookies,
158
- [InputType.HEADER]: sourceContext.reqData.headers,
159
- };
160
-
161
- let found;
162
- for (const inputType in valuesOfInterest) {
163
- if (found) break;
164
-
165
- const values = valuesOfInterest[inputType];
166
-
167
- if (values && Object.keys(values).length) {
168
- traverseValues(values, (path, type, value, obj) => {
169
- if (isBackdoorDetected(value, command)) {
170
- let key;
171
- if (inputType === InputType.HEADER) {
172
- key = obj[path[0] - 1];
173
- } else {
174
- key = path[path.length - 1];
175
- }
176
-
177
- found = {
178
- key,
179
- inputType: path.length > 1 ? InputType.JSON_VALUE : inputType,
180
- path: ArrayPrototypeSlice.call(path, 0, -1),
181
- value: command
182
- };
183
-
184
- // halt traversal
185
- return true;
186
- }
187
- });
188
- }
189
- }
190
-
191
- return found;
192
- }
193
-
194
- /**
195
- * strips the whitespace of the request value and the command,
196
- * checks if the command equals the request value
197
- * or if the command looks like the start of a shell execution
198
- * and ends with the request value passed to the sink
199
- *
200
- * @param {string} value from request key
201
- */
202
- function isBackdoorDetected(requestValue, command) {
203
- const normalizedValue = stripWhiteSpace(requestValue);
204
- const normalizedCommand = stripWhiteSpace(command);
205
-
206
- return (
207
- normalizedValue === normalizedCommand ||
208
- (normalizedCommand.endsWith(normalizedValue) &&
209
- RegExpPrototypeTest.call(SINK_EXPLOIT_PATTERN_START, normalizedCommand))
210
- );
211
- }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/protect",
3
- "version": "1.64.2",
3
+ "version": "1.65.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)",
@@ -21,16 +21,16 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@contrast/agent-lib": "^9.1.0",
24
- "@contrast/common": "1.34.2",
25
- "@contrast/config": "1.49.2",
26
- "@contrast/core": "1.54.2",
27
- "@contrast/dep-hooks": "1.23.2",
28
- "@contrast/esm-hooks": "2.28.2",
29
- "@contrast/instrumentation": "1.33.2",
30
- "@contrast/logger": "1.27.2",
31
- "@contrast/patcher": "1.26.2",
32
- "@contrast/rewriter": "1.30.2",
33
- "@contrast/scopes": "1.24.2",
24
+ "@contrast/common": "1.35.0",
25
+ "@contrast/config": "1.50.0",
26
+ "@contrast/core": "1.55.0",
27
+ "@contrast/dep-hooks": "1.24.0",
28
+ "@contrast/esm-hooks": "2.29.0",
29
+ "@contrast/instrumentation": "1.34.0",
30
+ "@contrast/logger": "1.28.0",
31
+ "@contrast/patcher": "1.27.0",
32
+ "@contrast/rewriter": "1.31.0",
33
+ "@contrast/scopes": "1.25.0",
34
34
  "async-hook-domain": "^4.0.1",
35
35
  "ipaddr.js": "^2.0.1",
36
36
  "on-finished": "^2.4.1",
@@ -27,15 +27,15 @@ class ApplicationActivity extends ng_endpoint_1.default {
27
27
  this.defendPayload = [];
28
28
  this.lastUpdate = 0;
29
29
  this.userAgentSet = new Set();
30
- uiReporter.subscribeWithLock(common_1.Event.PROTECT, (msg) => {
31
- if (!msg.protect)
30
+ uiReporter.subscribeWithLock(common_1.Event.PROTECT, (store) => {
31
+ if (!store.protect || !store.sourceInfo)
32
32
  return;
33
- const { userAgent, attackModel } = (0, translations_1.handleProtectMessage)(msg.protect);
34
- if (userAgent) {
35
- this.userAgentSet.add(userAgent);
33
+ const result = (0, translations_1.handleProtectMessage)(store);
34
+ if (result?.userAgent) {
35
+ this.userAgentSet.add(result.userAgent);
36
36
  }
37
- if (attackModel) {
38
- this.defendPayload.push(attackModel);
37
+ if (result?.attackModel) {
38
+ this.defendPayload.push(result.attackModel);
39
39
  }
40
40
  });
41
41
  }