eslint-plugin-browser-security 1.2.9 → 1.2.10

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 (97) hide show
  1. package/package.json +5 -22
  2. package/src/index.d.ts +17 -64
  3. package/src/index.js +1 -76
  4. package/src/oxlint.d.ts +17 -20
  5. package/src/oxlint.js +0 -18
  6. package/src/rules/detect-mixed-content/index.js +0 -10
  7. package/src/rules/no-allow-arbitrary-loads/index.js +0 -10
  8. package/src/rules/no-clickjacking/index.js +0 -37
  9. package/src/rules/no-client-side-auth-logic/index.js +0 -11
  10. package/src/rules/no-cookie-auth-tokens/index.js +0 -13
  11. package/src/rules/no-credentials-in-query-params/index.js +0 -10
  12. package/src/rules/no-disabled-certificate-validation/index.js +0 -10
  13. package/src/rules/no-dynamic-service-worker-url/index.js +0 -9
  14. package/src/rules/no-eval/index.js +1 -14
  15. package/src/rules/no-filereader-innerhtml/index.js +0 -23
  16. package/src/rules/no-http-urls/index.js +0 -13
  17. package/src/rules/no-innerhtml/index.js +0 -25
  18. package/src/rules/no-insecure-redirects/index.js +3 -39
  19. package/src/rules/no-insecure-websocket/index.js +0 -12
  20. package/src/rules/no-jwt-in-storage/index.js +19 -42
  21. package/src/rules/no-missing-cors-check/index.js +4 -57
  22. package/src/rules/no-missing-csrf-protection/index.js +0 -23
  23. package/src/rules/no-missing-security-headers/index.js +0 -29
  24. package/src/rules/no-password-in-url/index.js +0 -11
  25. package/src/rules/no-permissive-cors/index.js +0 -13
  26. package/src/rules/no-postmessage-innerhtml/index.js +0 -18
  27. package/src/rules/no-postmessage-wildcard-origin/index.js +0 -10
  28. package/src/rules/no-sensitive-cookie-js/index.js +0 -18
  29. package/src/rules/no-sensitive-data-in-analytics/index.js +0 -11
  30. package/src/rules/no-sensitive-data-in-cache/index.js +0 -10
  31. package/src/rules/no-sensitive-indexeddb/index.js +0 -8
  32. package/src/rules/no-sensitive-localstorage/index.js +0 -11
  33. package/src/rules/no-sensitive-sessionstorage/index.js +0 -9
  34. package/src/rules/no-tracking-without-consent/index.js +0 -10
  35. package/src/rules/no-unencrypted-transmission/index.js +0 -32
  36. package/src/rules/no-unescaped-url-parameter/index.js +5 -47
  37. package/src/rules/no-unsafe-eval-csp/index.js +0 -10
  38. package/src/rules/no-unsafe-inline-csp/index.js +0 -10
  39. package/src/rules/no-unvalidated-deeplinks/index.js +0 -11
  40. package/src/rules/no-websocket-eval/index.js +0 -26
  41. package/src/rules/no-websocket-innerhtml/index.js +0 -20
  42. package/src/rules/no-worker-message-innerhtml/index.js +0 -23
  43. package/src/rules/require-blob-url-revocation/index.js +0 -10
  44. package/src/rules/require-cookie-secure-attrs/index.js +0 -7
  45. package/src/rules/require-csp-headers/index.js +0 -13
  46. package/src/rules/require-https-only/index.js +0 -13
  47. package/src/rules/require-mime-type-validation/index.js +0 -13
  48. package/src/rules/require-postmessage-origin-check/index.js +0 -17
  49. package/src/rules/require-url-validation/index.js +0 -12
  50. package/src/rules/require-websocket-wss/index.js +0 -17
  51. package/AGENTS.md +0 -97
  52. package/CHANGELOG.md +0 -188
  53. package/src/rules/detect-mixed-content/index.d.ts +0 -12
  54. package/src/rules/no-allow-arbitrary-loads/index.d.ts +0 -12
  55. package/src/rules/no-clickjacking/index.d.ts +0 -36
  56. package/src/rules/no-client-side-auth-logic/index.d.ts +0 -12
  57. package/src/rules/no-cookie-auth-tokens/index.d.ts +0 -23
  58. package/src/rules/no-credentials-in-query-params/index.d.ts +0 -12
  59. package/src/rules/no-disabled-certificate-validation/index.d.ts +0 -12
  60. package/src/rules/no-dynamic-service-worker-url/index.d.ts +0 -23
  61. package/src/rules/no-eval/index.d.ts +0 -26
  62. package/src/rules/no-filereader-innerhtml/index.d.ts +0 -24
  63. package/src/rules/no-http-urls/index.d.ts +0 -17
  64. package/src/rules/no-innerhtml/index.d.ts +0 -28
  65. package/src/rules/no-insecure-redirects/index.d.ts +0 -26
  66. package/src/rules/no-insecure-websocket/index.d.ts +0 -12
  67. package/src/rules/no-jwt-in-storage/index.d.ts +0 -24
  68. package/src/rules/no-missing-cors-check/index.d.ts +0 -28
  69. package/src/rules/no-missing-csrf-protection/index.d.ts +0 -30
  70. package/src/rules/no-missing-security-headers/index.d.ts +0 -26
  71. package/src/rules/no-password-in-url/index.d.ts +0 -12
  72. package/src/rules/no-permissive-cors/index.d.ts +0 -12
  73. package/src/rules/no-postmessage-innerhtml/index.d.ts +0 -24
  74. package/src/rules/no-postmessage-wildcard-origin/index.d.ts +0 -24
  75. package/src/rules/no-sensitive-cookie-js/index.d.ts +0 -26
  76. package/src/rules/no-sensitive-data-in-analytics/index.d.ts +0 -12
  77. package/src/rules/no-sensitive-data-in-cache/index.d.ts +0 -12
  78. package/src/rules/no-sensitive-indexeddb/index.d.ts +0 -23
  79. package/src/rules/no-sensitive-localstorage/index.d.ts +0 -28
  80. package/src/rules/no-sensitive-sessionstorage/index.d.ts +0 -25
  81. package/src/rules/no-tracking-without-consent/index.d.ts +0 -12
  82. package/src/rules/no-unencrypted-transmission/index.d.ts +0 -30
  83. package/src/rules/no-unescaped-url-parameter/index.d.ts +0 -28
  84. package/src/rules/no-unsafe-eval-csp/index.d.ts +0 -24
  85. package/src/rules/no-unsafe-inline-csp/index.d.ts +0 -24
  86. package/src/rules/no-unvalidated-deeplinks/index.d.ts +0 -12
  87. package/src/rules/no-websocket-eval/index.d.ts +0 -24
  88. package/src/rules/no-websocket-innerhtml/index.d.ts +0 -24
  89. package/src/rules/no-worker-message-innerhtml/index.d.ts +0 -24
  90. package/src/rules/require-blob-url-revocation/index.d.ts +0 -24
  91. package/src/rules/require-cookie-secure-attrs/index.d.ts +0 -23
  92. package/src/rules/require-csp-headers/index.d.ts +0 -12
  93. package/src/rules/require-https-only/index.d.ts +0 -12
  94. package/src/rules/require-mime-type-validation/index.d.ts +0 -12
  95. package/src/rules/require-postmessage-origin-check/index.d.ts +0 -26
  96. package/src/rules/require-url-validation/index.d.ts +0 -12
  97. package/src/rules/require-websocket-wss/index.d.ts +0 -26
