@contrast/assess 1.4.0 → 1.6.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 (59) hide show
  1. package/lib/dataflow/event-factory.js +41 -83
  2. package/lib/dataflow/index.js +0 -1
  3. package/lib/dataflow/propagation/install/array-prototype-join.js +3 -3
  4. package/lib/dataflow/propagation/install/contrast-methods/add.js +23 -16
  5. package/lib/dataflow/propagation/install/contrast-methods/tag.js +30 -22
  6. package/lib/dataflow/propagation/install/decode-uri-component.js +8 -5
  7. package/lib/dataflow/propagation/install/ejs/escape-xml.js +8 -5
  8. package/lib/dataflow/propagation/install/encode-uri-component.js +3 -3
  9. package/lib/dataflow/propagation/install/escape-html.js +10 -7
  10. package/lib/dataflow/propagation/install/escape.js +8 -5
  11. package/lib/dataflow/propagation/install/handlebars-utils-escape-expression.js +8 -5
  12. package/lib/dataflow/propagation/install/mysql-connection-escape.js +8 -5
  13. package/lib/dataflow/propagation/install/pug-runtime-escape.js +3 -3
  14. package/lib/dataflow/propagation/install/querystring/parse.js +11 -6
  15. package/lib/dataflow/propagation/install/sql-template-strings.js +3 -3
  16. package/lib/dataflow/propagation/install/string/concat.js +4 -4
  17. package/lib/dataflow/propagation/install/string/format-methods.js +2 -2
  18. package/lib/dataflow/propagation/install/string/html-methods.js +5 -5
  19. package/lib/dataflow/propagation/install/string/index.js +1 -0
  20. package/lib/dataflow/propagation/install/string/match.js +3 -3
  21. package/lib/dataflow/propagation/install/string/replace.js +9 -5
  22. package/lib/dataflow/propagation/install/string/slice.js +104 -0
  23. package/lib/dataflow/propagation/install/string/split.js +4 -4
  24. package/lib/dataflow/propagation/install/string/substring.js +6 -4
  25. package/lib/dataflow/propagation/install/string/trim.js +2 -2
  26. package/lib/dataflow/propagation/install/unescape.js +8 -5
  27. package/lib/dataflow/propagation/install/url/domain-parsers.js +3 -3
  28. package/lib/dataflow/propagation/install/validator/hooks.js +2 -2
  29. package/lib/dataflow/propagation/install/validator/methods.js +60 -51
  30. package/lib/dataflow/sinks/index.js +15 -2
  31. package/lib/dataflow/sinks/install/child-process.js +224 -0
  32. package/lib/dataflow/sinks/install/fastify/unvalidated-redirect.js +47 -23
  33. package/lib/dataflow/sinks/install/fs.js +136 -0
  34. package/lib/dataflow/sinks/install/http.js +48 -32
  35. package/lib/dataflow/sinks/install/koa/index.js +30 -0
  36. package/lib/dataflow/sinks/install/koa/unvalidated-redirect.js +122 -0
  37. package/lib/dataflow/sinks/install/marsdb.js +135 -0
  38. package/lib/dataflow/sinks/install/mongodb.js +205 -0
  39. package/lib/dataflow/sinks/install/mssql.js +19 -13
  40. package/lib/dataflow/sinks/install/mysql.js +122 -0
  41. package/lib/dataflow/sinks/install/postgres.js +40 -29
  42. package/lib/dataflow/sinks/install/sqlite3.js +99 -0
  43. package/lib/dataflow/sources/handler.js +19 -15
  44. package/lib/dataflow/sources/index.js +9 -0
  45. package/lib/dataflow/sources/install/busboy1.js +112 -0
  46. package/lib/dataflow/sources/install/fastify/fastify.js +23 -29
  47. package/lib/dataflow/sources/install/fastify/index.js +4 -5
  48. package/lib/dataflow/sources/install/formidable1.js +91 -0
  49. package/lib/dataflow/sources/install/http.js +35 -14
  50. package/lib/dataflow/sources/install/koa/index.js +32 -0
  51. package/lib/dataflow/sources/install/koa/koa-bodyparsers.js +92 -0
  52. package/lib/dataflow/sources/install/koa/koa-routers.js +84 -0
  53. package/lib/dataflow/sources/install/koa/koa2.js +103 -0
  54. package/lib/dataflow/sources/install/qs6.js +84 -0
  55. package/lib/dataflow/utils/is-vulnerable.js +1 -1
  56. package/package.json +2 -2
  57. package/lib/dataflow/signatures/index.js +0 -2006
  58. package/lib/dataflow/signatures/mssql.js +0 -49
  59. package/lib/dataflow/sources/install/fastify/cookie.js +0 -61
