eslint-plugin-sequelize-security 0.3.9 → 1.0.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
CHANGED
|
@@ -161,6 +161,7 @@ Part of the **Interlace ESLint ecosystem** — AI-native rules with LLM-optimize
|
|
|
161
161
|
| [`eslint-plugin-prisma-security`](https://www.npmjs.com/package/eslint-plugin-prisma-security) | [](https://www.npmjs.com/package/eslint-plugin-prisma-security) | Prisma security. |
|
|
162
162
|
| [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding) | [](https://www.npmjs.com/package/eslint-plugin-secure-coding) | Injection prevention. |
|
|
163
163
|
| [`eslint-plugin-sqlite-security`](https://www.npmjs.com/package/eslint-plugin-sqlite-security) | [](https://www.npmjs.com/package/eslint-plugin-sqlite-security) | SQLite security. |
|
|
164
|
+
| [`eslint-plugin-supabase-security`](https://www.npmjs.com/package/eslint-plugin-supabase-security) | [](https://www.npmjs.com/package/eslint-plugin-supabase-security) | Supabase security. |
|
|
164
165
|
| [`eslint-plugin-typeorm-security`](https://www.npmjs.com/package/eslint-plugin-typeorm-security) | [](https://www.npmjs.com/package/eslint-plugin-typeorm-security) | TypeORM security. |
|
|
165
166
|
| [`eslint-plugin-vercel-ai-security`](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | [](https://www.npmjs.com/package/eslint-plugin-vercel-ai-security) | AI SDK security. |
|
|
166
167
|
|
|
@@ -168,6 +169,7 @@ Part of the **Interlace ESLint ecosystem** — AI-native rules with LLM-optimize
|
|
|
168
169
|
|
|
169
170
|
| Plugin | Downloads | Description |
|
|
170
171
|
| :--- | :---: | :--- |
|
|
172
|
+
| [`eslint-plugin-cli-floor`](https://www.npmjs.com/package/eslint-plugin-cli-floor) | [](https://www.npmjs.com/package/eslint-plugin-cli-floor) | CLI floor for commander, yargs and burgee. |
|
|
171
173
|
| [`eslint-plugin-conventions`](https://www.npmjs.com/package/eslint-plugin-conventions) | [](https://www.npmjs.com/package/eslint-plugin-conventions) | Team-specific habits and styles. |
|
|
172
174
|
| [`eslint-plugin-import-next`](https://www.npmjs.com/package/eslint-plugin-import-next) | [](https://www.npmjs.com/package/eslint-plugin-import-next) | Fast cycle + import-graph analysis. |
|
|
173
175
|
| [`eslint-plugin-maintainability`](https://www.npmjs.com/package/eslint-plugin-maintainability) | [](https://www.npmjs.com/package/eslint-plugin-maintainability) | Cognitive load and clean-code patterns. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-sequelize-security",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "ESLint plugin for the Sequelize ORM — detects SQL injection in raw sequelize.query() and Sequelize.literal() calls built with string concatenation or template literals, connection configuration that disables TLS or certificate validation, and hardcoded database credentials.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@interlace/eslint-devkit": "^1.
|
|
79
|
+
"@interlace/eslint-devkit": "^1.20.3"
|
|
80
80
|
},
|
|
81
81
|
"funding": {
|
|
82
82
|
"type": "github",
|
package/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.configs=exports.plugin=exports.rules=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.rules={get"no-hardcoded-credentials"(){return require("./rules/no-hardcoded-credentials").noHardcodedCredentials},get"no-mass-assignment"(){return require("./rules/no-mass-assignment").noMassAssignment},get"no-unsafe-query"(){return require("./rules/no-unsafe-query").noUnsafeQuery},get"require-tls"(){return require("./rules/require-tls").requireTls}};(0,eslint_devkit_1.withCanonicalDocsUrls)("plugin-sequelize-security",exports.rules);exports.plugin={meta:{name:"eslint-plugin-sequelize-security",version:"0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.configs=exports.plugin=exports.rules=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.rules={get"no-hardcoded-credentials"(){return require("./rules/no-hardcoded-credentials").noHardcodedCredentials},get"no-mass-assignment"(){return require("./rules/no-mass-assignment").noMassAssignment},get"no-unsafe-query"(){return require("./rules/no-unsafe-query").noUnsafeQuery},get"require-tls"(){return require("./rules/require-tls").requireTls}};(0,eslint_devkit_1.withCanonicalDocsUrls)("plugin-sequelize-security",exports.rules);exports.plugin={meta:{name:"eslint-plugin-sequelize-security",version:"1.0.1"},rules:exports.rules};exports.configs={flagship:{plugins:{"sequelize-security":exports.plugin},rules:{"sequelize-security/no-unsafe-query":"error"}},recommended:{plugins:{"sequelize-security":exports.plugin},rules:{"sequelize-security/no-unsafe-query":"error"}},strict:{plugins:{"sequelize-security":exports.plugin},rules:Object.fromEntries(Object.keys(exports.rules).map(ruleName=>[`sequelize-security/${ruleName}`,"error"]))}};exports.default=exports.plugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noHardcodedCredentials=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noHardcodedCredentials=(0,eslint_devkit_1.createHardcodedCredentialsRule)({meta:{type:"problem",docs:{description:"Disallow literal database passwords in Sequelize connection configuration, including credentials embedded in a connection URL.",url:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-sequelize-security/docs/rules/no-hardcoded-credentials.md",cwe:"CWE-798",cvss:9.8,confidence:"high"}},modules:["sequelize","sequelize-typescript"],connectionKeys:["dialectOptions","dialect","replication"],urlSchemes:["postgres","postgresql","mysql","mariadb"],fix:"Read the password from the environment \u2014 `password: process.env.DB_PASSWORD` \u2014 and keep the value in your secret manager, never in the repo.",urlFix:"Keep the secret out of the URL: build the config from discrete fields with `password: process.env.DB_PASSWORD`, or inject the whole URL as `process.env.DATABASE_URL`.",documentationLink:"https://owasp.org/www-community/vulnerabilities/Use_of_hard-coded_password"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noHardcodedCredentials=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noHardcodedCredentials=(0,eslint_devkit_1.createHardcodedCredentialsRule)({meta:{type:"problem",docs:{description:"Disallow literal database passwords in Sequelize connection configuration, including credentials embedded in a connection URL.",url:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-sequelize-security/docs/rules/no-hardcoded-credentials.md",cwe:"CWE-798",cvss:9.8,confidence:"high"}},modules:["sequelize","sequelize-typescript","@nestjs/sequelize"],connectionKeys:["dialectOptions","dialect","replication"],urlSchemes:["postgres","postgresql","mysql","mariadb"],positionalPassword:2,configShapes:[{key:"dialect",values:["mysql","postgres","sqlite","mariadb","mssql","db2","snowflake","oracle"],with:["username","password","database","host","dialectOptions","use_env_variable"]}],fix:"Read the password from the environment \u2014 `password: process.env.DB_PASSWORD` \u2014 and keep the value in your secret manager, never in the repo.",urlFix:"Keep the secret out of the URL: build the config from discrete fields with `password: process.env.DB_PASSWORD`, or inject the whole URL as `process.env.DATABASE_URL`.",documentationLink:"https://owasp.org/www-community/vulnerabilities/Use_of_hard-coded_password"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noMassAssignment=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noMassAssignment=(0,eslint_devkit_1.createMassAssignmentRule)({meta:{type:"problem",docs:{description:"Disallow writing an inbound request object straight to the database through Sequelize, which lets the caller set every column the model exposes.",url:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-sequelize-security/docs/rules/no-mass-assignment.md",cwe:"CWE-915",cvss:8.1,confidence:"high"}},methods:["create","update","bulkCreate","set","upsert"],payloadKeys:[],
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noMassAssignment=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noMassAssignment=(0,eslint_devkit_1.createMassAssignmentRule)({meta:{type:"problem",docs:{description:"Disallow writing an inbound request object straight to the database through Sequelize, which lets the caller set every column the model exposes.",url:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-sequelize-security/docs/rules/no-mass-assignment.md",cwe:"CWE-915",cvss:8.1,confidence:"high"}},methods:["create","update","bulkCreate","set","upsert","build"],allowlistOption:"fields",payloadKeys:[],modules:["sequelize","sequelize-typescript"],fix:"Name the attributes you accept, or pass Sequelize's own allowlist \u2014 `User.create(req.body, { fields: ['name', 'email'] })`, which is exactly what `fields` is for.",documentationLink:"https://sequelize.org/docs/v6/core-concepts/model-instances/"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noUnsafeQuery=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noUnsafeQuery=(0,eslint_devkit_1.createSqlInjectionRule)({meta:{type:"problem",docs:{description:"Prevent SQL injection by disallowing string concatenation or interpolated template literals in raw Sequelize queries.",url:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-sequelize-security/docs/rules/no-unsafe-query.md",cwe:"CWE-89",cvss:9.8,confidence:"high"}},modules:["sequelize","sequelize-typescript","@nestjs/sequelize"],methods:["query","literal"],requireSqlKeywords:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.noUnsafeQuery=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.noUnsafeQuery=(0,eslint_devkit_1.createSqlInjectionRule)({meta:{type:"problem",docs:{description:"Prevent SQL injection by disallowing string concatenation or interpolated template literals in raw Sequelize queries.",url:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-sequelize-security/docs/rules/no-unsafe-query.md",cwe:"CWE-89",cvss:9.8,confidence:"high"}},modules:["sequelize","sequelize-typescript","@nestjs/sequelize"],methods:["query"],fragmentMethods:["literal"],escapers:["escape"],requireSqlKeywords:true,fix:"Pass values via `replacements` or `bind` instead of interpolating them into the SQL string.",documentationLink:"https://sequelize.org/docs/v7/querying/raw-queries/"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.requireTls=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.requireTls=(0,eslint_devkit_1.createRequireTlsRule)({meta:{type:"problem",docs:{description:"Require TLS on Sequelize connections, so queries and credentials are not sent in cleartext and the server is authenticated.",url:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-sequelize-security/docs/rules/require-tls.md",cwe:"CWE-319",cweJustification:"CWE-319 (Cleartext Transmission) covers the tlsDisabled finding. The second finding, certificateValidationDisabled, is CWE-295 (Improper Certificate Validation): the channel is still encrypted, but the peer is no longer authenticated, so an attacker who answers in place of the database completes the handshake. One rule, two weaknesses \u2014 meta.docs.cwe carries a single identifier, so the secondary mapping is recorded here.",cvss:7.4,confidence:"high"}},modules:["sequelize","sequelize-typescript"],connectionKeys:["dialectOptions","dialect","replication"],urlSchemes:["postgres","postgresql","mysql","mariadb"],fix:"Keep TLS on and supply the CA \u2014 `dialectOptions: { ssl: { require: true, ca } }`.",documentationLink:"https://sequelize.org/docs/v6/other-topics/dialect-specific-things/#postgresql"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.requireTls=void 0;const eslint_devkit_1=require("@interlace/eslint-devkit");exports.requireTls=(0,eslint_devkit_1.createRequireTlsRule)({meta:{type:"problem",docs:{description:"Require TLS on Sequelize connections, so queries and credentials are not sent in cleartext and the server is authenticated.",url:"https://github.com/ofri-peretz/eslint/blob/main/packages/eslint-plugin-sequelize-security/docs/rules/require-tls.md",cwe:"CWE-319",cweJustification:"CWE-319 (Cleartext Transmission) covers the tlsDisabled finding. The second finding, certificateValidationDisabled, is CWE-295 (Improper Certificate Validation): the channel is still encrypted, but the peer is no longer authenticated, so an attacker who answers in place of the database completes the handshake. One rule, two weaknesses \u2014 meta.docs.cwe carries a single identifier, so the secondary mapping is recorded here.",cvss:7.4,confidence:"high"}},modules:["sequelize","sequelize-typescript","@nestjs/sequelize"],connectionKeys:["dialectOptions","dialect","replication"],urlSchemes:["postgres","postgresql","mysql","mariadb"],configShapes:[{key:"dialect",values:["mysql","postgres","sqlite","mariadb","mssql","db2","snowflake","oracle"],with:["username","password","database","host","dialectOptions","use_env_variable"]}],fix:"Keep TLS on and supply the CA \u2014 `dialectOptions: { ssl: { require: true, ca } }`.",documentationLink:"https://sequelize.org/docs/v6/other-topics/dialect-specific-things/#postgresql"});
|