eslint-plugin-secure-coding 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -18
- package/src/index.d.ts +17 -23
- package/src/index.js +2 -131
- package/src/oxlint.d.ts +17 -20
- package/src/oxlint.js +0 -18
- package/src/rules/detect-non-literal-regexp/index.js +5 -79
- package/src/rules/detect-object-injection/index.js +2 -221
- package/src/rules/detect-weak-password-validation/index.js +0 -12
- package/src/rules/no-directive-injection/index.js +0 -33
- package/src/rules/no-electron-security-issues/index.js +0 -41
- package/src/rules/no-format-string-injection/index.js +0 -82
- package/src/rules/no-graphql-injection/index.js +8 -133
- package/src/rules/no-hardcoded-credentials/index.js +3 -297
- package/src/rules/no-hardcoded-session-tokens/index.js +0 -11
- package/src/rules/no-improper-sanitization/index.js +0 -44
- package/src/rules/no-improper-type-validation/index.js +1 -51
- package/src/rules/no-insecure-comparison/index.js +2 -43
- package/src/rules/no-ldap-injection/index.js +8 -61
- package/src/rules/no-missing-authentication/index.js +2 -56
- package/src/rules/no-pii-in-logs/index.js +0 -13
- package/src/rules/no-privilege-escalation/index.js +2 -49
- package/src/rules/no-redos-vulnerable-regex/index.js +3 -49
- package/src/rules/no-sensitive-data-exposure/index.js +5 -29
- package/src/rules/no-template-injection/index.js +0 -6
- package/src/rules/no-unchecked-loop-condition/index.js +3 -99
- package/src/rules/no-unlimited-resource-allocation/index.js +2 -75
- package/src/rules/no-unsafe-deserialization/index.js +1 -111
- package/src/rules/no-unsafe-regex-construction/index.js +22 -62
- package/src/rules/no-weak-password-recovery/index.js +0 -43
- package/src/rules/no-xpath-injection/index.js +13 -75
- package/src/rules/no-xxe-injection/index.js +1 -47
- package/src/rules/require-backend-authorization/index.js +0 -10
- package/src/rules/require-secure-defaults/index.js +0 -10
- package/src/types/index.js +0 -5
- package/AGENTS.md +0 -131
- package/CHANGELOG.md +0 -379
- package/src/rules/detect-non-literal-regexp/index.d.ts +0 -28
- package/src/rules/detect-object-injection/index.d.ts +0 -35
- package/src/rules/detect-weak-password-validation/index.d.ts +0 -12
- package/src/rules/no-directive-injection/index.d.ts +0 -38
- package/src/rules/no-electron-security-issues/index.d.ts +0 -36
- package/src/rules/no-format-string-injection/index.d.ts +0 -44
- package/src/rules/no-graphql-injection/index.d.ts +0 -47
- package/src/rules/no-hardcoded-credentials/index.d.ts +0 -95
- package/src/rules/no-hardcoded-session-tokens/index.d.ts +0 -12
- package/src/rules/no-improper-sanitization/index.d.ts +0 -38
- package/src/rules/no-improper-type-validation/index.d.ts +0 -36
- package/src/rules/no-insecure-comparison/index.d.ts +0 -26
- package/src/rules/no-ldap-injection/index.d.ts +0 -53
- package/src/rules/no-missing-authentication/index.d.ts +0 -32
- package/src/rules/no-pii-in-logs/index.d.ts +0 -12
- package/src/rules/no-privilege-escalation/index.d.ts +0 -32
- package/src/rules/no-redos-vulnerable-regex/index.d.ts +0 -28
- package/src/rules/no-sensitive-data-exposure/index.d.ts +0 -30
- package/src/rules/no-template-injection/index.d.ts +0 -23
- package/src/rules/no-unchecked-loop-condition/index.d.ts +0 -38
- package/src/rules/no-unlimited-resource-allocation/index.d.ts +0 -38
- package/src/rules/no-unsafe-deserialization/index.d.ts +0 -40
- package/src/rules/no-unsafe-regex-construction/index.d.ts +0 -30
- package/src/rules/no-weak-password-recovery/index.d.ts +0 -38
- package/src/rules/no-xpath-injection/index.d.ts +0 -39
- package/src/rules/no-xxe-injection/index.d.ts +0 -36
- package/src/rules/require-backend-authorization/index.d.ts +0 -12
- package/src/rules/require-secure-defaults/index.d.ts +0 -12
|
@@ -1,39 +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-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';
|
|
25
|
-
import { type SecurityRuleOptions } from '@interlace/eslint-devkit';
|
|
26
|
-
type MessageIds = 'xpathInjection' | 'unsafeXpathConcatenation' | 'unvalidatedXpathInput' | 'dangerousXpathExpression' | 'useParameterizedXpath' | 'escapeXpathInput' | 'validateXpathQueries' | 'strategyParameterizedQueries' | 'strategyInputValidation' | 'strategySafeConstruction';
|
|
27
|
-
export interface Options extends SecurityRuleOptions {
|
|
28
|
-
/** XPath-related function names to check */
|
|
29
|
-
xpathFunctions?: string[];
|
|
30
|
-
/** Functions that safely construct XPath queries */
|
|
31
|
-
safeXpathConstructors?: string[];
|
|
32
|
-
/** Functions that validate/sanitize XPath input */
|
|
33
|
-
xpathValidationFunctions?: string[];
|
|
34
|
-
}
|
|
35
|
-
type RuleOptions = [Options?];
|
|
36
|
-
export declare const noXpathInjection: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
37
|
-
name: string;
|
|
38
|
-
};
|
|
39
|
-
export {};
|
|
@@ -1,36 +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-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';
|
|
26
|
-
export interface Options {
|
|
27
|
-
/** Parser options that indicate safe configuration */
|
|
28
|
-
safeParserOptions?: string[];
|
|
29
|
-
/** Functions that validate/sanitize XML input */
|
|
30
|
-
xmlValidationFunctions?: string[];
|
|
31
|
-
}
|
|
32
|
-
type RuleOptions = [Options?];
|
|
33
|
-
export declare const noXxeInjection: TSESLint.RuleModule<MessageIds, RuleOptions, unknown, TSESLint.RuleListener> & {
|
|
34
|
-
name: string;
|
|
35
|
-
};
|
|
36
|
-
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 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,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 requireSecureDefaults: import("@typescript-eslint/utils/ts-eslint").RuleModule<"violationDetected", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
10
|
-
name: string;
|
|
11
|
-
};
|
|
12
|
-
export {};
|