@@ -1,49 +0,0 @@
1
- /*
2
- * Copyright: 2022 Contrast Security, Inc
3
- * Contact: support@contrastsecurity.com
4
- * License: Commercial
5
-
6
- * NOTICE: This Software and the patented inventions embodied within may only be
7
- * used as part of Contrast Security’s commercial offerings. Even though it is
8
- * made available through public repositories, use of this Software is subject to
9
- * the applicable End User Licensing Agreement found at
10
- * https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
11
- * between Contrast Security and the End User. The Software may not be reverse
12
- * engineered, modified, repackaged, sold, redistributed or otherwise used in a
13
- * way not consistent with the End User License Agreement.
14
- */
15
-
16
- 'use strict';
17
-
18
- module.exports = [
19
- [
20
- 'mssql/lib/base/prepared-statement.prototype.prepare',
21
- {
22
- moduleName: 'mssql',
23
- version: '>=6.4.0',
24
- filename: 'lib/base/prepared-statement.js',
25
- methodName: 'PreparedStatement.prototype.prepare',
26
- isModule: true,
27
- },
28
- ],
29
- [
30
- 'mssql/lib/base/request.prototype.batch',
31
- {
32
- moduleName: 'mssql',
33
- version: '>=6.4.0',
34
- filename: 'lib/base/request.js',
35
- methodName: 'Request.prototype.batch',
36
- isModule: true,
37
- },
38
- ],
39
- [
40
- 'mssql/lib/base/request.prototype.query',
41
- {
42
- moduleName: 'mssql',
43
- version: '>=6.4.0',
44
- filename: 'lib/base/request.js',
45
- methodName: 'Request.prototype.query',
46
- isModule: true,
47
- },
48
- ],
49
- ];
@@ -1,61 +0,0 @@
1
- /*
2
- * Copyright: 2022 Contrast Security, Inc
3
- * Contact: support@contrastsecurity.com
4
- * License: Commercial
5
-
6
- * NOTICE: This Software and the patented inventions embodied within may only be
7
- * used as part of Contrast Security’s commercial offerings. Even though it is
8
- * made available through public repositories, use of this Software is subject to
9
- * the applicable End User Licensing Agreement found at
10
- * https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
11
- * between Contrast Security and the End User. The Software may not be reverse
12
- * engineered, modified, repackaged, sold, redistributed or otherwise used in a
13
- * way not consistent with the End User License Agreement.
14
- */
15
-
16
- 'use strict';
17
-
18
- const { InputType } = require('@contrast/common');
19
- const { patchType } = require('../../common');
20
-
21
- module.exports = function(core) {
22
- const {
23
- depHooks,
24
- patcher,
25
- assess: { dataflow: { sources } },
26
- } = core;
27
-
28
- const source = sources.fastifyInstrumentation.cookie = {
29
- install() {
30
- [
31
- '@fastify/cookie',
32
- 'fastify-cookie'
33
- ].forEach((moduleName) => {
34
- depHooks.resolve({ name: moduleName }, (lib) => patcher.patch(lib, {
35
- name: `${moduleName}.constructor`,
36
- patchType,
37
- post({ args: [server] }) {
38
- const name = 'fastifyServer.parseCookie';
39
- patcher.patch(server, 'parseCookie', {
40
- name,
41
- patchType,
42
- post({ hooked, orig, result: cookies }) {
43
- sources.handle({
44
- name,
45
- inputType: InputType.COOKIE_VALUE,
46
- stacktraceOpts: {
47
- constructorOpt: hooked,
48
- prependFrames: [orig]
49
- },
50
- data: cookies,
51
- });
52
- }
53
- });
54
- }
55
- }));
56
- });
57
- }
58
- };
59
-
60
- return source;
61
- };