eslint-plugin-secure-coding 3.0.0 → 3.0.1

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 (157) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +149 -315
  3. package/package.json +1 -1
  4. package/src/index.d.ts +3 -12
  5. package/src/index.js +7 -2
  6. package/src/rules/detect-child-process/index.d.ts +18 -1
  7. package/src/rules/detect-child-process/index.js +5 -0
  8. package/src/rules/detect-eval-with-expression/index.d.ts +18 -1
  9. package/src/rules/detect-eval-with-expression/index.js +5 -0
  10. package/src/rules/detect-mixed-content/index.d.ts +6 -4
  11. package/src/rules/detect-mixed-content/index.js +7 -6
  12. package/src/rules/detect-non-literal-fs-filename/index.d.ts +18 -1
  13. package/src/rules/detect-non-literal-fs-filename/index.js +5 -0
  14. package/src/rules/detect-non-literal-regexp/index.d.ts +18 -1
  15. package/src/rules/detect-non-literal-regexp/index.js +5 -0
  16. package/src/rules/detect-object-injection/index.d.ts +23 -1
  17. package/src/rules/detect-object-injection/index.js +5 -0
  18. package/src/rules/detect-suspicious-dependencies/index.d.ts +6 -4
  19. package/src/rules/detect-suspicious-dependencies/index.js +7 -2
  20. package/src/rules/detect-weak-password-validation/index.d.ts +6 -2
  21. package/src/rules/detect-weak-password-validation/index.js +6 -1
  22. package/src/rules/no-allow-arbitrary-loads/index.d.ts +6 -4
  23. package/src/rules/no-allow-arbitrary-loads/index.js +7 -6
  24. package/src/rules/no-arbitrary-file-access/index.d.ts +6 -9
  25. package/src/rules/no-arbitrary-file-access/index.js +7 -2
  26. package/src/rules/no-buffer-overread/index.d.ts +10 -2
  27. package/src/rules/no-buffer-overread/index.js +5 -0
  28. package/src/rules/no-clickjacking/index.d.ts +25 -1
  29. package/src/rules/no-clickjacking/index.js +5 -0
  30. package/src/rules/no-client-side-auth-logic/index.d.ts +6 -2
  31. package/src/rules/no-client-side-auth-logic/index.js +6 -1
  32. package/src/rules/no-credentials-in-query-params/index.d.ts +6 -4
  33. package/src/rules/no-credentials-in-query-params/index.js +7 -2
  34. package/src/rules/no-data-in-temp-storage/index.d.ts +6 -2
  35. package/src/rules/no-data-in-temp-storage/index.js +6 -1
  36. package/src/rules/no-debug-code-in-production/index.d.ts +6 -4
  37. package/src/rules/no-debug-code-in-production/index.js +10 -7
  38. package/src/rules/no-directive-injection/index.d.ts +25 -1
  39. package/src/rules/no-directive-injection/index.js +5 -0
  40. package/src/rules/no-disabled-certificate-validation/index.d.ts +6 -2
  41. package/src/rules/no-disabled-certificate-validation/index.js +6 -1
  42. package/src/rules/no-dynamic-dependency-loading/index.d.ts +6 -4
  43. package/src/rules/no-dynamic-dependency-loading/index.js +10 -7
  44. package/src/rules/no-electron-security-issues/index.d.ts +25 -1
  45. package/src/rules/no-electron-security-issues/index.js +5 -0
  46. package/src/rules/no-exposed-debug-endpoints/index.d.ts +6 -2
  47. package/src/rules/no-exposed-debug-endpoints/index.js +6 -1
  48. package/src/rules/no-exposed-sensitive-data/index.d.ts +18 -1
  49. package/src/rules/no-exposed-sensitive-data/index.js +5 -0
  50. package/src/rules/no-format-string-injection/index.d.ts +26 -1
  51. package/src/rules/no-format-string-injection/index.js +5 -0
  52. package/src/rules/no-graphql-injection/index.d.ts +27 -1
  53. package/src/rules/no-graphql-injection/index.js +5 -0
  54. package/src/rules/no-hardcoded-credentials/index.d.ts +17 -1
  55. package/src/rules/no-hardcoded-credentials/index.js +5 -0
  56. package/src/rules/no-hardcoded-session-tokens/index.d.ts +6 -2
  57. package/src/rules/no-hardcoded-session-tokens/index.js +6 -1
  58. package/src/rules/no-http-urls/index.d.ts +7 -4
  59. package/src/rules/no-http-urls/index.js +7 -2
  60. package/src/rules/no-improper-sanitization/index.d.ts +25 -1
  61. package/src/rules/no-improper-sanitization/index.js +5 -0
  62. package/src/rules/no-improper-type-validation/index.d.ts +25 -1
  63. package/src/rules/no-improper-type-validation/index.js +5 -0
  64. package/src/rules/no-insecure-comparison/index.d.ts +18 -1
  65. package/src/rules/no-insecure-comparison/index.js +5 -0
  66. package/src/rules/no-insecure-redirects/index.d.ts +18 -1
  67. package/src/rules/no-insecure-redirects/index.js +5 -0
  68. package/src/rules/no-insecure-websocket/index.d.ts +6 -2
  69. package/src/rules/no-insecure-websocket/index.js +6 -1
  70. package/src/rules/no-ldap-injection/index.d.ts +28 -1
  71. package/src/rules/no-ldap-injection/index.js +5 -0
  72. package/src/rules/no-missing-authentication/index.d.ts +18 -1
  73. package/src/rules/no-missing-authentication/index.js +5 -0
  74. package/src/rules/no-missing-cors-check/index.d.ts +18 -1
  75. package/src/rules/no-missing-cors-check/index.js +5 -0
  76. package/src/rules/no-missing-csrf-protection/index.d.ts +18 -1
  77. package/src/rules/no-missing-csrf-protection/index.js +5 -0
  78. package/src/rules/no-missing-security-headers/index.d.ts +18 -1
  79. package/src/rules/no-missing-security-headers/index.js +5 -0
  80. package/src/rules/no-password-in-url/index.d.ts +6 -4
  81. package/src/rules/no-password-in-url/index.js +7 -6
  82. package/src/rules/no-permissive-cors/index.d.ts +6 -4
  83. package/src/rules/no-permissive-cors/index.js +22 -13
  84. package/src/rules/no-pii-in-logs/index.d.ts +6 -4
  85. package/src/rules/no-pii-in-logs/index.js +15 -12
  86. package/src/rules/no-privilege-escalation/index.d.ts +18 -1
  87. package/src/rules/no-privilege-escalation/index.js +5 -0
  88. package/src/rules/no-redos-vulnerable-regex/index.d.ts +20 -1
  89. package/src/rules/no-redos-vulnerable-regex/index.js +5 -0
  90. package/src/rules/no-sensitive-data-exposure/index.d.ts +18 -1
  91. package/src/rules/no-sensitive-data-exposure/index.js +5 -0
  92. package/src/rules/no-sensitive-data-in-analytics/index.d.ts +6 -4
  93. package/src/rules/no-sensitive-data-in-analytics/index.js +15 -11
  94. package/src/rules/no-sensitive-data-in-cache/index.d.ts +6 -4
  95. package/src/rules/no-sensitive-data-in-cache/index.js +7 -6
  96. package/src/rules/no-toctou-vulnerability/index.d.ts +18 -1
  97. package/src/rules/no-toctou-vulnerability/index.js +5 -0
  98. package/src/rules/no-tracking-without-consent/index.d.ts +6 -2
  99. package/src/rules/no-tracking-without-consent/index.js +6 -1
  100. package/src/rules/no-unchecked-loop-condition/index.d.ts +25 -1
  101. package/src/rules/no-unchecked-loop-condition/index.js +5 -0
  102. package/src/rules/no-unencrypted-transmission/index.d.ts +18 -1
  103. package/src/rules/no-unencrypted-transmission/index.js +5 -0
  104. package/src/rules/no-unescaped-url-parameter/index.d.ts +18 -1
  105. package/src/rules/no-unescaped-url-parameter/index.js +5 -0
  106. package/src/rules/no-unlimited-resource-allocation/index.d.ts +25 -1
  107. package/src/rules/no-unlimited-resource-allocation/index.js +5 -0
  108. package/src/rules/no-unsafe-deserialization/index.d.ts +29 -1
  109. package/src/rules/no-unsafe-deserialization/index.js +5 -0
  110. package/src/rules/no-unsafe-dynamic-require/index.d.ts +13 -1
  111. package/src/rules/no-unsafe-dynamic-require/index.js +5 -0
  112. package/src/rules/no-unsafe-regex-construction/index.d.ts +20 -1
  113. package/src/rules/no-unsafe-regex-construction/index.js +5 -0
  114. package/src/rules/no-unvalidated-deeplinks/index.d.ts +6 -2
  115. package/src/rules/no-unvalidated-deeplinks/index.js +6 -1
  116. package/src/rules/no-unvalidated-user-input/index.d.ts +18 -1
  117. package/src/rules/no-unvalidated-user-input/index.js +5 -0
  118. package/src/rules/no-verbose-error-messages/index.d.ts +6 -4
  119. package/src/rules/no-verbose-error-messages/index.js +7 -2
  120. package/src/rules/no-weak-password-recovery/index.d.ts +25 -1
  121. package/src/rules/no-weak-password-recovery/index.js +5 -0
  122. package/src/rules/no-xpath-injection/index.d.ts +28 -1
  123. package/src/rules/no-xpath-injection/index.js +5 -0
  124. package/src/rules/no-xxe-injection/index.d.ts +28 -1
  125. package/src/rules/no-xxe-injection/index.js +5 -0
  126. package/src/rules/no-zip-slip/index.d.ts +25 -1
  127. package/src/rules/no-zip-slip/index.js +5 -0
  128. package/src/rules/require-backend-authorization/index.d.ts +6 -2
  129. package/src/rules/require-backend-authorization/index.js +6 -1
  130. package/src/rules/require-code-minification/index.d.ts +6 -4
  131. package/src/rules/require-code-minification/index.js +7 -6
  132. package/src/rules/require-csp-headers/index.d.ts +6 -2
  133. package/src/rules/require-csp-headers/index.js +6 -1
  134. package/src/rules/require-data-minimization/index.d.ts +6 -4
  135. package/src/rules/require-data-minimization/index.js +9 -7
  136. package/src/rules/require-dependency-integrity/index.d.ts +6 -2
  137. package/src/rules/require-dependency-integrity/index.js +6 -1
  138. package/src/rules/require-https-only/index.d.ts +6 -4
  139. package/src/rules/require-https-only/index.js +24 -19
  140. package/src/rules/require-mime-type-validation/index.d.ts +6 -2
  141. package/src/rules/require-mime-type-validation/index.js +6 -1
  142. package/src/rules/require-network-timeout/index.d.ts +6 -4
  143. package/src/rules/require-network-timeout/index.js +18 -11
  144. package/src/rules/require-package-lock/index.d.ts +6 -4
  145. package/src/rules/require-package-lock/index.js +7 -6
  146. package/src/rules/require-secure-credential-storage/index.d.ts +6 -4
  147. package/src/rules/require-secure-credential-storage/index.js +12 -9
  148. package/src/rules/require-secure-defaults/index.d.ts +6 -4
  149. package/src/rules/require-secure-defaults/index.js +7 -6
  150. package/src/rules/require-secure-deletion/index.d.ts +6 -4
  151. package/src/rules/require-secure-deletion/index.js +7 -6
  152. package/src/rules/require-storage-encryption/index.d.ts +6 -4
  153. package/src/rules/require-storage-encryption/index.js +10 -7
  154. package/src/rules/require-url-validation/index.d.ts +6 -2
  155. package/src/rules/require-url-validation/index.js +6 -1
  156. package/src/types/index.d.ts +5 -0
  157. package/src/types/index.js +3 -12
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.noSensitiveDataInAnalytics = void 0;
2
9
  /**
3
10
  * @fileoverview Prevent PII sent to analytics
4
11
  * @see https://owasp.org/www-project-mobile-top-10/
5
12
  * @see https://cwe.mitre.org/data/definitions/359.html
6
13
  */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.noSensitiveDataInAnalytics = void 0;
