eslint-plugin-secure-coding 3.3.4 β 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/README.md +4 -4
- package/package.json +30 -37
- package/src/index.d.ts +17 -23
- package/src/index.js +2 -113
- 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 +86 -151
- package/src/rules/no-hardcoded-credentials/index.js +142 -184
- 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 +39 -35
- 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 +55 -66
- 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 -311
- 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 -44
- 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
package/README.md
CHANGED
|
@@ -128,13 +128,13 @@ See the [ESLint Version Support Policy](../../docs/ESLINT_VERSION_SUPPORT.md)
|
|
|
128
128
|
| [no-hardcoded-session-tokens](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-hardcoded-session-tokens?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-798 | | | This rule detects hardcoded JWT tokens (starting with eyJ), Bearer tokens, and session identifiers | π’ | | | | | |
|
|
129
129
|
| [no-improper-sanitization](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-improper-sanitization?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-116 | | | Detects improper sanitization of user input | π’ | | | | | |
|
|
130
130
|
| [no-improper-type-validation](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-improper-type-validation?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-1287 | | | Detects improper type validation in user input handling | π’ | πΌ | | | | |
|
|
131
|
-
| [no-insecure-comparison](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-insecure-comparison?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-697 | | | Detects insecure comparison operators (==, !=) that can lead to type coercion vulnerabilities | π’ |
|
|
131
|
+
| [no-insecure-comparison](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-insecure-comparison?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-697 | | | Detects insecure comparison operators (==, !=) that can lead to type coercion vulnerabilities | π’ | | | | | |
|
|
132
132
|
| [no-ldap-injection](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-ldap-injection?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-90 | | | Detects LDAP injection vulnerabilities | π’ | πΌ | | | | |
|
|
133
|
-
| [no-missing-authentication](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-missing-authentication?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-287 | | | CWE: [CWE-287](https://cwe.mitre.org/data/definitions/287.html) | π’ |
|
|
133
|
+
| [no-missing-authentication](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-missing-authentication?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-287 | | | CWE: [CWE-287](https://cwe.mitre.org/data/definitions/287.html) | π’ | | | | | |
|
|
134
134
|
| [no-pii-in-logs](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-pii-in-logs?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-359 | | | Prevent personally identifiable information (PII) β emails, SSNs, credit cards, phone numbers β from reachiβ¦ | π’ | | | | π‘ | |
|
|
135
|
-
| [no-privilege-escalation](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-privilege-escalation?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-269 | | | Detects potential privilege escalation vulnerabilities where user input is used to assign roles or permissiβ¦ | π’ |
|
|
135
|
+
| [no-privilege-escalation](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-privilege-escalation?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-269 | | | Detects potential privilege escalation vulnerabilities where user input is used to assign roles or permissiβ¦ | π’ | | β οΈ | | | |
|
|
136
136
|
| [no-redos-vulnerable-regex](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-redos-vulnerable-regex?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-400 | | | ESLint Rule: no-redos-vulnerable-regex | π’ | | | | | |
|
|
137
|
-
| [no-sensitive-data-exposure](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-sensitive-data-exposure?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-532 | | | ESLint Rule: no-sensitive-data-exposure | π’ |
|
|
137
|
+
| [no-sensitive-data-exposure](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-sensitive-data-exposure?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-532 | | | ESLint Rule: no-sensitive-data-exposure | π’ | | β οΈ | | | |
|
|
138
138
|
| [no-unchecked-loop-condition](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-unchecked-loop-condition?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-400 | | | Detects unchecked loop conditions that could cause DoS | π’ | | | | | |
|
|
139
139
|
| [no-unlimited-resource-allocation](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-unlimited-resource-allocation?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-770 | | | Detects unlimited resource allocation that could cause DoS | π’ | | | | | |
|
|
140
140
|
| [no-unsafe-deserialization](https://eslint.interlace.tools/docs/security/plugin-secure-coding/rules/no-unsafe-deserialization?utm_source=github&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding) | CWE-502 | | | Detects unsafe deserialization of untrusted data | π’ | πΌ | | | | |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-secure-coding",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.4.1",
|
|
4
|
+
"description": "ESLint plugin for secure coding β detects LDAP, XPath, XXE, GraphQL and template injection, unsafe deserialization, ReDoS, missing authentication, and PII in logs.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"types": "./src/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"homepage": "https://eslint.interlace.tools/docs/security/plugin-secure-coding?utm_source=npm&utm_medium=referral&utm_campaign=eslint-plugin-secure-coding",
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/ofri-peretz/eslint",
|
|
27
|
+
"url": "git+https://github.com/ofri-peretz/eslint.git",
|
|
28
28
|
"directory": "packages/eslint-plugin-secure-coding"
|
|
29
29
|
},
|
|
30
30
|
"bugs": {
|
|
@@ -35,65 +35,58 @@
|
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"src/",
|
|
38
|
-
"dist/",
|
|
39
38
|
"README.md",
|
|
40
|
-
"LICENSE"
|
|
41
|
-
"CHANGELOG.md",
|
|
42
|
-
"AGENTS.md"
|
|
39
|
+
"LICENSE"
|
|
43
40
|
],
|
|
44
41
|
"keywords": [
|
|
45
42
|
"eslint",
|
|
46
|
-
"eslint-plugin",
|
|
47
43
|
"eslintplugin",
|
|
48
|
-
"
|
|
44
|
+
"eslint-plugin",
|
|
45
|
+
"static-analysis",
|
|
46
|
+
"linting",
|
|
47
|
+
"code-quality",
|
|
49
48
|
"security",
|
|
50
|
-
"
|
|
49
|
+
"sast",
|
|
50
|
+
"appsec",
|
|
51
|
+
"vulnerability",
|
|
51
52
|
"owasp",
|
|
52
|
-
"owasp-top-10",
|
|
53
53
|
"cwe",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
54
|
+
"interlace-security",
|
|
55
|
+
"secure-coding",
|
|
56
|
+
"nodesecurity",
|
|
57
|
+
"owasp-top-10",
|
|
58
58
|
"injection",
|
|
59
|
+
"ldap-injection",
|
|
60
|
+
"xpath-injection",
|
|
61
|
+
"xxe",
|
|
62
|
+
"graphql-injection",
|
|
63
|
+
"template-injection",
|
|
64
|
+
"object-injection",
|
|
65
|
+
"redos",
|
|
66
|
+
"deserialization",
|
|
67
|
+
"hardcoded-credentials",
|
|
68
|
+
"pii",
|
|
69
|
+
"authentication",
|
|
70
|
+
"authorization",
|
|
59
71
|
"llm-optimized",
|
|
60
72
|
"ai-assistant",
|
|
61
|
-
"auto-fix",
|
|
62
73
|
"typescript",
|
|
63
|
-
"
|
|
64
|
-
"code-quality",
|
|
65
|
-
"ast",
|
|
66
|
-
"static-analysis",
|
|
67
|
-
"mcp",
|
|
68
|
-
"model-context-protocol",
|
|
69
|
-
"github-copilot",
|
|
70
|
-
"cursor-ai",
|
|
71
|
-
"claude-ai"
|
|
74
|
+
"auto-fix"
|
|
72
75
|
],
|
|
73
76
|
"engines": {
|
|
74
77
|
"node": ">=18.0.0"
|
|
75
78
|
},
|
|
76
|
-
"scripts": {
|
|
77
|
-
"build": "tsx ../../scripts/build-package.ts",
|
|
78
|
-
"test": "vitest run",
|
|
79
|
-
"test:coverage": "vitest run --coverage",
|
|
80
|
-
"typecheck": "tsc -p tsconfig.lib.json --noEmit"
|
|
81
|
-
},
|
|
82
79
|
"dependencies": {
|
|
83
80
|
"tslib": "^2.3.0",
|
|
84
|
-
"@interlace/eslint-devkit": "^1.
|
|
81
|
+
"@interlace/eslint-devkit": "^1.6.1",
|
|
85
82
|
"scslre": "^0.3.0",
|
|
86
83
|
"@eslint-community/regexpp": "^4.10.0"
|
|
87
84
|
},
|
|
88
|
-
"devDependencies": {
|
|
89
|
-
"@typescript-eslint/parser": "^8.46.2",
|
|
90
|
-
"@typescript-eslint/rule-tester": "^8.46.2"
|
|
91
|
-
},
|
|
92
85
|
"peerDependencies": {
|
|
93
86
|
"eslint": "^8.0.0 || ^9.0.0 || ^10.0.0"
|
|
94
87
|
},
|
|
95
88
|
"funding": {
|
|
96
89
|
"type": "github",
|
|
97
|
-
"url": "https://github.com/ofri-peretz/eslint"
|
|
90
|
+
"url": "git+https://github.com/ofri-peretz/eslint.git"
|
|
98
91
|
}
|
|
99
92
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
export default plugin;
|
|
20
|
-
/**
|
|
21
|
-
* Re-export all types from the types barrel
|
|
22
|
-
*/
|
|
23
|
-
export type { AllSecurityRulesOptions, } from './types/index';
|
|
1
|
+
// Minimal declaration written by scripts/build-package.ts.
|
|
2
|
+
//
|
|
3
|
+
// tsc's generated entry declaration inlined every inferred rule-option type
|
|
4
|
+
// (up to 166 kB per plugin) for an API no consumer calls directly. This types
|
|
5
|
+
// what a flat config actually touches. Per-rule option types remain available
|
|
6
|
+
// from the "./types" subpath export where a plugin provides one.
|
|
7
|
+
import type { Linter, Rule } from 'eslint';
|
|
8
|
+
|
|
9
|
+
export declare const rules: Record<string, Rule.RuleModule>;
|
|
10
|
+
export declare const configs: Record<string, Linter.Config>;
|
|
11
|
+
export declare const plugin: {
|
|
12
|
+
meta: { name: string; version: string };
|
|
13
|
+
rules: Record<string, Rule.RuleModule>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare const _default: typeof plugin;
|
|
17
|
+
export default _default;
|
package/src/index.js
CHANGED
|
@@ -1,26 +1,6 @@
|
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
3
|
exports.configs = exports.plugin = exports.rules = void 0;
|
|
9
|
-
/**
|
|
10
|
-
* eslint-plugin-secure-coding
|
|
11
|
-
*
|
|
12
|
-
* A comprehensive security-focused ESLint plugin restricted to "pure coding security rules"
|
|
13
|
-
* (logic, AST patterns, and generic vulnerabilities independent of environment).
|
|
14
|
-
*
|
|
15
|
-
* Rules focus on:
|
|
16
|
-
* - Language-level logic flaws
|
|
17
|
-
* - AST pattern risks
|
|
18
|
-
* - Generic injection patterns
|
|
19
|
-
* - Cryptographic logic (logic level)
|
|
20
|
-
*
|
|
21
|
-
* @see https://github.com/ofri-peretz/eslint#readme
|
|
22
|
-
*/
|
|
23
|
-
// Security rules - Injection
|
|
24
4
|
const no_graphql_injection_1 = require("./rules/no-graphql-injection");
|
|
25
5
|
const no_xxe_injection_1 = require("./rules/no-xxe-injection");
|
|
26
6
|
const no_xpath_injection_1 = require("./rules/no-xpath-injection");
|
|
@@ -28,40 +8,28 @@ const no_ldap_injection_1 = require("./rules/no-ldap-injection");
|
|
|
28
8
|
const no_directive_injection_1 = require("./rules/no-directive-injection");
|
|
29
9
|
const no_format_string_injection_1 = require("./rules/no-format-string-injection");
|
|
30
10
|
const no_template_injection_1 = require("./rules/no-template-injection");
|
|
31
|
-
// Security rules - Regex
|
|
32
11
|
const detect_non_literal_regexp_1 = require("./rules/detect-non-literal-regexp");
|
|
33
12
|
const no_redos_vulnerable_regex_1 = require("./rules/no-redos-vulnerable-regex");
|
|
34
13
|
const no_unsafe_regex_construction_1 = require("./rules/no-unsafe-regex-construction");
|
|
35
|
-
// Security rules - Object & Prototype
|
|
36
14
|
const detect_object_injection_1 = require("./rules/detect-object-injection");
|
|
37
15
|
const no_unsafe_deserialization_1 = require("./rules/no-unsafe-deserialization");
|
|
38
|
-
// Security rules - Credentials & Crypto
|
|
39
16
|
const no_hardcoded_credentials_1 = require("./rules/no-hardcoded-credentials");
|
|
40
17
|
const no_insecure_comparison_1 = require("./rules/no-insecure-comparison");
|
|
41
|
-
// Security rules - Input Validation
|
|
42
18
|
const no_improper_sanitization_1 = require("./rules/no-improper-sanitization");
|
|
43
19
|
const no_improper_type_validation_1 = require("./rules/no-improper-type-validation");
|
|
44
|
-
// Security rules - Authentication & Authorization
|
|
45
20
|
const no_missing_authentication_1 = require("./rules/no-missing-authentication");
|
|
46
21
|
const no_privilege_escalation_1 = require("./rules/no-privilege-escalation");
|
|
47
22
|
const no_weak_password_recovery_1 = require("./rules/no-weak-password-recovery");
|
|
48
23
|
const require_backend_authorization_1 = require("./rules/require-backend-authorization");
|
|
49
|
-
// Security rules - Data Exposure
|
|
50
24
|
const no_sensitive_data_exposure_1 = require("./rules/no-sensitive-data-exposure");
|
|
51
25
|
const no_pii_in_logs_1 = require("./rules/no-pii-in-logs");
|
|
52
|
-
// Security rules - Resource & DoS
|
|
53
26
|
const no_unlimited_resource_allocation_1 = require("./rules/no-unlimited-resource-allocation");
|
|
54
27
|
const no_unchecked_loop_condition_1 = require("./rules/no-unchecked-loop-condition");
|
|
55
|
-
// Security rules - Auth & runtime hardening (wired 2026-05-09 β implementations existed but were unregistered)
|
|
56
28
|
const detect_weak_password_validation_1 = require("./rules/detect-weak-password-validation");
|
|
57
29
|
const no_electron_security_issues_1 = require("./rules/no-electron-security-issues");
|
|
58
30
|
const no_hardcoded_session_tokens_1 = require("./rules/no-hardcoded-session-tokens");
|
|
59
31
|
const require_secure_defaults_1 = require("./rules/require-secure-defaults");
|
|
60
|
-
/**
|
|
61
|
-
* Collection of all core security ESLint rules
|
|
62
|
-
*/
|
|
63
32
|
exports.rules = {
|
|
64
|
-
// Fundamental Injection (6 rules)
|
|
65
33
|
'no-graphql-injection': no_graphql_injection_1.noGraphqlInjection,
|
|
66
34
|
'no-xxe-injection': no_xxe_injection_1.noXxeInjection,
|
|
67
35
|
'no-xpath-injection': no_xpath_injection_1.noXpathInjection,
|
|
@@ -69,95 +37,55 @@ exports.rules = {
|
|
|
69
37
|
'no-directive-injection': no_directive_injection_1.noDirectiveInjection,
|
|
70
38
|
'no-format-string-injection': no_format_string_injection_1.noFormatStringInjection,
|
|
71
39
|
'no-template-injection': no_template_injection_1.noTemplateInjection,
|
|
72
|
-
// Regex Safety & Stability (3 rules)
|
|
73
40
|
'detect-non-literal-regexp': detect_non_literal_regexp_1.detectNonLiteralRegexp,
|
|
74
41
|
'no-redos-vulnerable-regex': no_redos_vulnerable_regex_1.noRedosVulnerableRegex,
|
|
75
42
|
'no-unsafe-regex-construction': no_unsafe_regex_construction_1.noUnsafeRegexConstruction,
|
|
76
|
-
// Data & Logic Integrity (5 rules)
|
|
77
43
|
'detect-object-injection': detect_object_injection_1.detectObjectInjection,
|
|
78
44
|
'no-unsafe-deserialization': no_unsafe_deserialization_1.noUnsafeDeserialization,
|
|
79
45
|
'no-insecure-comparison': no_insecure_comparison_1.noInsecureComparison,
|
|
80
46
|
'no-improper-sanitization': no_improper_sanitization_1.noImproperSanitization,
|
|
81
47
|
'no-improper-type-validation': no_improper_type_validation_1.noImproperTypeValidation,
|
|
82
|
-
// Auth/Access Logic (4 rules)
|
|
83
48
|
'no-missing-authentication': no_missing_authentication_1.noMissingAuthentication,
|
|
84
49
|
'no-privilege-escalation': no_privilege_escalation_1.noPrivilegeEscalation,
|
|
85
50
|
'no-weak-password-recovery': no_weak_password_recovery_1.noWeakPasswordRecovery,
|
|
86
51
|
'require-backend-authorization': require_backend_authorization_1.requireBackendAuthorization,
|
|
87
|
-
// Secrets & Exposure (3 rules)
|
|
88
52
|
'no-hardcoded-credentials': no_hardcoded_credentials_1.noHardcodedCredentials,
|
|
89
53
|
'no-sensitive-data-exposure': no_sensitive_data_exposure_1.noSensitiveDataExposure,
|
|
90
54
|
'no-pii-in-logs': no_pii_in_logs_1.noPiiInLogs,
|
|
91
|
-
// Resource Handling (2 rules)
|
|
92
55
|
'no-unlimited-resource-allocation': no_unlimited_resource_allocation_1.noUnlimitedResourceAllocation,
|
|
93
56
|
'no-unchecked-loop-condition': no_unchecked_loop_condition_1.noUncheckedLoopCondition,
|
|
94
|
-
// Auth & runtime hardening (4 rules β wired 2026-05-09)
|
|
95
57
|
'detect-weak-password-validation': detect_weak_password_validation_1.detectWeakPasswordValidation,
|
|
96
58
|
'no-electron-security-issues': no_electron_security_issues_1.noElectronSecurityIssues,
|
|
97
59
|
'no-hardcoded-session-tokens': no_hardcoded_session_tokens_1.noHardcodedSessionTokens,
|
|
98
60
|
'require-secure-defaults': require_secure_defaults_1.requireSecureDefaults,
|
|
99
61
|
};
|
|
100
|
-
/**
|
|
101
|
-
* ESLint Plugin object
|
|
102
|
-
*/
|
|
103
62
|
exports.plugin = {
|
|
104
63
|
meta: {
|
|
105
64
|
name: 'eslint-plugin-secure-coding',
|
|
106
|
-
version: '3.
|
|
65
|
+
version: '3.4.1',
|
|
107
66
|
},
|
|
108
67
|
rules: exports.rules,
|
|
109
68
|
};
|
|
110
|
-
/**
|
|
111
|
-
* Preset configurations for security rules
|
|
112
|
-
*/
|
|
113
69
|
const recommendedRules = {
|
|
114
|
-
// Critical - Injection vulnerabilities
|
|
115
|
-
// no-graphql-injection demoted to 'warn' 2026-05-09 β `npm run ilb:severity-audit`
|
|
116
|
-
// showed 61% of Wild hits on adversarial Edge code. Fails the README Β§1
|
|
117
|
-
// β₯ 95% precision floor for `error`-tier severity.
|
|
118
70
|
'secure-coding/no-graphql-injection': 'warn',
|
|
119
71
|
'secure-coding/no-xxe-injection': 'error',
|
|
120
72
|
'secure-coding/no-xpath-injection': 'error',
|
|
121
73
|
'secure-coding/no-ldap-injection': 'error',
|
|
122
|
-
// Critical - Deserialization
|
|
123
|
-
// Demoted 2026-05-09 β 76% Edge ratio.
|
|
124
74
|
'secure-coding/no-unsafe-deserialization': 'warn',
|
|
125
|
-
// High - Regex vulnerabilities
|
|
126
75
|
'secure-coding/detect-non-literal-regexp': 'warn',
|
|
127
|
-
// Demoted 2026-05-09 β 91% Edge ratio.
|
|
128
76
|
'secure-coding/no-redos-vulnerable-regex': 'error',
|
|
129
77
|
'secure-coding/no-unsafe-regex-construction': 'error',
|
|
130
|
-
// High - Prototype pollution
|
|
131
78
|
'secure-coding/detect-object-injection': 'warn',
|
|
132
|
-
// Critical - Credentials
|
|
133
79
|
'secure-coding/no-hardcoded-credentials': 'error',
|
|
134
|
-
'secure-coding/no-insecure-comparison': 'warn',
|
|
135
|
-
// Critical - Template injection
|
|
136
80
|
'secure-coding/no-template-injection': 'error',
|
|
137
|
-
// Critical - Data integrity
|
|
138
81
|
'secure-coding/no-improper-sanitization': 'error',
|
|
139
|
-
// High - Logic
|
|
140
|
-
// NOTE: no-missing-authentication and require-backend-authorization are deprecated in
|
|
141
|
-
// secure-coding β they assume Express route handler context and belong in express-security.
|
|
142
|
-
// Kept in the rules registry for backwards compat; removed from flagship config.
|
|
143
82
|
'secure-coding/no-privilege-escalation': 'warn',
|
|
144
|
-
'secure-coding/no-weak-password-recovery': 'warn',
|
|
145
|
-
// High - Exposure
|
|
83
|
+
'secure-coding/no-weak-password-recovery': 'warn',
|
|
146
84
|
'secure-coding/no-sensitive-data-exposure': 'warn',
|
|
147
|
-
// Medium - Resource & DoS
|
|
148
|
-
// Demoted 2026-05-09 β both rules fail the volume-error-risk gate
|
|
149
|
-
// (firing β₯ 100 times on Wild without sufficient fixture coverage to
|
|
150
|
-
// guarantee precision). Rules were also flagged for β₯ 76% Edge ratio.
|
|
151
85
|
'secure-coding/no-unlimited-resource-allocation': 'warn',
|
|
152
86
|
'secure-coding/no-unchecked-loop-condition': 'warn',
|
|
153
87
|
};
|
|
154
88
|
exports.configs = {
|
|
155
|
-
/**
|
|
156
|
-
* Flagship preset β the two rules from this plugin in the ecosystem-wide
|
|
157
|
-
* flagship list (`.agent/flagship-rules.md`). Use this when you want the
|
|
158
|
-
* highest-signal security subset shippable in CI gates without the noise
|
|
159
|
-
* of `recommended`.
|
|
160
|
-
*/
|
|
161
89
|
flagship: {
|
|
162
90
|
plugins: {
|
|
163
91
|
'secure-coding': exports.plugin,
|
|
@@ -167,79 +95,40 @@ exports.configs = {
|
|
|
167
95
|
'secure-coding/no-redos-vulnerable-regex': 'error',
|
|
168
96
|
},
|
|
169
97
|
},
|
|
170
|
-
/**
|
|
171
|
-
* Recommended security configuration
|
|
172
|
-
*
|
|
173
|
-
* Enables all core security rules with sensible severity levels.
|
|
174
|
-
*/
|
|
175
98
|
recommended: {
|
|
176
99
|
plugins: {
|
|
177
100
|
'secure-coding': exports.plugin,
|
|
178
101
|
},
|
|
179
102
|
rules: recommendedRules,
|
|
180
103
|
},
|
|
181
|
-
/**
|
|
182
|
-
* Recommended-strict configuration
|
|
183
|
-
*
|
|
184
|
-
* Same rule set as `recommended` but every rule is promoted to `'error'`.
|
|
185
|
-
* Use this when you want CI to block on all security findings rather than
|
|
186
|
-
* only warning on lower-confidence rules.
|
|
187
|
-
*
|
|
188
|
-
* This is the configuration independently chosen by production teams who
|
|
189
|
-
* audit `recommended` and decide they want zero tolerance on all 16 rules.
|
|
190
|
-
*/
|
|
191
104
|
'recommended-strict': {
|
|
192
105
|
plugins: {
|
|
193
106
|
'secure-coding': exports.plugin,
|
|
194
107
|
},
|
|
195
108
|
rules: Object.fromEntries(Object.keys(recommendedRules).map((rule) => [rule, 'error'])),
|
|
196
109
|
},
|
|
197
|
-
/**
|
|
198
|
-
* Strict security configuration
|
|
199
|
-
*
|
|
200
|
-
* ALL rules (including experimental and opinionated ones) set to 'error'.
|
|
201
|
-
* Prefer `recommended-strict` unless you specifically need full coverage.
|
|
202
|
-
*/
|
|
203
110
|
strict: {
|
|
204
111
|
plugins: {
|
|
205
112
|
'secure-coding': exports.plugin,
|
|
206
113
|
},
|
|
207
114
|
rules: Object.fromEntries(Object.keys(exports.rules).map(ruleName => [`secure-coding/${ruleName}`, 'error'])),
|
|
208
115
|
},
|
|
209
|
-
/**
|
|
210
|
-
* OWASP Top 10 focused configuration
|
|
211
|
-
*
|
|
212
|
-
* Rules mapped to OWASP Top 10 2021 categories.
|
|
213
|
-
*/
|
|
214
116
|
'owasp-top-10': {
|
|
215
117
|
plugins: {
|
|
216
118
|
'secure-coding': exports.plugin,
|
|
217
119
|
},
|
|
218
120
|
rules: {
|
|
219
|
-
// A01:2021 β Broken Access Control
|
|
220
|
-
// no-missing-authentication removed: Express-specific, use express-security plugin instead
|
|
221
121
|
'secure-coding/no-privilege-escalation': 'warn',
|
|
222
|
-
// A02:2021 β Cryptographic Failures
|
|
223
122
|
'secure-coding/no-hardcoded-credentials': 'error',
|
|
224
|
-
// Demoted from 'error': naming-heuristic detection (fires on variable names
|
|
225
|
-
// that sound sensitive). Cannot be enforcement-grade per I3 invariant.
|
|
226
123
|
'secure-coding/no-sensitive-data-exposure': 'warn',
|
|
227
|
-
// A03:2021 β Injection
|
|
228
124
|
'secure-coding/no-graphql-injection': 'error',
|
|
229
125
|
'secure-coding/no-xxe-injection': 'error',
|
|
230
126
|
'secure-coding/no-xpath-injection': 'error',
|
|
231
127
|
'secure-coding/no-ldap-injection': 'error',
|
|
232
|
-
// A04:2021 β Insecure Design
|
|
233
128
|
'secure-coding/no-weak-password-recovery': 'error',
|
|
234
129
|
'secure-coding/no-improper-type-validation': 'error',
|
|
235
|
-
// A07:2021 β Identification and Authentication Failures
|
|
236
|
-
'secure-coding/no-insecure-comparison': 'error',
|
|
237
|
-
// A08:2021 β Software and Data Integrity Failures
|
|
238
130
|
'secure-coding/no-unsafe-deserialization': 'error',
|
|
239
131
|
},
|
|
240
132
|
},
|
|
241
133
|
};
|
|
242
|
-
/**
|
|
243
|
-
* Default export for ESLint plugin
|
|
244
|
-
*/
|
|
245
134
|
exports.default = exports.plugin;
|
package/src/oxlint.d.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
import { plugin } from './index';
|
|
20
|
-
export = plugin;
|
|
1
|
+
// Minimal declaration written by scripts/build-package.ts.
|
|
2
|
+
//
|
|
3
|
+
// tsc's generated entry declaration inlined every inferred rule-option type
|
|
4
|
+
// (up to 166 kB per plugin) for an API no consumer calls directly. This types
|
|
5
|
+
// what a flat config actually touches. Per-rule option types remain available
|
|
6
|
+
// from the "./types" subpath export where a plugin provides one.
|
|
7
|
+
import type { Linter, Rule } from 'eslint';
|
|
8
|
+
|
|
9
|
+
export declare const rules: Record<string, Rule.RuleModule>;
|
|
10
|
+
export declare const configs: Record<string, Linter.Config>;
|
|
11
|
+
export declare const plugin: {
|
|
12
|
+
meta: { name: string; version: string };
|
|
13
|
+
rules: Record<string, Rule.RuleModule>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare const _default: typeof plugin;
|
|
17
|
+
export default _default;
|
package/src/oxlint.js
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
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
|
-
/**
|
|
8
|
-
* oxlint sub-export.
|
|
9
|
-
*
|
|
10
|
-
* Consumers wire oxlint to this entry via:
|
|
11
|
-
* { "jsPlugins": ["eslint-plugin-secure-coding/oxlint"] }
|
|
12
|
-
*
|
|
13
|
-
* oxlint's JS plugin loader does `require('eslint-plugin-secure-coding/oxlint')` and reads
|
|
14
|
-
* `.rules` off the result. The compiled output of `export = plugin` is
|
|
15
|
-
* `module.exports = plugin`, which gives oxlint the plugin object directly
|
|
16
|
-
* (`{ meta, rules }`) β no wrapper, no `.default` indirection.
|
|
17
|
-
*
|
|
18
|
-
* Generated by scripts/generate-oxlint-shims.mjs. Do not edit by hand.
|
|
19
|
-
*/
|
|
20
2
|
const index_1 = require("./index");
|
|
21
3
|
module.exports = index_1.plugin;
|