@@ -1,30 +0,0 @@
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-missing-csrf-protection
8
- * Detects missing CSRF token validation in POST/PUT/DELETE requests
9
- * CWE-352: Cross-Site Request Forgery (CSRF)
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/352.html
12
- * @see https://owasp.org/www-community/attacks/csrf
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'missingCsrfProtection' | 'addCsrfValidation';
16
- export interface Options {
17
- /** Allow missing CSRF protection in test files. Default: false */
18
- allowInTests?: boolean;
19
- /** CSRF middleware patterns to recognize. Default: ['csrf', 'csurf', 'csrfProtection', 'verifyCsrfToken'] */
20
- csrfMiddlewarePatterns?: string[];
21
- /** HTTP methods that require CSRF protection. Default: ['post', 'put', 'delete', 'patch'] */
22
- protectedMethods?: string[];
23
- /** Additional safe patterns to ignore. Default: [] */
24
- ignorePatterns?: string[];
25
- }
26
- type RuleOptions = [Options?];
27
- export declare const noMissingCsrfProtection: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
28
- name: string;
29
- };
30
- export {};
@@ -1,26 +0,0 @@
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-missing-security-headers
8
- * Detects missing security headers in HTTP responses
9
- * CWE-693: Protection Mechanism Failure
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/693.html
12
- * @see https://owasp.org/www-project-secure-headers/
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'missingSecurityHeader' | 'addSecurityHeaders' | 'useMiddleware' | 'setHeader';
16
- export interface Options {
17
- /** Required security headers. Default: ['Content-Security-Policy', 'X-Frame-Options', 'X-Content-Type-Options'] */
18
- requiredHeaders?: string[];
19
- /** Ignore in test files. Default: true */
20
- ignoreInTests?: boolean;
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noMissingSecurityHeaders: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
8
- type RuleOptions = [Options?];
9
- export declare const noPasswordInUrl: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
10
- name: string;
11
- };
12
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
8
- type RuleOptions = [Options?];
9
- export declare const noPermissiveCors: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
10
- name: string;
11
- };
12
- export {};
@@ -1,24 +0,0 @@
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-postmessage-innerhtml
8
- * Detects unsafe innerHTML usage in postMessage handlers
9
- * CWE-79: Improper Neutralization of Input During Web Page Generation
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/79.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#security_concerns
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'unsafeInnerhtml' | 'useTextContent';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noPostmessageInnerhtml: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,24 +0,0 @@
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-postmessage-wildcard-origin
8
- * Detects postMessage calls with wildcard (*) targetOrigin
9
- * CWE-346: Origin Validation Error
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/346.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#security_concerns
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'wildcardOrigin' | 'specifyOrigin';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noPostmessageWildcardOrigin: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,26 +0,0 @@
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-sensitive-cookie-js
8
- * Detects storing sensitive data (tokens, passwords) in cookies via JavaScript
9
- * CWE-1004: Sensitive Cookie Without 'HttpOnly' Flag
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/1004.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#security
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'sensitiveCookieJs' | 'useHttpOnlyCookie';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- /** Sensitive key patterns to detect. Default includes common token/password patterns */
20
- sensitivePatterns?: string[];
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const noSensitiveCookieJs: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
8
- type RuleOptions = [Options?];
9
- export declare const noSensitiveDataInAnalytics: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
10
- name: string;
11
- };
12
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
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
- name: string;
11
- };
12
- export {};
@@ -1,23 +0,0 @@
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-sensitive-indexeddb
8
- * Detects storing sensitive data in IndexedDB
9
- * CWE-922: Insecure Storage of Sensitive Information
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/922.html
12
- */
13
- import type { TSESLint } from '@interlace/eslint-devkit';
14
- type MessageIds = 'sensitiveInIndexedDB' | 'useEncryption';
15
- export interface Options {
16
- /** Allow in test files. Default: true */
17
- allowInTests?: boolean;
18
- }
19
- type RuleOptions = [Options?];
20
- export declare const noSensitiveIndexeddb: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
21
- name: string;
22
- };
23
- export {};
@@ -1,28 +0,0 @@
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-sensitive-localstorage
8
- * Detects storing sensitive data (tokens, passwords, keys) in localStorage
9
- * CWE-922: Insecure Storage of Sensitive Information
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/922.html
12
- * @see https://owasp.org/www-community/vulnerabilities/Insecure_Storage
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'sensitiveLocalStorage' | 'useHttpOnlyCookie';
16
- export interface Options {
17
- /** Allow in test files. Default: false */
18
- allowInTests?: boolean;
19
- /** Sensitive key patterns to detect. Default includes common token/password patterns */
20
- sensitivePatterns?: string[];
21
- /** Also check sessionStorage. Default: true */
22
- checkSessionStorage?: boolean;
23
- }
24
- type RuleOptions = [Options?];
25
- export declare const noSensitiveLocalstorage: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
26
- name: string;
27
- };
28
- export {};
@@ -1,25 +0,0 @@
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-sensitive-sessionstorage
8
- * Detects storing sensitive data in sessionStorage
9
- * CWE-922: Insecure Storage of Sensitive Information
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/922.html
12
- */
13
- import type { TSESLint } from '@interlace/eslint-devkit';
14
- type MessageIds = 'sensitiveInSessionStorage' | 'useSecureStorage';
15
- export interface Options {
16
- /** Allow in test files. Default: true */
17
- allowInTests?: boolean;
18
- /** Additional sensitive key patterns */
19
- additionalPatterns?: string[];
20
- }
21
- type RuleOptions = [Options?];
22
- export declare const noSensitiveSessionstorage: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
23
- name: string;
24
- };
25
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
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
- name: string;
11
- };
12
- export {};
@@ -1,30 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow unencrypted transmission in test files. Default: false */
18
- allowInTests?: boolean;
19
- /** Insecure protocol patterns. Default: ['http://', 'ws://', 'ftp://', 'tcp://', 'mongodb://', 'redis://', 'mysql://'] */
20
- insecureProtocols?: string[];
21
- /** Secure protocol alternatives mapping. Default: { 'http://': 'https://', 'ws://': 'wss://', ... } */
22
- secureAlternatives?: Record<string, string>;
23
- /** Additional safe patterns to ignore. Default: [] */
24
- ignorePatterns?: string[];
25
- }
26
- type RuleOptions = [Options?];
27
- export declare const noUnencryptedTransmission: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
28
- name: string;
29
- };
30
- export {};
@@ -1,28 +0,0 @@
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';
16
- export interface Options {
17
- /** Allow unescaped URL parameters in test files. Default: false */
18
- allowInTests?: boolean;
19
- /** Trusted URL construction libraries. Default: ['url', 'querystring'] */
20
- trustedLibraries?: string[];
21
- /** Additional safe patterns to ignore. Default: [] */
22
- ignorePatterns?: string[];
23
- }
24
- type RuleOptions = [Options?];
25
- export declare const noUnescapedUrlParameter: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
26
- name: string;
27
- };
28
- export {};
@@ -1,24 +0,0 @@
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-eval-csp
8
- * Detects 'unsafe-eval' in Content Security Policy directives
9
- * CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/95.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'unsafeEval' | 'removeUnsafeEval';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noUnsafeEvalCsp: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,24 +0,0 @@
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-inline-csp
8
- * Detects 'unsafe-inline' in Content Security Policy directives
9
- * CWE-79: Improper Neutralization of Input During Web Page Generation
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/79.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'unsafeInline' | 'useNonceOrHash';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noUnsafeInlineCsp: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
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
- name: string;
11
- };
12
- export {};
@@ -1,24 +0,0 @@
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-websocket-eval
8
- * Detects dangerous eval() usage with WebSocket message data
9
- * CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/95.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'evalWithWsData' | 'parseDataSafely';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noWebsocketEval: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,24 +0,0 @@
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-websocket-innerhtml
8
- * Detects unsafe innerHTML usage with WebSocket message data
9
- * CWE-79: Improper Neutralization of Input During Web Page Generation
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/79.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'unsafeInnerhtml' | 'useTextContent';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noWebsocketInnerhtml: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,24 +0,0 @@
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-worker-message-innerhtml
8
- * Detects unsafe innerHTML usage with Web Worker message data
9
- * CWE-79: Improper Neutralization of Input During Web Page Generation
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/79.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Worker
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'workerInnerhtml' | 'sanitizeWorkerData';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const noWorkerMessageInnerhtml: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,24 +0,0 @@
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: require-blob-url-revocation
8
- * Detects Blob URLs that are not revoked, preventing memory leaks
9
- * CWE-401: Missing Release of Memory after Effective Lifetime
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/401.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'missingRevoke' | 'addRevocation';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- }
20
- type RuleOptions = [Options?];
21
- export declare const requireBlobUrlRevocation: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
22
- name: string;
23
- };
24
- export {};
@@ -1,23 +0,0 @@
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: require-cookie-secure-attrs
8
- * Requires Secure and SameSite attributes when setting cookies
9
- * CWE-614: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/614.html
12
- */
13
- import type { TSESLint } from '@interlace/eslint-devkit';
14
- type MessageIds = 'missingSecure' | 'missingSameSite' | 'addSecureAttrs';
15
- export interface Options {
16
- /** Allow in test files. Default: true */
17
- allowInTests?: boolean;
18
- }
19
- type RuleOptions = [Options?];
20
- export declare const requireCookieSecureAttrs: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
21
- name: string;
22
- };
23
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
8
- type RuleOptions = [Options?];
9
- export declare const requireCspHeaders: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
10
- name: string;
11
- };
12
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
8
- type RuleOptions = [Options?];
9
- export declare const requireHttpsOnly: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
10
- name: string;
11
- };
12
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
8
- type RuleOptions = [Options?];
9
- export declare const requireMimeTypeValidation: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
10
- name: string;
11
- };
12
- export {};
@@ -1,26 +0,0 @@
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: require-postmessage-origin-check
8
- * Detects postMessage listeners without origin validation
9
- * CWE-346: Origin Validation Error
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/346.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#security_concerns
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'missingOriginCheck' | 'addOriginCheck';
16
- export interface Options {
17
- /** Allow in test files. Default: false */
18
- allowInTests?: boolean;
19
- /** Trusted origins that satisfy the check. Default: [] */
20
- trustedOrigins?: string[];
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const requirePostmessageOriginCheck: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};
@@ -1,12 +0,0 @@
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
- export interface Options {
7
- }
8
- type RuleOptions = [Options?];
9
- export declare const requireUrlValidation: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
10
- name: string;
11
- };
12
- export {};
@@ -1,26 +0,0 @@
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: require-websocket-wss
8
- * Requires secure WebSocket connections (wss://) instead of unencrypted (ws://)
9
- * CWE-319: Cleartext Transmission of Sensitive Information
10
- *
11
- * @see https://cwe.mitre.org/data/definitions/319.html
12
- * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
13
- */
14
- import type { TSESLint } from '@interlace/eslint-devkit';
15
- type MessageIds = 'insecureWebsocket' | 'useWss';
16
- export interface Options {
17
- /** Allow in test files. Default: true */
18
- allowInTests?: boolean;
19
- /** Allow localhost/127.0.0.1 connections. Default: true */
20
- allowLocalhost?: boolean;
21
- }
22
- type RuleOptions = [Options?];
23
- export declare const requireWebsocketWss: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
24
- name: string;
25
- };
26
- export {};