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,7 +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-redos-vulnerable-regex
|
|
8
|
+
* Detects ReDoS-vulnerable regex patterns in literal regex patterns
|
|
9
|
+
* CWE-400: Uncontrolled Resource Consumption
|
|
10
|
+
*
|
|
11
|
+
* Complements detect-non-literal-regexp by checking literal regex patterns
|
|
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 = 'redosVulnerable' | 'useAtomicGroups' | 'usePossessiveQuantifiers' | 'restructureRegex' | 'useSafeLibrary';
|
|
1
18
|
export interface Options {
|
|
2
19
|
/** Allow certain common patterns. Default: false */
|
|
3
20
|
allowCommonPatterns?: boolean;
|
|
4
21
|
/** Maximum pattern length to analyze. Default: 500 */
|
|
5
22
|
maxPatternLength?: number;
|
|
6
23
|
}
|
|
7
|
-
|
|
24
|
+
type RuleOptions = [Options?];
|
|
25
|
+
export declare const noRedosVulnerableRegex: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
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.noRedosVulnerableRegex = 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-sensitive-data-exposure
|
|
8
|
+
* Detects PII/credentials in logs, responses, or error messages
|
|
9
|
+
* Priority 5: Security with Data Flow Analysis
|
|
10
|
+
* CWE-532: Information Exposure Through Log Files
|
|
11
|
+
*
|
|
12
|
+
* @see https://cwe.mitre.org/data/definitions/532.html
|
|
13
|
+
*/
|
|
14
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
15
|
+
type MessageIds = 'sensitiveDataExposure' | 'redactData' | 'useMasking' | 'removeFromLogs';
|
|
1
16
|
export interface Options {
|
|
2
17
|
/** Sensitive data patterns. Default: ['password', 'secret', 'token', 'key', 'ssn', 'credit', 'card'] */
|
|
3
18
|
sensitivePatterns?: string[];
|
|
@@ -8,4 +23,8 @@ export interface Options {
|
|
|
8
23
|
/** Check API responses. Default: true */
|
|
9
24
|
checkApiResponses?: boolean;
|
|
10
25
|
}
|
|
11
|
-
|
|
26
|
+
type RuleOptions = [Options?];
|
|
27
|
+
export declare const noSensitiveDataExposure: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
28
|
+
name: string;
|
|
29
|
+
};
|
|
30
|
+
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.noSensitiveDataExposure = 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-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,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
9
31
|
/** Maximum recursion depth to allow */
|
|
10
32
|
maxRecursionDepth?: number;
|
|
11
33
|
}
|
|
12
|
-
|
|
34
|
+
type RuleOptions = [Options?];
|
|
35
|
+
export declare const noUncheckedLoopCondition: 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.noUncheckedLoopCondition = 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,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
9
31
|
/** Require resource validation */
|
|
10
32
|
requireResourceValidation?: boolean;
|
|
11
33
|
}
|
|
12
|
-
|
|
34
|
+
type RuleOptions = [Options?];
|
|
35
|
+
export declare const noUnlimitedResourceAllocation: 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.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,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
7
33
|
/** Functions that validate input before deserialization */
|
|
8
34
|
validationFunctions?: string[];
|
|
9
35
|
}
|
|
10
|
-
|
|
36
|
+
type RuleOptions = [Options?];
|
|
37
|
+
export declare const noUnsafeDeserialization: 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.noUnsafeDeserialization = 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,8 @@ export interface Options {
|
|
|
6
23
|
/** Maximum pattern length for dynamic regex. Default: 100 */
|
|
7
24
|
maxPatternLength?: number;
|
|
8
25
|
}
|
|
9
|
-
|
|
26
|
+
type RuleOptions = [Options?];
|
|
27
|
+
export declare const noUnsafeRegexConstruction: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
28
|
+
name: string;
|
|
29
|
+
};
|
|
30
|
+
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,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,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
9
31
|
/** Secure token generation functions */
|
|
10
32
|
secureTokenFunctions?: string[];
|
|
11
33
|
}
|
|
12
|
-
|
|
34
|
+
type RuleOptions = [Options?];
|
|
35
|
+
export declare const noWeakPasswordRecovery: 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.noWeakPasswordRecovery = 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-xpath-injection
|
|
8
|
+
* Detects XPath injection vulnerabilities (CWE-643)
|
|
9
|
+
*
|
|
10
|
+
* XPath injection occurs when user input is improperly inserted into XPath
|
|
11
|
+
* queries, allowing attackers to:
|
|
12
|
+
* - Access unauthorized XML nodes and data
|
|
13
|
+
* - Extract sensitive information from XML documents
|
|
14
|
+
* - Perform XPath-based attacks and data exfiltration
|
|
15
|
+
* - Bypass authentication or authorization checks
|
|
16
|
+
*
|
|
17
|
+
* False Positive Reduction:
|
|
18
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
19
|
+
* - Safe XPath construction methods
|
|
20
|
+
* - Input validation and sanitization
|
|
21
|
+
* - JSDoc annotations (@xpath-safe, @validated)
|
|
22
|
+
* - Trusted XPath libraries
|
|
23
|
+
*/
|
|
24
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
1
25
|
import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
|
|
26
|
+
type MessageIds = 'xpathInjection' | 'unsafeXpathConcatenation' | 'unvalidatedXpathInput' | 'dangerousXpathExpression' | 'useParameterizedXpath' | 'escapeXpathInput' | 'validateXpathQueries' | 'strategyParameterizedQueries' | 'strategyInputValidation' | 'strategySafeConstruction';
|
|
2
27
|
export interface Options extends SecurityRuleOptions {
|
|
3
28
|
/** XPath-related function names to check */
|
|
4
29
|
xpathFunctions?: string[];
|
|
@@ -7,4 +32,8 @@ export interface Options extends SecurityRuleOptions {
|
|
|
7
32
|
/** Functions that validate/sanitize XPath input */
|
|
8
33
|
xpathValidationFunctions?: string[];
|
|
9
34
|
}
|
|
10
|
-
|
|
35
|
+
type RuleOptions = [Options?];
|
|
36
|
+
export declare const noXpathInjection: 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.noXpathInjection = void 0;
|
|
4
9
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
@@ -1,7 +1,36 @@
|
|
|
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-xxe-injection
|
|
8
|
+
* Detects XML External Entity (XXE) injection vulnerabilities (CWE-611)
|
|
9
|
+
*
|
|
10
|
+
* XXE injection occurs when XML parsers process external entity references,
|
|
11
|
+
* allowing attackers to:
|
|
12
|
+
* - Read sensitive local files
|
|
13
|
+
* - Make HTTP requests to internal services
|
|
14
|
+
* - Cause DoS through entity expansion (billion laughs)
|
|
15
|
+
* - Perform SSRF attacks
|
|
16
|
+
*
|
|
17
|
+
* False Positive Reduction:
|
|
18
|
+
* This rule uses security utilities to reduce false positives by detecting:
|
|
19
|
+
* - Safe XML libraries (libxmljs with secure config, xmldom with entity resolution disabled)
|
|
20
|
+
* - Proper parser configuration
|
|
21
|
+
* - JSDoc annotations (@safe, @xxe-safe)
|
|
22
|
+
* - Input validation and sanitization
|
|
23
|
+
*/
|
|
24
|
+
import type { TSESLint } from '@interlace/eslint-devkit';
|
|
25
|
+
type MessageIds = 'xxeInjection' | 'unsafeXmlParser' | 'externalEntityEnabled' | 'untrustedXmlSource';
|
|
1
26
|
export interface Options {
|
|
2
27
|
/** Parser options that indicate safe configuration */
|
|
3
28
|
safeParserOptions?: string[];
|
|
4
29
|
/** Functions that validate/sanitize XML input */
|
|
5
30
|
xmlValidationFunctions?: string[];
|
|
6
31
|
}
|
|
7
|
-
|
|
32
|
+
type RuleOptions = [Options?];
|
|
33
|
+
export declare const noXxeInjection: 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.noXxeInjection = 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 requireBackendAuthorization: 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.requireBackendAuthorization = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* @fileoverview Require server-side authorization checks
|
|
11
|
+
*/
|
|
7
12
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
8
13
|
exports.requireBackendAuthorization = (0, eslint_devkit_1.createRule)({
|
|
9
14
|
name: 'require-backend-authorization',
|
|
@@ -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 requireSecureDefaults: 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.requireSecureDefaults = void 0;
|
|
2
9
|
/**
|
|
3
10
|
* @fileoverview Ensure secure default configurations
|
|
4
11
|
* @see https://owasp.org/www-project-mobile-top-10/
|
|
5
12
|
* @see https://cwe.mitre.org/data/definitions/453.html
|
|
6
13
|
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.requireSecureDefaults = void 0;
|
|
9
14
|
const eslint_devkit_1 = require("@interlace/eslint-devkit");
|
|
10
15
|
exports.requireSecureDefaults = (0, eslint_devkit_1.createRule)({
|
|
11
16
|
name: 'require-secure-defaults',
|
|
@@ -13,10 +18,6 @@ exports.requireSecureDefaults = (0, eslint_devkit_1.createRule)({
|
|
|
13
18
|
type: 'problem',
|
|
14
19
|
docs: {
|
|
15
20
|
description: 'Ensure secure default configurations',
|
|
16
|
-
category: 'Security',
|
|
17
|
-
recommended: true,
|
|
18
|
-
owaspMobile: ['M8'],
|
|
19
|
-
cweIds: ["CWE-453"],
|
|
20
21
|
},
|
|
21
22
|
messages: {
|
|
22
23
|
violationDetected: (0, eslint_devkit_1.formatLLMMessage)({
|
package/src/types/index.d.ts
CHANGED
|
@@ -1,29 +1,19 @@
|
|
|
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
|
+
*/
|
|
1
6
|
/**
|
|
2
7
|
* eslint-plugin-secure-coding Type Exports
|
|
3
8
|
*
|
|
4
9
|
* Barrel file that exports all security rule Options types with consistent naming.
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import type { NoHardcodedCredentialsOptions } from 'eslint-plugin-secure-coding/types';
|
|
9
|
-
*
|
|
10
|
-
* const config: NoHardcodedCredentialsOptions = {
|
|
11
|
-
* ignorePatterns: ['test/*'],
|
|
12
|
-
* };
|
|
13
|
-
* ```
|
|
14
10
|
*/
|
|
15
|
-
import type { Options as DetectEvalWithExpressionOptions } from '../rules/detect-eval-with-expression';
|
|
16
|
-
import type { Options as DetectChildProcessOptions } from '../rules/detect-child-process';
|
|
17
|
-
import type { Options as NoUnsafeDynamicRequireOptions } from '../rules/no-unsafe-dynamic-require';
|
|
18
11
|
import type { Options as NoGraphqlInjectionOptions } from '../rules/no-graphql-injection';
|
|
19
12
|
import type { Options as NoXxeInjectionOptions } from '../rules/no-xxe-injection';
|
|
20
13
|
import type { Options as NoXpathInjectionOptions } from '../rules/no-xpath-injection';
|
|
21
14
|
import type { Options as NoLdapInjectionOptions } from '../rules/no-ldap-injection';
|
|
22
15
|
import type { Options as NoDirectiveInjectionOptions } from '../rules/no-directive-injection';
|
|
23
16
|
import type { Options as NoFormatStringInjectionOptions } from '../rules/no-format-string-injection';
|
|
24
|
-
import type { Options as DetectNonLiteralFsFilenameOptions } from '../rules/detect-non-literal-fs-filename';
|
|
25
|
-
import type { Options as NoZipSlipOptions } from '../rules/no-zip-slip';
|
|
26
|
-
import type { Options as NoToctouVulnerabilityOptions } from '../rules/no-toctou-vulnerability';
|
|
27
17
|
import type { Options as DetectNonLiteralRegexpOptions } from '../rules/detect-non-literal-regexp';
|
|
28
18
|
import type { Options as NoRedosVulnerableRegexOptions } from '../rules/no-redos-vulnerable-regex';
|
|
29
19
|
import type { Options as NoUnsafeRegexConstructionOptions } from '../rules/no-unsafe-regex-construction';
|
|
@@ -31,52 +21,28 @@ import type { Options as DetectObjectInjectionOptions } from '../rules/detect-ob
|
|
|
31
21
|
import type { Options as NoUnsafeDeserializationOptions } from '../rules/no-unsafe-deserialization';
|
|
32
22
|
import type { Options as NoHardcodedCredentialsOptions } from '../rules/no-hardcoded-credentials';
|
|
33
23
|
import type { Options as NoInsecureComparisonOptions } from '../rules/no-insecure-comparison';
|
|
34
|
-
import type { Options as NoUnvalidatedUserInputOptions } from '../rules/no-unvalidated-user-input';
|
|
35
|
-
import type { Options as NoUnescapedUrlParameterOptions } from '../rules/no-unescaped-url-parameter';
|
|
36
24
|
import type { Options as NoImproperSanitizationOptions } from '../rules/no-improper-sanitization';
|
|
37
25
|
import type { Options as NoImproperTypeValidationOptions } from '../rules/no-improper-type-validation';
|
|
38
26
|
import type { Options as NoMissingAuthenticationOptions } from '../rules/no-missing-authentication';
|
|
39
27
|
import type { Options as NoPrivilegeEscalationOptions } from '../rules/no-privilege-escalation';
|
|
40
28
|
import type { Options as NoWeakPasswordRecoveryOptions } from '../rules/no-weak-password-recovery';
|
|
41
|
-
import type { Options as
|
|
42
|
-
import type { Options as NoMissingCorsCheckOptions } from '../rules/no-missing-cors-check';
|
|
43
|
-
import type { Options as NoMissingSecurityHeadersOptions } from '../rules/no-missing-security-headers';
|
|
44
|
-
import type { Options as NoInsecureRedirectsOptions } from '../rules/no-insecure-redirects';
|
|
45
|
-
import type { Options as NoUnencryptedTransmissionOptions } from '../rules/no-unencrypted-transmission';
|
|
46
|
-
import type { Options as NoClickjackingOptions } from '../rules/no-clickjacking';
|
|
47
|
-
import type { Options as NoExposedSensitiveDataOptions } from '../rules/no-exposed-sensitive-data';
|
|
29
|
+
import type { Options as RequireBackendAuthorizationOptions } from '../rules/require-backend-authorization';
|
|
48
30
|
import type { Options as NoSensitiveDataExposureOptions } from '../rules/no-sensitive-data-exposure';
|
|
49
|
-
import type { Options as
|
|
31
|
+
import type { Options as NoPiiInLogsOptions } from '../rules/no-pii-in-logs';
|
|
50
32
|
import type { Options as NoUnlimitedResourceAllocationOptions } from '../rules/no-unlimited-resource-allocation';
|
|
51
33
|
import type { Options as NoUncheckedLoopConditionOptions } from '../rules/no-unchecked-loop-condition';
|
|
52
34
|
import type { Options as NoElectronSecurityIssuesOptions } from '../rules/no-electron-security-issues';
|
|
53
|
-
export type {
|
|
35
|
+
export type { NoGraphqlInjectionOptions, NoXxeInjectionOptions, NoXpathInjectionOptions, NoLdapInjectionOptions, NoDirectiveInjectionOptions, NoFormatStringInjectionOptions, DetectNonLiteralRegexpOptions, NoRedosVulnerableRegexOptions, NoUnsafeRegexConstructionOptions, DetectObjectInjectionOptions, NoUnsafeDeserializationOptions, NoHardcodedCredentialsOptions, NoInsecureComparisonOptions, NoImproperSanitizationOptions, NoImproperTypeValidationOptions, NoMissingAuthenticationOptions, NoPrivilegeEscalationOptions, NoWeakPasswordRecoveryOptions, NoPiiInLogsOptions, RequireBackendAuthorizationOptions, NoSensitiveDataExposureOptions, NoUnlimitedResourceAllocationOptions, NoUncheckedLoopConditionOptions, NoElectronSecurityIssuesOptions, };
|
|
54
36
|
/**
|
|
55
37
|
* Combined type for all security rule options
|
|
56
|
-
* Useful for creating unified configuration objects
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const config: AllSecurityRulesOptions = {
|
|
61
|
-
* 'no-hardcoded-credentials': {
|
|
62
|
-
* ignorePatterns: ['test/*'],
|
|
63
|
-
* },
|
|
64
|
-
* };
|
|
65
|
-
* ```
|
|
66
38
|
*/
|
|
67
39
|
export type AllSecurityRulesOptions = {
|
|
68
|
-
'detect-eval-with-expression'?: DetectEvalWithExpressionOptions;
|
|
69
|
-
'detect-child-process'?: DetectChildProcessOptions;
|
|
70
|
-
'no-unsafe-dynamic-require'?: NoUnsafeDynamicRequireOptions;
|
|
71
40
|
'no-graphql-injection'?: NoGraphqlInjectionOptions;
|
|
72
41
|
'no-xxe-injection'?: NoXxeInjectionOptions;
|
|
73
42
|
'no-xpath-injection'?: NoXpathInjectionOptions;
|
|
74
43
|
'no-ldap-injection'?: NoLdapInjectionOptions;
|
|
75
44
|
'no-directive-injection'?: NoDirectiveInjectionOptions;
|
|
76
45
|
'no-format-string-injection'?: NoFormatStringInjectionOptions;
|
|
77
|
-
'detect-non-literal-fs-filename'?: DetectNonLiteralFsFilenameOptions;
|
|
78
|
-
'no-zip-slip'?: NoZipSlipOptions;
|
|
79
|
-
'no-toctou-vulnerability'?: NoToctouVulnerabilityOptions;
|
|
80
46
|
'detect-non-literal-regexp'?: DetectNonLiteralRegexpOptions;
|
|
81
47
|
'no-redos-vulnerable-regex'?: NoRedosVulnerableRegexOptions;
|
|
82
48
|
'no-unsafe-regex-construction'?: NoUnsafeRegexConstructionOptions;
|
|
@@ -84,22 +50,14 @@ export type AllSecurityRulesOptions = {
|
|
|
84
50
|
'no-unsafe-deserialization'?: NoUnsafeDeserializationOptions;
|
|
85
51
|
'no-hardcoded-credentials'?: NoHardcodedCredentialsOptions;
|
|
86
52
|
'no-insecure-comparison'?: NoInsecureComparisonOptions;
|
|
87
|
-
'no-unvalidated-user-input'?: NoUnvalidatedUserInputOptions;
|
|
88
|
-
'no-unescaped-url-parameter'?: NoUnescapedUrlParameterOptions;
|
|
89
53
|
'no-improper-sanitization'?: NoImproperSanitizationOptions;
|
|
90
54
|
'no-improper-type-validation'?: NoImproperTypeValidationOptions;
|
|
91
55
|
'no-missing-authentication'?: NoMissingAuthenticationOptions;
|
|
92
56
|
'no-privilege-escalation'?: NoPrivilegeEscalationOptions;
|
|
93
57
|
'no-weak-password-recovery'?: NoWeakPasswordRecoveryOptions;
|
|
94
|
-
'no-
|
|
95
|
-
'
|
|
96
|
-
'no-missing-security-headers'?: NoMissingSecurityHeadersOptions;
|
|
97
|
-
'no-insecure-redirects'?: NoInsecureRedirectsOptions;
|
|
98
|
-
'no-unencrypted-transmission'?: NoUnencryptedTransmissionOptions;
|
|
99
|
-
'no-clickjacking'?: NoClickjackingOptions;
|
|
100
|
-
'no-exposed-sensitive-data'?: NoExposedSensitiveDataOptions;
|
|
58
|
+
'no-pii-in-logs'?: NoPiiInLogsOptions;
|
|
59
|
+
'require-backend-authorization'?: RequireBackendAuthorizationOptions;
|
|
101
60
|
'no-sensitive-data-exposure'?: NoSensitiveDataExposureOptions;
|
|
102
|
-
'no-buffer-overread'?: NoBufferOverreadOptions;
|
|
103
61
|
'no-unlimited-resource-allocation'?: NoUnlimitedResourceAllocationOptions;
|
|
104
62
|
'no-unchecked-loop-condition'?: NoUncheckedLoopConditionOptions;
|
|
105
63
|
'no-electron-security-issues'?: NoElectronSecurityIssuesOptions;
|
package/src/types/index.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import type { NoHardcodedCredentialsOptions } from 'eslint-plugin-secure-coding/types';
|
|
10
|
-
*
|
|
11
|
-
* const config: NoHardcodedCredentialsOptions = {
|
|
12
|
-
* ignorePatterns: ['test/*'],
|
|
13
|
-
* };
|
|
14
|
-
* ```
|
|
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.
|
|
15
6
|
*/
|
|
16
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|