9
14
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
10
15
  exports.noSensitiveDataInAnalytics = (0, eslint_devkit_1.createRule)({
11
16
  name: 'no-sensitive-data-in-analytics',
@@ -13,10 +18,6 @@ exports.noSensitiveDataInAnalytics = (0, eslint_devkit_1.createRule)({
13
18
  type: 'problem',
14
19
  docs: {
15
20
  description: 'Prevent PII being sent to analytics services',
16
- category: 'Security',
17
- recommended: true,
18
- owaspMobile: ['M6'],
19
- cweIds: ['CWE-359'],
20
21
  },
21
22
  messages: {
22
23
  violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
@@ -40,15 +41,18 @@ exports.noSensitiveDataInAnalytics = (0, eslint_devkit_1.createRule)({
40
41
  return {
41
42
  CallExpression(node) {
42
43
  // analytics.track() with sensitive data
43
- if (node.callee.type === 'MemberExpression' &&
44
+ if (node.callee.type === eslint_devkit_1.AST_NODE_TYPES.MemberExpression &&
45
+ node.callee.object.type === eslint_devkit_1.AST_NODE_TYPES.Identifier &&
44
46
  node.callee.object.name === 'analytics' &&
47
+ node.callee.property.type === eslint_devkit_1.AST_NODE_TYPES.Identifier &&
45
48
  node.callee.property.name === 'track') {
46
49
  const dataArg = node.arguments[1];
47
- if (dataArg?.type === 'ObjectExpression') {
50
+ if (dataArg?.type === eslint_devkit_1.AST_NODE_TYPES.ObjectExpression) {
48
51
  dataArg.properties.forEach(prop => {
49
- if (prop.type === 'Property') {
50
- const key = prop.key.name?.toLowerCase();
51
- const matchedField = sensitiveFields.find(f => key?.includes(f));
52
+ if (prop.type === eslint_devkit_1.AST_NODE_TYPES.Property &&
53
+ prop.key.type === eslint_devkit_1.AST_NODE_TYPES.Identifier) {
54
+ const key = prop.key.name.toLowerCase();
55
+ const matchedField = sensitiveFields.find(f => key.includes(f));
52
56
  if (matchedField) {
53
57
  report(prop, matchedField);
54
58
  }
@@ -1,8 +1,10 @@
1
1
  /**
2
- * @fileoverview Prevent caching sensitive data without encryption
3
- * @see https://owasp.org/www-project-mobile-top-10/
4
- * @see https://cwe.mitre.org/data/definitions/524.html
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
5
  */
6
6
  export interface Options {
7
7
  }
8
- export declare const noSensitiveDataInCache: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
8
+ type RuleOptions = [Options?];
9
+ export declare const noSensitiveDataInCache: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
10
+ export {};
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.noSensitiveDataInCache = void 0;
2
9
  /**
3
10
  * @fileoverview Prevent caching sensitive data without encryption
4
11
  * @see https://owasp.org/www-project-mobile-top-10/
5
12
  * @see https://cwe.mitre.org/data/definitions/524.html
6
13
  */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.noSensitiveDataInCache = void 0;
9
14
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
10
15
  exports.noSensitiveDataInCache = (0, eslint_devkit_1.createRule)({
11
16
  name: 'no-sensitive-data-in-cache',
@@ -13,10 +18,6 @@ exports.noSensitiveDataInCache = (0, eslint_devkit_1.createRule)({
13
18
  type: 'problem',
14
19
  docs: {
15
20
  description: 'Prevent caching sensitive data without encryption',
16
- category: 'Security',
17
- recommended: true,
18
- owaspMobile: ['M9'],
19
- cweIds: ["CWE-524"],
20
21
  },
21
22
  messages: {
22
23
  violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
@@ -1,7 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-toctou-vulnerability
8
+ * Detects Time-of-Check-Time-of-Use vulnerabilities
9
+ * CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
10
+ *
11
+ * @see https://cwe.mitre.org/data/definitions/367.html
12
+ * @see https://owasp.org/www-community/vulnerabilities/TOCTOU_Race_Condition
13
+ */
14
+ import type { TSESLint } from '@interlace/eslint-devkit';
15
+ type MessageIds = 'toctouVulnerability' | 'useAtomicOperations' | 'useFsPromises' | 'addProperLocking';
1
16
  export interface Options {
2
17
  /** Ignore in test files. Default: true */
3
18
  ignoreInTests?: boolean;
4
19
  /** File system methods to check. Default: ['fs.existsSync', 'fs.statSync', 'fs.accessSync'] */
5
20
  fsMethods?: string[];
6
21
  }
7
- export declare const noToctouVulnerability: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
22
+ type RuleOptions = [Options?];
23
+ export declare const noToctouVulnerability: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
24
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noToctouVulnerability = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,6 +1,10 @@
1
1
  /**
2
- * @fileoverview Require consent before tracking
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
3
5
  */
4
6
  export interface Options {
5
7
  }
6
- export declare const noTrackingWithoutConsent: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
8
+ type RuleOptions = [Options?];
9
+ export declare const noTrackingWithoutConsent: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
10
+ export {};
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
2
  /**
3
- * @fileoverview Require consent before tracking
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
4
6
  */
5
7
  Object.defineProperty(exports, "__esModule", { value: true });
6
8
  exports.noTrackingWithoutConsent = void 0;
9
+ /**
10
+ * @fileoverview Require consent before tracking
11
+ */
7
12
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
8
13
  exports.noTrackingWithoutConsent = (0, eslint_devkit_1.createRule)({
9
14
  name: 'no-tracking-without-consent',
@@ -1,4 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-unchecked-loop-condition
8
+ * Detects unchecked loop conditions that could cause DoS (CWE-400, CWE-606)
9
+ *
10
+ * Loops with unchecked conditions can cause denial of service by consuming
11
+ * excessive CPU time or memory. This includes infinite loops, loops with
12
+ * user-controlled bounds, and loops without proper termination conditions.
13
+ *
14
+ * False Positive Reduction:
15
+ * This rule uses security utilities to reduce false positives by detecting:
16
+ * - Safe loop patterns with clear termination
17
+ * - Development/debugging loops
18
+ * - JSDoc annotations (@safe-loop, @intentional)
19
+ * - Timeout protections
20
+ */
21
+ import type { TSESLint } from '@interlace/eslint-devkit';
1
22
  import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
23
+ type MessageIds = 'uncheckedLoopCondition' | 'infiniteLoop' | 'userControlledLoopBound' | 'missingLoopTermination' | 'largeLoopBound' | 'unsafeRecursion' | 'limitLoopIterations';
2
24
  export interface Options extends SecurityRuleOptions {
3
25
  /** Maximum allowed loop iterations for static analysis */
4
26
  maxStaticIterations?: number;
@@ -9,4 +31,6 @@ export interface Options extends SecurityRuleOptions {
9
31
  /** Maximum recursion depth to allow */
10
32
  maxRecursionDepth?: number;
11
33
  }
12
- export declare const noUncheckedLoopCondition: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
34
+ type RuleOptions = [Options?];
35
+ export declare const noUncheckedLoopCondition: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
36
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noUncheckedLoopCondition = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-unencrypted-transmission
8
+ * Detects unencrypted data transmission (HTTP vs HTTPS, plain text protocols)
9
+ * CWE-319: Cleartext Transmission of Sensitive Information
10
+ *
11
+ * @see https://cwe.mitre.org/data/definitions/319.html
12
+ * @see https://owasp.org/www-community/vulnerabilities/Insecure_Transport
13
+ */
14
+ import type { TSESLint } from '@interlace/eslint-devkit';
15
+ type MessageIds = 'unencryptedTransmission' | 'useHttps';
1
16
  export interface Options {
2
17
  /** Allow unencrypted transmission in test files. Default: false */
3
18
  allowInTests?: boolean;
@@ -8,4 +23,6 @@ export interface Options {
8
23
  /** Additional safe patterns to ignore. Default: [] */
9
24
  ignorePatterns?: string[];
10
25
  }
11
- export declare const noUnencryptedTransmission: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
26
+ type RuleOptions = [Options?];
27
+ export declare const noUnencryptedTransmission: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
28
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noUnencryptedTransmission = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-unescaped-url-parameter
8
+ * Detects unescaped URL parameters
9
+ * CWE-79: Cross-site Scripting (XSS)
10
+ *
11
+ * @see https://cwe.mitre.org/data/definitions/79.html
12
+ * @see https://owasp.org/www-community/attacks/xss/
13
+ */
14
+ import type { TSESLint } from '@interlace/eslint-devkit';
15
+ type MessageIds = 'unescapedUrlParameter' | 'useEncodeURIComponent' | 'useURLSearchParams';
1
16
  export interface Options {
2
17
  /** Allow unescaped URL parameters in test files. Default: false */
3
18
  allowInTests?: boolean;
@@ -6,4 +21,6 @@ export interface Options {
6
21
  /** Additional safe patterns to ignore. Default: [] */
7
22
  ignorePatterns?: string[];
8
23
  }
9
- export declare const noUnescapedUrlParameter: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
24
+ type RuleOptions = [Options?];
25
+ export declare const noUnescapedUrlParameter: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
26
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noUnescapedUrlParameter = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,4 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-unlimited-resource-allocation
8
+ * Detects unlimited resource allocation vulnerabilities (CWE-770)
9
+ *
10
+ * Unlimited resource allocation can cause denial of service by exhausting
11
+ * system resources like memory, file handles, or network connections.
12
+ * This rule detects patterns where resources are allocated without limits.
13
+ *
14
+ * False Positive Reduction:
15
+ * This rule uses security utilities to reduce false positives by detecting:
16
+ * - Safe resource allocation patterns
17
+ * - Proper resource limits
18
+ * - JSDoc annotations (@limited-resource, @safe-allocation)
19
+ * - Resource cleanup patterns
20
+ */
21
+ import type { TSESLint } from '@interlace/eslint-devkit';
1
22
  import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
23
+ type MessageIds = 'unlimitedResourceAllocation' | 'unlimitedBufferAllocation' | 'unlimitedFileOperations' | 'unlimitedNetworkConnections' | 'unlimitedMemoryAllocation' | 'userControlledResourceSize' | 'missingResourceLimits' | 'resourceAllocationInLoop' | 'implementResourceLimits' | 'validateResourceSize' | 'useResourcePools' | 'strategyResourceManagement' | 'strategyRateLimiting' | 'strategyResourceCleanup';
2
24
  export interface Options extends SecurityRuleOptions {
3
25
  /** Maximum allowed resource size for static analysis */
4
26
  maxResourceSize?: number;
@@ -9,4 +31,6 @@ export interface Options extends SecurityRuleOptions {
9
31
  /** Require resource validation */
10
32
  requireResourceValidation?: boolean;
11
33
  }
12
- export declare const noUnlimitedResourceAllocation: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
34
+ type RuleOptions = [Options?];
35
+ export declare const noUnlimitedResourceAllocation: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
36
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noUnlimitedResourceAllocation = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,4 +1,30 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-unsafe-deserialization
8
+ * Detects unsafe deserialization of untrusted data (CWE-502)
9
+ *
10
+ * Unsafe deserialization occurs when untrusted data is deserialized in a way that
11
+ * allows attackers to execute arbitrary code or manipulate application logic.
12
+ * This includes:
13
+ * - Using dangerous deserialization libraries
14
+ * - eval() or Function() on untrusted data
15
+ * - YAML/XML parsers that can execute code
16
+ * - Unsafe use of serialization libraries
17
+ *
18
+ * False Positive Reduction:
19
+ * This rule uses security utilities to reduce false positives by detecting:
20
+ * - Safe deserialization patterns
21
+ * - Input validation and sanitization
22
+ * - JSDoc annotations (@safe, @validated)
23
+ * - Trusted deserialization libraries
24
+ */
25
+ import type { TSESLint } from '@interlace/eslint-devkit';
1
26
  import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
27
+ type MessageIds = 'unsafeDeserialization' | 'dangerousEvalUsage' | 'unsafeYamlParsing' | 'dangerousFunctionConstructor' | 'untrustedDeserializationInput' | 'useSafeDeserializer' | 'validateBeforeDeserialization' | 'avoidEval' | 'strategySafeLibraries' | 'strategyInputValidation' | 'strategySandboxing';
2
28
  export interface Options extends SecurityRuleOptions {
3
29
  /** Dangerous deserialization functions to detect */
4
30
  dangerousFunctions?: string[];
@@ -7,4 +33,6 @@ export interface Options extends SecurityRuleOptions {
7
33
  /** Functions that validate input before deserialization */
8
34
  validationFunctions?: string[];
9
35
  }
10
- export declare const noUnsafeDeserialization: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
36
+ type RuleOptions = [Options?];
37
+ export declare const noUnsafeDeserialization: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
38
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noUnsafeDeserialization = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,5 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-unsafe-dynamic-require
8
+ * Detects dynamic require() calls that could lead to code injection
9
+ */
10
+ import type { TSESLint } from '@interlace/eslint-devkit';
1
11
  export interface Options {
2
12
  /** Allow dynamic import() expressions. Default: false (stricter) */
3
13
  allowDynamicImport?: boolean;
4
14
  }
5
- export declare const noUnsafeDynamicRequire: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
15
+ type RuleOptions = [Options?];
16
+ export declare const noUnsafeDynamicRequire: TSESLint.RuleModule<"unsafeDynamicRequire", RuleOptions, unknown, TSESLint.RuleListener>;
17
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noUnsafeDynamicRequire = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,3 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-unsafe-regex-construction
8
+ * Detects unsafe regex construction patterns (user input without escaping, dynamic flags)
9
+ * CWE-400: Uncontrolled Resource Consumption
10
+ *
11
+ * Extends detect-non-literal-regexp with pattern analysis
12
+ *
13
+ * @see https://cwe.mitre.org/data/definitions/400.html
14
+ * @see https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
15
+ */
16
+ import type { TSESLint } from '@interlace/eslint-devkit';
17
+ type MessageIds = 'unsafeRegexConstruction' | 'escapeUserInput' | 'validatePattern' | 'useSafeLibrary' | 'avoidDynamicFlags';
1
18
  export interface Options {
2
19
  /** Allow literal string patterns. Default: false */
3
20
  allowLiterals?: boolean;
@@ -6,4 +23,6 @@ export interface Options {
6
23
  /** Maximum pattern length for dynamic regex. Default: 100 */
7
24
  maxPatternLength?: number;
8
25
  }
9
- export declare const noUnsafeRegexConstruction: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
26
+ type RuleOptions = [Options?];
27
+ export declare const noUnsafeRegexConstruction: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
28
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noUnsafeRegexConstruction = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,6 +1,10 @@
1
1
  /**
2
- * @fileoverview Require validation of deep link URLs
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
3
5
  */
4
6
  export interface Options {
5
7
  }
6
- export declare const noUnvalidatedDeeplinks: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
8
+ type RuleOptions = [Options?];
9
+ export declare const noUnvalidatedDeeplinks: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
10
+ export {};
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
2
  /**
3
- * @fileoverview Require validation of deep link URLs
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
4
6
  */
5
7
  Object.defineProperty(exports, "__esModule", { value: true });
6
8
  exports.noUnvalidatedDeeplinks = void 0;
9
+ /**
10
+ * @fileoverview Require validation of deep link URLs
11
+ */
7
12
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
8
13
  exports.noUnvalidatedDeeplinks = (0, eslint_devkit_1.createRule)({
9
14
  name: 'no-unvalidated-deeplinks',
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-unvalidated-user-input
8
+ * Detects unvalidated user input usage (req.body, req.query, etc.)
9
+ * CWE-20: Improper Input Validation
10
+ *
11
+ * @see https://cwe.mitre.org/data/definitions/20.html
12
+ * @see https://owasp.org/www-community/vulnerabilities/Improper_Input_Validation
13
+ */
14
+ import type { TSESLint } from '@interlace/eslint-devkit';
15
+ type MessageIds = 'unvalidatedInput' | 'useValidationLibrary' | 'useZod' | 'useJoi';
1
16
  export interface Options {
2
17
  /** Allow unvalidated input in test files. Default: false */
3
18
  allowInTests?: boolean;
@@ -6,4 +21,6 @@ export interface Options {
6
21
  /** Additional safe patterns to ignore. Default: ['^safe', '^sanitized', '^validated', '^clean'] (prefix patterns) */
7
22
  ignorePatterns?: string[];
8
23
  }
9
- export declare const noUnvalidatedUserInput: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
24
+ type RuleOptions = [Options?];
25
+ export declare const noUnvalidatedUserInput: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
26
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noUnvalidatedUserInput = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
@@ -1,8 +1,10 @@
1
1
  /**
2
- * @fileoverview Prevent exposing stack traces to users
3
- * @see https://owasp.org/www-project-mobile-top-10/
4
- * @see https://cwe.mitre.org/data/definitions/209.html
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
5
  */
6
6
  export interface Options {
7
7
  }
8
- export declare const noVerboseErrorMessages: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
8
+ type RuleOptions = [Options?];
9
+ export declare const noVerboseErrorMessages: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
10
+ export {};
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.noVerboseErrorMessages = void 0;
2
9
  /**
3
10
  * @fileoverview Prevent exposing stack traces to users
4
11
  * @see https://owasp.org/www-project-mobile-top-10/
5
12
  * @see https://cwe.mitre.org/data/definitions/209.html
6
13
  */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.noVerboseErrorMessages = void 0;
9
14
  const eslint_devkit_1 = require("@interlace/eslint-devkit");
10
15
  exports.noVerboseErrorMessages = (0, eslint_devkit_1.createRule)({
11
16
  name: 'no-verbose-error-messages',
@@ -1,4 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2025 Ofri Peretz
3
+ * Licensed under the MIT License. Use of this source code is governed by the
4
+ * MIT license that can be found in the LICENSE file.
5
+ */
6
+ /**
7
+ * ESLint Rule: no-weak-password-recovery
8
+ * Detects weak password recovery mechanisms (CWE-640)
9
+ *
10
+ * Weak password recovery mechanisms can allow attackers to reset passwords
11
+ * for other users, gain unauthorized access, or perform account takeover.
12
+ * This rule detects obvious vulnerabilities in password recovery logic.
13
+ *
14
+ * False Positive Reduction:
15
+ * This rule uses security utilities to reduce false positives by detecting:
16
+ * - Proper recovery implementations
17
+ * - Rate limiting mechanisms
18
+ * - Secure token generation
19
+ * - JSDoc annotations (@secure-recovery, @rate-limited)
20
+ */
21
+ import type { TSESLint } from '@interlace/eslint-devkit';
1
22
  import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
23
+ type MessageIds = 'weakPasswordRecovery' | 'missingRateLimit' | 'predictableRecoveryToken' | 'unlimitedRecoveryAttempts' | 'insufficientTokenEntropy' | 'missingTokenExpiration' | 'recoveryLoggingSensitiveData' | 'weakRecoveryVerification' | 'tokenReuseVulnerability' | 'implementRateLimiting' | 'useCryptographicallySecureTokens' | 'implementTokenExpiration' | 'secureRecoveryFlow' | 'strategyMultiFactor' | 'strategyOutOfBandVerification' | 'strategyTimeBoundTokens';
2
24
  export interface Options extends SecurityRuleOptions {
3
25
  /** Minimum token entropy bits */
4
26
  minTokenEntropy?: number;
@@ -9,4 +31,6 @@ export interface Options extends SecurityRuleOptions {
9
31
  /** Secure token generation functions */
10
32
  secureTokenFunctions?: string[];
11
33
  }
12
- export declare const noWeakPasswordRecovery: ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
34
+ type RuleOptions = [Options?];
35
+ export declare const noWeakPasswordRecovery: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener>;
36
+ export {};
@@ -1,4 +1,9 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025 Ofri Peretz
4
+ * Licensed under the MIT License. Use of this source code is governed by the
5
+ * MIT license that can be found in the LICENSE file.
6
+ */
2
7
  Object.defineProperty(exports, "__esModule", { value: true });
3
8
  exports.noWeakPasswordRecovery = void 0;
4
9
  const eslint_devkit_1 = require("@interlace/eslint-devkit");