eslint-plugin-secure-coding 3.0.0 → 3.0.2
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.
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +1 -1
- package/README.md +90 -422
- package/package.json +6 -5
- package/src/index.d.ts +5 -14
- package/src/index.js +36 -265
- package/src/rules/detect-non-literal-regexp/index.d.ts +20 -1
- package/src/rules/detect-non-literal-regexp/index.js +5 -0
- package/src/rules/detect-object-injection/index.d.ts +25 -1
- package/src/rules/detect-object-injection/index.js +5 -0
- package/src/rules/detect-weak-password-validation/index.d.ts +8 -2
- package/src/rules/detect-weak-password-validation/index.js +6 -1
- package/src/rules/no-directive-injection/index.d.ts +27 -1
- package/src/rules/no-directive-injection/index.js +5 -0
- package/src/rules/no-electron-security-issues/index.d.ts +27 -1
- package/src/rules/no-electron-security-issues/index.js +5 -0
- package/src/rules/no-format-string-injection/index.d.ts +28 -1
- package/src/rules/no-format-string-injection/index.js +5 -0
- package/src/rules/no-graphql-injection/index.d.ts +29 -1
- package/src/rules/no-graphql-injection/index.js +5 -0
- package/src/rules/no-hardcoded-credentials/index.d.ts +19 -1
- package/src/rules/no-hardcoded-credentials/index.js +5 -0
- package/src/rules/no-hardcoded-session-tokens/index.d.ts +8 -2
- package/src/rules/no-hardcoded-session-tokens/index.js +6 -1
- package/src/rules/no-improper-sanitization/index.d.ts +27 -1
- package/src/rules/no-improper-sanitization/index.js +5 -0
- package/src/rules/no-improper-type-validation/index.d.ts +27 -1
- package/src/rules/no-improper-type-validation/index.js +5 -0
- package/src/rules/no-insecure-comparison/index.d.ts +20 -1
- package/src/rules/no-insecure-comparison/index.js +5 -0
- package/src/rules/no-ldap-injection/index.d.ts +30 -1
- package/src/rules/no-ldap-injection/index.js +5 -0
- package/src/rules/no-missing-authentication/index.d.ts +20 -1
- package/src/rules/no-missing-authentication/index.js +5 -1
- package/src/rules/no-pii-in-logs/index.d.ts +8 -4
- package/src/rules/no-pii-in-logs/index.js +15 -12
- package/src/rules/no-privilege-escalation/index.d.ts +20 -1
- package/src/rules/no-privilege-escalation/index.js +5 -0
- package/src/rules/no-redos-vulnerable-regex/index.d.ts +22 -1
- package/src/rules/no-redos-vulnerable-regex/index.js +5 -0
- package/src/rules/no-sensitive-data-exposure/index.d.ts +20 -1
- package/src/rules/no-sensitive-data-exposure/index.js +5 -0
- package/src/rules/no-unchecked-loop-condition/index.d.ts +27 -1
- package/src/rules/no-unchecked-loop-condition/index.js +5 -0
- package/src/rules/no-unlimited-resource-allocation/index.d.ts +27 -1
- package/src/rules/no-unlimited-resource-allocation/index.js +5 -0
- package/src/rules/no-unsafe-deserialization/index.d.ts +31 -1
- package/src/rules/no-unsafe-deserialization/index.js +5 -0
- package/src/rules/no-unsafe-regex-construction/index.d.ts +22 -1
- package/src/rules/no-unsafe-regex-construction/index.js +5 -0
- package/src/rules/no-weak-password-recovery/index.d.ts +27 -1
- package/src/rules/no-weak-password-recovery/index.js +5 -0
- package/src/rules/no-xpath-injection/index.d.ts +30 -1
- package/src/rules/no-xpath-injection/index.js +5 -0
- package/src/rules/no-xxe-injection/index.d.ts +30 -1
- package/src/rules/no-xxe-injection/index.js +5 -0
- package/src/rules/require-backend-authorization/index.d.ts +8 -2
- package/src/rules/require-backend-authorization/index.js +6 -1
- package/src/rules/require-secure-defaults/index.d.ts +8 -4
- package/src/rules/require-secure-defaults/index.js +7 -6
- package/src/types/index.d.ts +10 -52
- package/src/types/index.js +3 -12
- package/src/rules/detect-child-process/index.d.ts +0 -11
- package/src/rules/detect-child-process/index.js +0 -529
- package/src/rules/detect-eval-with-expression/index.d.ts +0 -9
- package/src/rules/detect-eval-with-expression/index.js +0 -392
- package/src/rules/detect-mixed-content/index.d.ts +0 -8
- package/src/rules/detect-mixed-content/index.js +0 -44
- package/src/rules/detect-non-literal-fs-filename/index.d.ts +0 -7
- package/src/rules/detect-non-literal-fs-filename/index.js +0 -454
- package/src/rules/detect-suspicious-dependencies/index.d.ts +0 -8
- package/src/rules/detect-suspicious-dependencies/index.js +0 -71
- package/src/rules/no-allow-arbitrary-loads/index.d.ts +0 -8
- package/src/rules/no-allow-arbitrary-loads/index.js +0 -47
- package/src/rules/no-arbitrary-file-access/index.d.ts +0 -13
- package/src/rules/no-arbitrary-file-access/index.js +0 -195
- package/src/rules/no-buffer-overread/index.d.ts +0 -29
- package/src/rules/no-buffer-overread/index.js +0 -606
- package/src/rules/no-clickjacking/index.d.ts +0 -10
- package/src/rules/no-clickjacking/index.js +0 -396
- package/src/rules/no-client-side-auth-logic/index.d.ts +0 -6
- package/src/rules/no-client-side-auth-logic/index.js +0 -69
- package/src/rules/no-credentials-in-query-params/index.d.ts +0 -8
- package/src/rules/no-credentials-in-query-params/index.js +0 -57
- package/src/rules/no-data-in-temp-storage/index.d.ts +0 -6
- package/src/rules/no-data-in-temp-storage/index.js +0 -64
- package/src/rules/no-debug-code-in-production/index.d.ts +0 -8
- package/src/rules/no-debug-code-in-production/index.js +0 -51
- package/src/rules/no-disabled-certificate-validation/index.d.ts +0 -6
- package/src/rules/no-disabled-certificate-validation/index.js +0 -61
- package/src/rules/no-dynamic-dependency-loading/index.d.ts +0 -8
- package/src/rules/no-dynamic-dependency-loading/index.js +0 -51
- package/src/rules/no-exposed-debug-endpoints/index.d.ts +0 -6
- package/src/rules/no-exposed-debug-endpoints/index.js +0 -62
- package/src/rules/no-exposed-sensitive-data/index.d.ts +0 -11
- package/src/rules/no-exposed-sensitive-data/index.js +0 -340
- package/src/rules/no-http-urls/index.d.ts +0 -12
- package/src/rules/no-http-urls/index.js +0 -114
- package/src/rules/no-insecure-redirects/index.d.ts +0 -7
- package/src/rules/no-insecure-redirects/index.js +0 -216
- package/src/rules/no-insecure-websocket/index.d.ts +0 -6
- package/src/rules/no-insecure-websocket/index.js +0 -61
- package/src/rules/no-missing-cors-check/index.d.ts +0 -9
- package/src/rules/no-missing-cors-check/index.js +0 -399
- package/src/rules/no-missing-csrf-protection/index.d.ts +0 -11
- package/src/rules/no-missing-csrf-protection/index.js +0 -180
- package/src/rules/no-missing-security-headers/index.d.ts +0 -7
- package/src/rules/no-missing-security-headers/index.js +0 -218
- package/src/rules/no-password-in-url/index.d.ts +0 -8
- package/src/rules/no-password-in-url/index.js +0 -54
- package/src/rules/no-permissive-cors/index.d.ts +0 -8
- package/src/rules/no-permissive-cors/index.js +0 -65
- package/src/rules/no-sensitive-data-in-analytics/index.d.ts +0 -8
- package/src/rules/no-sensitive-data-in-analytics/index.js +0 -62
- package/src/rules/no-sensitive-data-in-cache/index.d.ts +0 -8
- package/src/rules/no-sensitive-data-in-cache/index.js +0 -52
- package/src/rules/no-toctou-vulnerability/index.d.ts +0 -7
- package/src/rules/no-toctou-vulnerability/index.js +0 -208
- package/src/rules/no-tracking-without-consent/index.d.ts +0 -6
- package/src/rules/no-tracking-without-consent/index.js +0 -67
- package/src/rules/no-unencrypted-transmission/index.d.ts +0 -11
- package/src/rules/no-unencrypted-transmission/index.js +0 -236
- package/src/rules/no-unescaped-url-parameter/index.d.ts +0 -9
- package/src/rules/no-unescaped-url-parameter/index.js +0 -355
- package/src/rules/no-unsafe-dynamic-require/index.d.ts +0 -5
- package/src/rules/no-unsafe-dynamic-require/index.js +0 -106
- package/src/rules/no-unvalidated-deeplinks/index.d.ts +0 -6
- package/src/rules/no-unvalidated-deeplinks/index.js +0 -62
- package/src/rules/no-unvalidated-user-input/index.d.ts +0 -9
- package/src/rules/no-unvalidated-user-input/index.js +0 -420
- package/src/rules/no-verbose-error-messages/index.d.ts +0 -8
- package/src/rules/no-verbose-error-messages/index.js +0 -68
- package/src/rules/no-zip-slip/index.d.ts +0 -9
- package/src/rules/no-zip-slip/index.js +0 -445
- package/src/rules/require-code-minification/index.d.ts +0 -8
- package/src/rules/require-code-minification/index.js +0 -47
- package/src/rules/require-csp-headers/index.d.ts +0 -6
- package/src/rules/require-csp-headers/index.js +0 -64
- package/src/rules/require-data-minimization/index.d.ts +0 -8
- package/src/rules/require-data-minimization/index.js +0 -53
- package/src/rules/require-dependency-integrity/index.d.ts +0 -6
- package/src/rules/require-dependency-integrity/index.js +0 -64
- package/src/rules/require-https-only/index.d.ts +0 -8
- package/src/rules/require-https-only/index.js +0 -62
- package/src/rules/require-mime-type-validation/index.d.ts +0 -6
- package/src/rules/require-mime-type-validation/index.js +0 -66
- package/src/rules/require-network-timeout/index.d.ts +0 -8
- package/src/rules/require-network-timeout/index.js +0 -50
- package/src/rules/require-package-lock/index.d.ts +0 -8
- package/src/rules/require-package-lock/index.js +0 -63
- package/src/rules/require-secure-credential-storage/index.d.ts +0 -8
- package/src/rules/require-secure-credential-storage/index.js +0 -50
- package/src/rules/require-secure-deletion/index.d.ts +0 -8
- package/src/rules/require-secure-deletion/index.js +0 -44
- package/src/rules/require-storage-encryption/index.d.ts +0 -8
- package/src/rules/require-storage-encryption/index.js +0 -50
- package/src/rules/require-url-validation/index.d.ts +0 -6
- package/src/rules/require-url-validation/index.js +0 -72
|
@@ -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-directive-injection
|
|
8
|
+
* Detects directive injection vulnerabilities (CWE-96)
|
|
9
|
+
*
|
|
10
|
+
* Directive injection occurs when user input is used to inject malicious
|
|
11
|
+
* directives into template systems (Angular, Vue, React, etc.). Attackers
|
|
12
|
+
* can inject directives that execute arbitrary code or manipulate the DOM.
|
|
13
|
+
*
|
|
14
|
+
* False Positive Reduction:
|
|
15
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
16
|
+
* - Safe directive usage patterns
|
|
17
|
+
* - Trusted directive sources
|
|
18
|
+
* - JSDoc annotations (@trusted-directive, @safe-template)
|
|
19
|
+
* - Framework-specific safe patterns
|
|
20
|
+
*/
|
|
21
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
1
22
|
import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
|
|
23
|
+
type MessageIds = 'directiveInjection' | 'unsafeDirectiveName' | 'dynamicDirectiveCreation' | 'templateInjection' | 'unsafeComponentBinding' | 'userControlledTemplate' | 'dangerousInnerHTML' | 'untrustedDirectiveSource' | 'useTrustedDirectives' | 'sanitizeTemplateInput' | 'validateDirectiveNames' | 'strategyTemplateSanitization' | 'strategyContentSecurity' | 'strategyInputValidation';
|
|
2
24
|
export interface Options extends SecurityRuleOptions {
|
|
3
25
|
/** Trusted directive/component names */
|
|
4
26
|
trustedDirectives?: string[];
|
|
@@ -9,4 +31,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
9
31
|
/** Allow dynamic directives in specific contexts */
|
|
10
32
|
allowDynamicInComponents?: boolean;
|
|
11
33
|
}
|
|
12
|
-
|
|
34
|
+
type RuleOptions = [Options?];
|
|
35
|
+
export declare const noDirectiveInjection: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
36
|
+
name: string;
|
|
37
|
+
};
|
|
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.noDirectiveInjection = 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-electron-security-issues
|
|
8
|
+
* Detects Electron security vulnerabilities (CWE-16)
|
|
9
|
+
*
|
|
10
|
+
* Electron applications can be vulnerable to security issues when not properly
|
|
11
|
+
* configured. This rule detects insecure Electron configurations and patterns
|
|
12
|
+
* that could allow privilege escalation, code execution, or data leakage.
|
|
13
|
+
*
|
|
14
|
+
* False Positive Reduction:
|
|
15
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
16
|
+
* - Safe Electron configurations
|
|
17
|
+
* - Development vs production environments
|
|
18
|
+
* - JSDoc annotations (@electron-safe, @dev-only)
|
|
19
|
+
* - Trusted Electron security patterns
|
|
20
|
+
*/
|
|
21
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
1
22
|
import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
|
|
23
|
+
type MessageIds = 'electronSecurityIssue' | 'nodeIntegrationEnabled' | 'contextIsolationDisabled' | 'webSecurityDisabled' | 'insecureContentEnabled' | 'unsafePreloadScript' | 'directNodeAccess' | 'insecureIpcPattern' | 'missingSandbox' | 'enableSecurityFeatures' | 'useContextIsolation' | 'securePreloadScripts' | 'strategySecureDefaults' | 'strategyProcessSeparation' | 'strategyInputValidation';
|
|
2
24
|
export interface Options extends SecurityRuleOptions {
|
|
3
25
|
/** Allow insecure settings in development */
|
|
4
26
|
allowInDev?: boolean;
|
|
@@ -7,4 +29,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
7
29
|
/** Allowed IPC channels */
|
|
8
30
|
allowedIpcChannels?: string[];
|
|
9
31
|
}
|
|
10
|
-
|
|
32
|
+
type RuleOptions = [Options?];
|
|
33
|
+
export declare const noElectronSecurityIssues: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
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.noElectronSecurityIssues = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,3 +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-format-string-injection
|
|
8
|
+
* Detects format string injection vulnerabilities (CWE-134)
|
|
9
|
+
*
|
|
10
|
+
* Format string injection occurs when user input is used as a format string
|
|
11
|
+
* in functions like util.format(), printf-style functions, or logging functions.
|
|
12
|
+
* Attackers can use format specifiers (%s, %d, etc.) to leak information or
|
|
13
|
+
* cause crashes.
|
|
14
|
+
*
|
|
15
|
+
* False Positive Reduction:
|
|
16
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
17
|
+
* - Safe format strings (hardcoded, validated)
|
|
18
|
+
* - Proper format string escaping
|
|
19
|
+
* - JSDoc annotations (@safe-format, @validated)
|
|
20
|
+
* - Trusted formatting libraries
|
|
21
|
+
*/
|
|
22
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
23
|
+
type MessageIds = 'formatStringInjection' | 'unsafeFormatSpecifier' | 'userControlledFormatString' | 'missingFormatValidation' | 'escapeFormatString' | 'useSafeFormatting';
|
|
1
24
|
export interface Options {
|
|
2
25
|
/** Functions that use format strings */
|
|
3
26
|
formatFunctions?: string[];
|
|
@@ -14,4 +37,8 @@ export interface Options {
|
|
|
14
37
|
/** Disable all false positive detection (strict mode) */
|
|
15
38
|
strictMode?: boolean;
|
|
16
39
|
}
|
|
17
|
-
|
|
40
|
+
type RuleOptions = [Options?];
|
|
41
|
+
export declare const noFormatStringInjection: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
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.noFormatStringInjection = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,4 +1,28 @@
|
|
|
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-graphql-injection
|
|
8
|
+
* Detects GraphQL injection vulnerabilities and DoS attacks (CWE-89, CWE-400)
|
|
9
|
+
*
|
|
10
|
+
* GraphQL injection occurs when user input is improperly inserted into GraphQL
|
|
11
|
+
* queries, allowing attackers to:
|
|
12
|
+
* - Read/modify unauthorized data
|
|
13
|
+
* - Perform DoS attacks with complex queries
|
|
14
|
+
* - Extract schema information via introspection
|
|
15
|
+
*
|
|
16
|
+
* False Positive Reduction:
|
|
17
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
18
|
+
* - Safe GraphQL libraries (apollo-server, graphql-tools)
|
|
19
|
+
* - Proper query builders and sanitizers
|
|
20
|
+
* - JSDoc annotations (@safe, @validated)
|
|
21
|
+
* - Input validation functions
|
|
22
|
+
*/
|
|
23
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
1
24
|
import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
|
|
25
|
+
type MessageIds = 'graphqlInjection' | 'introspectionQuery' | 'complexQueryDos' | 'unsafeVariableInterpolation' | 'missingInputValidation' | 'useQueryBuilder' | 'disableIntrospection' | 'limitQueryDepth' | 'strategyQueryBuilder' | 'strategyInputValidation' | 'strategyIntrospection';
|
|
2
26
|
export interface Options extends SecurityRuleOptions {
|
|
3
27
|
/** Allow introspection queries. Default: false (security-first) */
|
|
4
28
|
allowIntrospection?: boolean;
|
|
@@ -9,4 +33,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
9
33
|
/** Functions that validate GraphQL input */
|
|
10
34
|
validationFunctions?: string[];
|
|
11
35
|
}
|
|
12
|
-
|
|
36
|
+
type RuleOptions = [Options?];
|
|
37
|
+
export declare const noGraphqlInjection: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
38
|
+
name: string;
|
|
39
|
+
};
|
|
40
|
+
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.noGraphqlInjection = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,3 +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-hardcoded-credentials
|
|
8
|
+
* Detects hardcoded passwords, API keys, tokens, and other sensitive credentials
|
|
9
|
+
* CWE-798: Use of Hard-coded Credentials
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/798.html
|
|
12
|
+
*/
|
|
13
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
14
|
+
type MessageIds = 'useEnvironmentVariable' | 'useSecretManager' | 'strategyEnv' | 'strategyConfig' | 'strategyVault' | 'strategyAuto';
|
|
1
15
|
export interface Options {
|
|
2
16
|
/** Patterns to ignore (regex strings). Default: [] */
|
|
3
17
|
ignorePatterns?: string[];
|
|
@@ -23,4 +37,8 @@ export interface Options {
|
|
|
23
37
|
/** Strategy for fixing hardcoded credentials: 'env', 'config', 'vault', 'auto' */
|
|
24
38
|
strategy?: 'env' | 'config' | 'vault' | 'auto';
|
|
25
39
|
}
|
|
26
|
-
|
|
40
|
+
type RuleOptions = [Options?];
|
|
41
|
+
export declare const noHardcodedCredentials: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
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.noHardcodedCredentials = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
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
|
-
|
|
8
|
+
type RuleOptions = [Options?];
|
|
9
|
+
export declare const noHardcodedSessionTokens: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
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.noHardcodedSessionTokens = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Detect hardcoded session/JWT tokens
|
|
11
|
+
*/
|
|
7
12
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
8
13
|
exports.noHardcodedSessionTokens = (0, eslint_devkit_1.createRule)({
|
|
9
14
|
name: 'no-hardcoded-session-tokens',
|
|
@@ -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-improper-sanitization
|
|
8
|
+
* Detects improper sanitization of user input (CWE-94, CWE-79, CWE-116)
|
|
9
|
+
*
|
|
10
|
+
* Improper sanitization occurs when user input is not properly cleaned
|
|
11
|
+
* before use in sensitive contexts. This can lead to injection attacks,
|
|
12
|
+
* XSS, or other security vulnerabilities.
|
|
13
|
+
*
|
|
14
|
+
* False Positive Reduction:
|
|
15
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
16
|
+
* - Known safe sanitization patterns
|
|
17
|
+
* - Trusted sanitization libraries
|
|
18
|
+
* - JSDoc annotations (@sanitized, @safe)
|
|
19
|
+
* - Context-aware validation
|
|
20
|
+
*/
|
|
21
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
1
22
|
import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
|
|
23
|
+
type MessageIds = 'improperSanitization' | 'insufficientXssProtection' | 'incompleteHtmlEscaping' | 'unsafeReplaceSanitization' | 'missingContextEncoding' | 'dangerousSanitizerUsage' | 'sqlInjectionSanitization' | 'commandInjectionSanitization' | 'useProperSanitization' | 'validateSanitization' | 'implementContextAware' | 'strategyDefenseInDepth' | 'strategyInputValidation' | 'strategyOutputEncoding';
|
|
2
24
|
export interface Options extends SecurityRuleOptions {
|
|
3
25
|
/** Safe sanitization functions */
|
|
4
26
|
safeSanitizers?: string[];
|
|
@@ -9,4 +31,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
9
31
|
/** Trusted sanitization libraries */
|
|
10
32
|
trustedLibraries?: string[];
|
|
11
33
|
}
|
|
12
|
-
|
|
34
|
+
type RuleOptions = [Options?];
|
|
35
|
+
export declare const noImproperSanitization: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
36
|
+
name: string;
|
|
37
|
+
};
|
|
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.noImproperSanitization = 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-improper-type-validation
|
|
8
|
+
* Detects improper type validation in user input handling (CWE-1287)
|
|
9
|
+
*
|
|
10
|
+
* Improper type validation can lead to security vulnerabilities when
|
|
11
|
+
* user input is not properly validated, allowing attackers to bypass
|
|
12
|
+
* security checks or cause unexpected behavior.
|
|
13
|
+
*
|
|
14
|
+
* False Positive Reduction:
|
|
15
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
16
|
+
* - Safe type checking patterns
|
|
17
|
+
* - TypeScript type guards
|
|
18
|
+
* - Proper validation functions
|
|
19
|
+
* - JSDoc annotations (@validated, @type-checked)
|
|
20
|
+
*/
|
|
21
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
1
22
|
import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
|
|
23
|
+
type MessageIds = 'improperTypeValidation' | 'unsafeTypeofCheck' | 'unsafeInstanceofUsage' | 'looseEqualityTypeCheck' | 'missingNullCheck' | 'unreliableConstructorCheck' | 'incompleteTypeValidation' | 'useTypeofCorrectly' | 'useProperTypeGuards' | 'validateUserInput' | 'strategyTypeGuards' | 'strategySchemaValidation' | 'strategyDefensiveProgramming';
|
|
2
24
|
export interface Options extends SecurityRuleOptions {
|
|
3
25
|
/** Variables that contain user input and should be validated */
|
|
4
26
|
userInputVariables?: string[];
|
|
@@ -7,4 +29,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
7
29
|
/** Whether to allow instanceof in same-realm contexts */
|
|
8
30
|
allowInstanceofSameRealm?: boolean;
|
|
9
31
|
}
|
|
10
|
-
|
|
32
|
+
type RuleOptions = [Options?];
|
|
33
|
+
export declare const noImproperTypeValidation: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
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.noImproperTypeValidation = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,7 +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-insecure-comparison
|
|
8
|
+
* Detects insecure comparison operators (==, !=) that can lead to type coercion vulnerabilities
|
|
9
|
+
* CWE-697: Incorrect Comparison
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/697.html
|
|
12
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'insecureComparison' | 'useStrictEquality' | 'timingUnsafeComparison';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow insecure comparison in test files. Default: false */
|
|
3
18
|
allowInTests?: boolean;
|
|
4
19
|
/** Additional patterns to ignore. Default: [] */
|
|
5
20
|
ignorePatterns?: string[];
|
|
6
21
|
}
|
|
7
|
-
|
|
22
|
+
type RuleOptions = [Options?];
|
|
23
|
+
export declare const noInsecureComparison: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
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.noInsecureComparison = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,4 +1,29 @@
|
|
|
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-ldap-injection
|
|
8
|
+
* Detects LDAP injection vulnerabilities (CWE-90)
|
|
9
|
+
*
|
|
10
|
+
* LDAP injection occurs when user input is improperly inserted into LDAP
|
|
11
|
+
* queries, allowing attackers to:
|
|
12
|
+
* - Bypass authentication and authorization
|
|
13
|
+
* - Extract sensitive directory information
|
|
14
|
+
* - Perform unauthorized LDAP operations
|
|
15
|
+
* - Enumerate users through blind injection techniques
|
|
16
|
+
*
|
|
17
|
+
* False Positive Reduction:
|
|
18
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
19
|
+
* - Safe LDAP libraries with built-in escaping
|
|
20
|
+
* - Input validation and sanitization functions
|
|
21
|
+
* - JSDoc annotations (@ldap-safe, @escaped)
|
|
22
|
+
* - Parameterized LDAP query construction
|
|
23
|
+
*/
|
|
24
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
1
25
|
import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
|
|
26
|
+
type MessageIds = 'ldapInjection' | 'unsafeLdapFilter' | 'unescapedLdapInput' | 'dangerousLdapOperation' | 'useLdapEscaping' | 'validateLdapInput' | 'useParameterizedLdap' | 'strategyInputValidation' | 'strategySafeLibraries' | 'strategyFilterConstruction';
|
|
2
27
|
export interface Options extends SecurityRuleOptions {
|
|
3
28
|
/** LDAP-related function names to check */
|
|
4
29
|
ldapFunctions?: string[];
|
|
@@ -7,4 +32,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
7
32
|
/** Functions that validate LDAP input */
|
|
8
33
|
ldapValidationFunctions?: string[];
|
|
9
34
|
}
|
|
10
|
-
|
|
35
|
+
type RuleOptions = [Options?];
|
|
36
|
+
export declare const noLdapInjection: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
37
|
+
name: string;
|
|
38
|
+
};
|
|
39
|
+
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.noLdapInjection = 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-missing-authentication
|
|
8
|
+
* Detects missing authentication checks in route handlers
|
|
9
|
+
* CWE-287: Improper Authentication
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/287.html
|
|
12
|
+
* @see https://owasp.org/www-community/vulnerabilities/Improper_Authentication
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'missingAuthentication' | 'addAuthentication';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow missing authentication in test files. Default: false */
|
|
3
18
|
allowInTests?: boolean;
|
|
@@ -10,4 +25,8 @@ export interface Options {
|
|
|
10
25
|
/** Additional patterns to ignore. Default: [] */
|
|
11
26
|
ignorePatterns?: string[];
|
|
12
27
|
}
|
|
13
|
-
|
|
28
|
+
type RuleOptions = [Options?];
|
|
29
|
+
export declare const noMissingAuthentication: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
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.noMissingAuthentication = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -316,7 +321,6 @@ exports.noMissingAuthentication = (0, eslint_devkit_2.createRule)({
|
|
|
316
321
|
suggest: [
|
|
317
322
|
{
|
|
318
323
|
messageId: 'addAuthentication',
|
|
319
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
320
324
|
fix: (_fixer) => null,
|
|
321
325
|
},
|
|
322
326
|
],
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
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
|
-
|
|
8
|
+
type RuleOptions = [Options?];
|
|
9
|
+
export declare const noPiiInLogs: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
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.noPiiInLogs = void 0;
|
|
2
9
|
/**
|
|
3
10
|
* @fileoverview Prevent PII (email, SSN, credit cards) in console logs
|
|
4
11
|
* @see https://owasp.org/www-project-mobile-top-10/
|
|
5
12
|
* @see https://cwe.mitre.org/data/definitions/532.html
|
|
6
13
|
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.noPiiInLogs = void 0;
|
|
9
14
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
10
15
|
exports.noPiiInLogs = (0, eslint_devkit_1.createRule)({
|
|
11
16
|
name: 'no-pii-in-logs',
|
|
@@ -13,10 +18,6 @@ exports.noPiiInLogs = (0, eslint_devkit_1.createRule)({
|
|
|
13
18
|
type: 'problem',
|
|
14
19
|
docs: {
|
|
15
20
|
description: 'Prevent PII (email, SSN, credit cards) in console logs',
|
|
16
|
-
category: 'Security',
|
|
17
|
-
recommended: true,
|
|
18
|
-
owaspMobile: ['M6'],
|
|
19
|
-
cweIds: ["CWE-532"],
|
|
20
21
|
},
|
|
21
22
|
messages: {
|
|
22
23
|
violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
|
|
@@ -42,21 +43,23 @@ exports.noPiiInLogs = (0, eslint_devkit_1.createRule)({
|
|
|
42
43
|
return {
|
|
43
44
|
CallExpression(node) {
|
|
44
45
|
// Check console.log/error/warn calls
|
|
45
|
-
if (node.type ===
|
|
46
|
-
node.callee.type ===
|
|
46
|
+
if (node.callee.type === eslint_devkit_1.AST_NODE_TYPES.MemberExpression &&
|
|
47
|
+
node.callee.object.type === eslint_devkit_1.AST_NODE_TYPES.Identifier &&
|
|
47
48
|
node.callee.object.name === 'console' &&
|
|
49
|
+
node.callee.property.type === eslint_devkit_1.AST_NODE_TYPES.Identifier &&
|
|
48
50
|
['log', 'error', 'warn', 'info'].includes(node.callee.property.name)) {
|
|
49
51
|
// Check arguments for PII-related property access
|
|
50
52
|
for (const arg of node.arguments) {
|
|
51
|
-
if (arg.type ===
|
|
52
|
-
|
|
53
|
+
if (arg.type === eslint_devkit_1.AST_NODE_TYPES.MemberExpression &&
|
|
54
|
+
arg.property.type === eslint_devkit_1.AST_NODE_TYPES.Identifier) {
|
|
55
|
+
const propName = arg.property.name.toLowerCase();
|
|
53
56
|
const piiProps = ['email', 'ssn', 'password', 'creditcard', 'phone'];
|
|
54
|
-
if (piiProps.some(p => propName
|
|
57
|
+
if (piiProps.some(p => propName.includes(p))) {
|
|
55
58
|
report(node);
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
// Check string literals mentioning PII
|
|
59
|
-
if (arg.type ===
|
|
62
|
+
if (arg.type === eslint_devkit_1.AST_NODE_TYPES.Literal && typeof arg.value === 'string') {
|
|
60
63
|
const text = arg.value.toLowerCase();
|
|
61
64
|
if (text.includes('email:') || text.includes('ssn:') || text.includes('password:')) {
|
|
62
65
|
report(node);
|
|
@@ -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-privilege-escalation
|
|
8
|
+
* Detects potential privilege escalation vulnerabilities
|
|
9
|
+
* CWE-269: Improper Privilege Management
|
|
10
|
+
*
|
|
11
|
+
* @see https://cwe.mitre.org/data/definitions/269.html
|
|
12
|
+
* @see https://owasp.org/www-community/vulnerabilities/Improper_Access_Control
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'privilegeEscalation' | 'addRoleCheck';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Allow privilege escalation patterns in test files. Default: false */
|
|
3
18
|
allowInTests?: boolean;
|
|
@@ -10,4 +25,8 @@ export interface Options {
|
|
|
10
25
|
/** Additional patterns to ignore. Default: [] */
|
|
11
26
|
ignorePatterns?: string[];
|
|
12
27
|
}
|
|
13
|
-
|
|
28
|
+
type RuleOptions = [Options?];
|
|
29
|
+
export declare const noPrivilegeEscalation: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
30
|
+
name: string;
|
|
31
|
+
};
|
|
32
|
+
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.noPrivilegeEscalation = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|